deadlock when CONFIG_KEYBOARD_GPIO is enabled with debug on

Bug #1215471 reported by Anders Roxell
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linaro-networking
Won't Fix
Low
Unassigned

Bug Description

When building kernel: git://git.linaro.org/kernel/linux-linaro-lng.git from
commit 0dc6903b3b36381d95ecdef9a7f1ba2e2146d36d
see .config file: http://people.linaro.org/~anders.roxell/job68289_kernel_config_arndale
I runned into a deadlock see link for more information http://validation.linaro.org/scheduler/job/68289/log_file#L_27_340
here is a snippet from the log:

 [ 3.561043] ======================================================
 [ 3.561046] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
 [ 3.561050] 3.10.6-linaro-arndale #1 Not tainted
 [ 3.561052] ------------------------------------------------------
 [ 3.561056] swapper/0/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
 [ 3.561072] (&(&(&bank->slock)->lock)->wait_lock){+.+...}, at: [<804728f9>] rt_spin_lock_slowlock+0x35/0x214
 [ 3.561074]
 [ 3.561074] and this task is already holding:
 [ 3.561089] (&irq_desc_lock_class){-.....}, at: [<80082491>] __setup_irq+0x69/0x354
 [ 3.561090] which would create a new lock dependency:
 [ 3.561101] (&irq_desc_lock_class){-.....} -> (&(&(&bank->slock)->lock)->wait_lock){+.+...}
 [ 3.561103]
 [ 3.561103] but this new dependency connects a HARDIRQ-irq-safe lock:
 [ 3.561110] (&irq_desc_lock_class){-.....}
 [ 3.561110] ... which became HARDIRQ-irq-safe at:
 [ 3.561119] [<80067d89>] __lock_acquire+0x955/0x193c
 [ 3.561125] [<800691db>] lock_acquire+0x7f/0x104
 [ 3.561131] [<80473383>] _raw_spin_lock+0x2b/0x38
 [ 3.561137] [<80083695>] handle_fasteoi_irq+0x15/0xd0
 [ 3.561143] [<80080ed9>] generic_handle_irq+0x21/0x2c
 [ 3.561150] [<80018ea5>] handle_IRQ+0x35/0x70
 [ 3.561155] [<800084a3>] gic_handle_irq+0x33/0x58
 [ 3.561160] [<8001803f>] __irq_svc+0x3f/0x9c
 [ 3.561166] [<8001913a>] arch_cpu_idle+0x26/0x30
 [ 3.561172] [<8005b8bb>] cpu_startup_entry+0x16f/0x200
 [ 3.561178] [<8069c97d>] start_kernel+0x349/0x354
 [ 3.561183] [<4000808d>] 0x4000808d
 [ 3.561185]
 [ 3.561185] to a HARDIRQ-irq-unsafe lock:
 [ 3.561192] (&(&(&bank->slock)->lock)->wait_lock){+.+...}
 [ 3.561192] ... which became HARDIRQ-irq-unsafe at:
 [ 3.561200] ... [<8006790d>] __lock_acquire+0x4d9/0x193c
 [ 3.561206] [<800691db>] lock_acquire+0x7f/0x104
 [ 3.561210] [<80473383>] _raw_spin_lock+0x2b/0x38
 [ 3.561215] [<804728f9>] rt_spin_lock_slowlock+0x35/0x214
 [ 3.561219] [<80472efd>] rt_spin_lock+0x29/0x40
 [ 3.561227] [<8029d259>] samsung_pinconf_rw+0x79/0xd8
 [ 3.561232] [<8029d321>] samsung_pinconf_group_set+0x41/0x54
 [ 3.561237] [<8029c9ab>] pinconf_apply_setting+0x4f/0x118
 [ 3.561245] [<8029a4af>] pinctrl_select_state+0x8b/0x100
 [ 3.561252] [<802dd17f>] pinctrl_bind_pins+0x53/0x8c
 [ 3.561258] [<802cbb2f>] driver_probe_device+0x4b/0x198
 [ 3.561263] [<802cbcf7>] __driver_attach+0x53/0x54
 [ 3.561268] [<802ca837>] bus_for_each_dev+0x33/0x54
 [ 3.561273] [<802cb567>] bus_add_driver+0x127/0x190
 [ 3.561278] [<802cc10b>] driver_register+0x43/0xd0
 [ 3.561283] [<8000862d>] do_one_initcall+0xd1/0x114
 [ 3.561288] [<8069ca93>] kernel_init_freeable+0x10b/0x180
 [ 3.561295] [<804676e5>] kernel_init+0x19/0x110
 [ 3.561299] [<8001866d>] ret_from_fork+0x11/0x20
 [ 3.561301]
 [ 3.561301] other info that might help us debug this:
 [ 3.561301]
 [ 3.561303] Possible interrupt unsafe locking scenario:
 [ 3.561303]
 [ 3.561305] CPU0 CPU1
 [ 3.561306] ---- ----
 [ 3.561310] lock(&(&(&bank->slock)->lock)->wait_lock);
 [ 3.561312] local_irq_disable();
 [ 3.561316] lock(&irq_desc_lock_class);
 [ 3.561320] lock(&(&(&bank->slock)->lock)->wait_lock);
 [ 3.561322] <Interrupt>
 [ 3.561326] lock(&irq_desc_lock_class);
 [ 3.561327]
 [ 3.561327] *** DEADLOCK ***

when I build the same kernel with CONFIG_KEYBOARD_GPIO=n see .config for more information:
http://people.linaro.org/~anders.roxell/job68349_kernel_config_arndale

I do not get any deadlock and the kernel boots, see log:
http://validation.linaro.org/scheduler/job/68349/log_file

Revision history for this message
Anders Roxell (aroxell) wrote :

additional information:

kernel version 3.10.6 + rt3

Fathi Boudra (fboudra)
affects: arndale → linaro-networking
Revision history for this message
Mike Holmes (mike-holmes) wrote :

This should be reproducable by adding all the following, or possibly a sub set.

CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_DEBUG_NOTIFIERS=y
CONFIG_DEBUG_PREEMPT=y

summary: - deadlock when CONFIG_KEYBOARD_GPIO is enabled
+ deadlock when CONFIG_KEYBOARD_GPIO is enabled wiht debug on
summary: - deadlock when CONFIG_KEYBOARD_GPIO is enabled wiht debug on
+ deadlock when CONFIG_KEYBOARD_GPIO is enabled with debug on
Revision history for this message
viresh kumar (viresh.kumar) wrote :

I tried fixing this bug and spent quite lot of time onto it.. But couldn't get it fixed :(
I was able to reproduce it with arndale.conf distribution.conf linaro-base.conf preempt-rt.conf + some DEBUG options enabled..
It wasn't reproducible on mainline kernel though..

Still unsure what's causing it to trigger..

Changed in linaro-networking:
importance: Undecided → Low
Changed in linaro-networking:
status: New → Confirmed
Revision history for this message
Mike Holmes (mike-holmes) wrote :

Need feedback from Samsung lanfing team, we dont think the driver is RT safe.

Revision history for this message
Tushar Behera (tusharbehera) wrote :

Not much update from Samsung LT on this. We spent some time on this, but with little success.

Changed in linaro-networking:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.