Bug 9532 - circular locking dependency when unplugging USB keyboard
Summary: circular locking dependency when unplugging USB keyboard
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Rafael J. Wysocki
URL:
Keywords:
Depends on:
Blocks: 9243
  Show dependency tree
 
Reported: 2007-12-10 05:30 UTC by Marcus Better
Modified: 2007-12-17 15:50 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.24-rc4
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Kernel config (53.29 KB, text/plain)
2007-12-10 05:31 UTC, Marcus Better
Details
Convert flush_scheduled_work to cancel_work_sync in hub.c (610 bytes, patch)
2007-12-10 13:45 UTC, Alan Stern
Details | Diff

Description Marcus Better 2007-12-10 05:30:35 UTC
Most recent kernel where this bug did not occur: unknown
Distribution: Debian
Hardware Environment: i386 laptop (LG LE50 Express)
Software Environment: Debian testing/unstable, X.org, KDE
Problem Description:

I got the following messages when unplugging a USB-connected wireless keyboard.

Dec 10 14:21:41 better kernel: usb 1-1: USB disconnect, address 3
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: =======================================================
Dec 10 14:21:41 better kernel: [ INFO: possible circular locking dependency detected ]
Dec 10 14:21:41 better kernel: 2.6.24-rc4-lg #1
Dec 10 14:21:41 better kernel: -------------------------------------------------------
Dec 10 14:21:41 better kernel: khubd/680 is trying to acquire lock:
Dec 10 14:21:41 better kernel:  (&dev->pm_mutex){--..}, at: [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: but task is already holding lock:
Dec 10 14:21:41 better kernel:  (&dev->pm_mutex/1){--..}, at: [<f8d034b1>] usb_disconnect+0xf1/0x140 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: which lock already depends on the new lock.
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: the existing dependency chain (in reverse order) is:
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #6 (&dev->pm_mutex/1){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c03b5136>] input_open_device+0x26/0xa0
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d63a5b>] usbhid_open+0x3b/0x50 [usbhid]
Dec 10 14:21:41 better kernel:        [<f8d5eaaa>] hidinput_open+0xa/0x10 [hid]
Dec 10 14:21:41 better kernel:        [<c03b518a>] input_open_device+0x7a/0xa0
Dec 10 14:21:41 better kernel:        [<c037c56a>] kbd_connect+0x6a/0x90
Dec 10 14:21:41 better kernel:        [<c03b4d27>] input_attach_handler+0x57/0x90
Dec 10 14:21:41 better kernel:        [<c03b6f29>] input_register_device+0x1a9/0x210
Dec 10 14:21:41 better kernel:        [<f8d5b992>] hidinput_connect+0x382/0x32d0 [hid]
Dec 10 14:21:41 better kernel:        [<f8d64573>] hid_probe+0x933/0xce0 [usbhid]
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c043fb75>] __mutex_unlock_slowpath+0xb5/0x190
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<f8d098a4>] usb_autopm_do_device+0x84/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09407>] usb_match_one_id+0x27/0xb0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0a6b9>] usb_probe_interface+0xb9/0x140 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0394c27>] driver_probe_device+0x87/0x190
Dec 10 14:21:41 better kernel:        [<c0394eb4>] __driver_attach+0xb4/0xc0
Dec 10 14:21:41 better kernel:        [<c0393fdc>] bus_for_each_dev+0x3c/0x60
Dec 10 14:21:41 better kernel:        [<c0394a96>] driver_attach+0x16/0x20
Dec 10 14:21:41 better kernel:        [<c0394e00>] __driver_attach+0x0/0xc0
Dec 10 14:21:41 better kernel:        [<c039437b>] bus_add_driver+0x8b/0x1f0
Dec 10 14:21:41 better kernel:        [<f8d0a1c9>] usb_register_driver+0x99/0x120 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8877034>] 0xf8877034
Dec 10 14:21:41 better kernel:        [<c0237897>] blocking_notifier_call_chain+0x17/0x20
Dec 10 14:21:41 better kernel:        [<c0246dcd>] sys_init_module+0x12d/0x17d0
Dec 10 14:21:41 better kernel:        [<c02043a6>] syscall_call+0x7/0xb
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #5 (&dev->mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c043f7cb>] mutex_lock_interruptible_nested+0x8b/0x380
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c023f6d8>] mark_held_locks+0x38/0x70
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c037c54f>] kbd_connect+0x4f/0x90
Dec 10 14:21:41 better kernel:        [<c03b4d27>] input_attach_handler+0x57/0x90
Dec 10 14:21:41 better kernel:        [<c03b6f29>] input_register_device+0x1a9/0x210
Dec 10 14:21:41 better kernel:        [<c03b8cc6>] atkbd_connect+0x206/0x230
Dec 10 14:21:41 better kernel:        [<c03b1c68>] serio_connect_driver+0x28/0x50
Dec 10 14:21:41 better kernel:        [<c0394c27>] driver_probe_device+0x87/0x190
Dec 10 14:21:41 better kernel:        [<c0394eb4>] __driver_attach+0xb4/0xc0
Dec 10 14:21:41 better kernel:        [<c0393fdc>] bus_for_each_dev+0x3c/0x60
Dec 10 14:21:41 better kernel:        [<c0394a96>] driver_attach+0x16/0x20
Dec 10 14:21:41 better kernel:        [<c0394e00>] __driver_attach+0x0/0xc0
Dec 10 14:21:41 better kernel:        [<c03b29a6>] serio_thread+0x256/0x360
Dec 10 14:21:41 better kernel:        [<c021b280>] finish_task_switch+0x0/0xb0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c03b2750>] serio_thread+0x0/0x360
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #4 (input_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better kernel:        [<c021b280>] finish_task_switch+0x0/0xb0
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better kernel:        [<c043f7cb>] mutex_lock_interruptible_nested+0x8b/0x380
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better last message repeated 2 times
Dec 10 14:21:41 better kernel:        [<f8e6dda8>] rt2x00rfkill_register+0x78/0xd0 [rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8e6bb9f>] rt2x00lib_initialize+0x13f/0x160 [rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8e6c68a>] rt2x00mac_start+0x3a/0x70 [rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8ef0b77>] ieee80211_open+0x1e7/0x4a0 [mac80211]
Dec 10 14:21:41 better kernel:        [<c023f6d8>] mark_held_locks+0x38/0x70
Dec 10 14:21:41 better kernel:        [<c0224986>] local_bh_enable_ip+0x86/0x110
Dec 10 14:21:41 better kernel:        [<c03cde19>] dev_set_rx_mode+0x19/0x50
Dec 10 14:21:41 better kernel:        [<c03d04dc>] dev_open+0x4c/0x80
Dec 10 14:21:41 better kernel:        [<c03cef52>] dev_change_flags+0x82/0x1b0
Dec 10 14:21:41 better kernel:        [<c03cd3e2>] __dev_get_by_name+0x72/0x90
Dec 10 14:21:41 better kernel:        [<c04176f0>] devinet_ioctl+0x500/0x6a0
Dec 10 14:21:41 better kernel:        [<c03d0330>] dev_ioctl+0x480/0x560
Dec 10 14:21:41 better kernel:        [<c03c1942>] sock_ioctl+0xd2/0x230
Dec 10 14:21:41 better kernel:        [<c03c1870>] sock_ioctl+0x0/0x230
Dec 10 14:21:41 better kernel:        [<c028ac3b>] do_ioctl+0x2b/0x90
Dec 10 14:21:41 better kernel:        [<c028aea1>] vfs_ioctl+0x201/0x2d0
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c028afc6>] sys_ioctl+0x56/0x70
Dec 10 14:21:41 better kernel:        [<c020431e>] sysenter_past_esp+0x5f/0xa5
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #3 (rtnl_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c020ae7f>] save_stack_trace+0x1f/0x40
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c03da340>] linkwatch_event+0x0/0x30
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c022f43b>] run_workqueue+0x15b/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #2 ((linkwatch_work).work){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c03da340>] linkwatch_event+0x0/0x30
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f437>] run_workqueue+0x157/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #1 (events){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c043fdec>] mutex_lock_nested+0x18c/0x2f0
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c022fac3>] flush_workqueue+0x43/0x70
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<f8d04338>] hub_suspend+0x48/0x50 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d04340>] hub_resume+0x0/0x10 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09c18>] usb_suspend_both+0xc8/0x2f0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d098e4>] usb_autopm_do_device+0xc4/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09f70>] usb_autosuspend_work+0x0/0x10 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09f70>] usb_autosuspend_work+0x0/0x10 [usbcore]
Dec 10 14:21:41 better kernel:        [<c022f43b>] run_workqueue+0x15b/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #0 (&dev->pm_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c02407ab>] __lock_acquire+0x9eb/0x1080
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d034ee>] usb_disconnect+0x12e/0x140 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d049d0>] hub_thread+0x460/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c04413bb>] _spin_unlock_irq+0x2b/0x50
Dec 10 14:21:41 better kernel:        [<c021b2db>] finish_task_switch+0x5b/0xb0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<f8d04570>] hub_thread+0x0/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: other info that might help us debug this:
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: 1 lock held by khubd/680:
Dec 10 14:21:41 better kernel:  #0:  (&dev->pm_mutex/1){--..}, at: [<f8d034b1>] usb_disconnect+0xf1/0x140 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: stack backtrace:
Dec 10 14:21:41 better kernel: Pid: 680, comm: khubd Not tainted 2.6.24-rc4-lg #1
Dec 10 14:21:41 better kernel:  [<c023eb4a>] print_circular_bug_tail+0x7a/0x90
Dec 10 14:21:41 better kernel:  [<c02407ab>] __lock_acquire+0x9eb/0x1080
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d034ee>] usb_disconnect+0x12e/0x140 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d049d0>] hub_thread+0x460/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:  [<c04413bb>] _spin_unlock_irq+0x2b/0x50
Dec 10 14:21:41 better kernel:  [<c021b2db>] finish_task_switch+0x5b/0xb0
Dec 10 14:21:41 better kernel:  [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:  [<f8d04570>] hub_thread+0x0/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:  [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:  [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:  [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:  =======================
Comment 1 Marcus Better 2007-12-10 05:31:28 UTC
Created attachment 13943 [details]
Kernel config
Comment 2 Marcus Better 2007-12-10 05:31:56 UTC
After this I cannot seem to connect the USB keyboard again. Nothing happens when I connect it.
Comment 3 Anonymous Emailer 2007-12-10 12:42:42 UTC
Reply-To: akpm@linux-foundation.org

On Mon, 10 Dec 2007 05:30:36 -0800 (PST)
bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9532
> 
>            Summary: circular locking dependency when unplugging USB keyboard
>            Product: Drivers
>            Version: 2.5
>      KernelVersion: 2.6.24-rc4
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: USB
>         AssignedTo: greg@kroah.com
>         ReportedBy: marcus@better.se
> 
> 
> Most recent kernel where this bug did not occur: unknown
> Distribution: Debian
> Hardware Environment: i386 laptop (LG LE50 Express)
> Software Environment: Debian testing/unstable, X.org, KDE
> Problem Description:
> 
> I got the following messages when unplugging a USB-connected wireless
> keyboard.

Appears to be a regression.  The device was dead after this.

Here's the cleaned up lockdep trace (removed the pestiferous word-wrapping):


Dec 10 14:21:41 better kernel: usb 1-1: USB disconnect, address 3
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: =======================================================
Dec 10 14:21:41 better kernel: [ INFO: possible circular locking dependency
detected ]
Dec 10 14:21:41 better kernel: 2.6.24-rc4-lg #1
Dec 10 14:21:41 better kernel: -------------------------------------------------------
Dec 10 14:21:41 better kernel: khubd/680 is trying to acquire lock:
Dec 10 14:21:41 better kernel:  (&dev->pm_mutex){--..}, at: [<f8d0984b>]
usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: but task is already holding lock:
Dec 10 14:21:41 better kernel:  (&dev->pm_mutex/1){--..}, at: [<f8d034b1>]
usb_disconnect+0xf1/0x140 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: which lock already depends on the new lock.
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: the existing dependency chain (in reverse order)
is:
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #6 (&dev->pm_mutex/1){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<c03b5136>] input_open_device+0x26/0xa0
Dec 10 14:21:41 better kernel:        [<f8d09eca>] usb_autopm_do_interface+0x3a/0xd0 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d63a5b>] usbhid_open+0x3b/0x50
[usbhid]
Dec 10 14:21:41 better kernel:        [<f8d5eaaa>] hidinput_open+0xa/0x10 [hid]
Dec 10 14:21:41 better kernel:        [<c03b518a>] input_open_device+0x7a/0xa0
Dec 10 14:21:41 better kernel:        [<c037c56a>] kbd_connect+0x6a/0x90
Dec 10 14:21:41 better kernel:        [<c03b4d27>] input_attach_handler+0x57/0x90
Dec 10 14:21:41 better kernel:        [<c03b6f29>] input_register_device+0x1a9/0x210
Dec 10 14:21:41 better kernel:        [<f8d5b992>] hidinput_connect+0x382/0x32d0 [hid]
Dec 10 14:21:41 better kernel:        [<f8d64573>] hid_probe+0x933/0xce0
[usbhid]
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c043fb75>] __mutex_unlock_slowpath+0xb5/0x190
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<f8d098a4>] usb_autopm_do_device+0x84/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09407>] usb_match_one_id+0x27/0xb0
[usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0a6b9>] usb_probe_interface+0xb9/0x140 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0394c27>] driver_probe_device+0x87/0x190
Dec 10 14:21:41 better kernel:        [<c0394eb4>] __driver_attach+0xb4/0xc0
Dec 10 14:21:41 better kernel:        [<c0393fdc>] bus_for_each_dev+0x3c/0x60
Dec 10 14:21:41 better kernel:        [<c0394a96>] driver_attach+0x16/0x20
Dec 10 14:21:41 better kernel:        [<c0394e00>] __driver_attach+0x0/0xc0
Dec 10 14:21:41 better kernel:        [<c039437b>] bus_add_driver+0x8b/0x1f0
Dec 10 14:21:41 better kernel:        [<f8d0a1c9>] usb_register_driver+0x99/0x120 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8877034>] 0xf8877034
Dec 10 14:21:41 better kernel:        [<c0237897>] blocking_notifier_call_chain+0x17/0x20
Dec 10 14:21:41 better kernel:        [<c0246dcd>] sys_init_module+0x12d/0x17d0
Dec 10 14:21:41 better kernel:        [<c02043a6>] syscall_call+0x7/0xb
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #5 (&dev->mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c043f7cb>] mutex_lock_interruptible_nested+0x8b/0x380
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c023f6d8>] mark_held_locks+0x38/0x70
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c03b509a>] input_register_handle+0x2a/0xa0
Dec 10 14:21:41 better kernel:        [<c037c54f>] kbd_connect+0x4f/0x90
Dec 10 14:21:41 better kernel:        [<c03b4d27>] input_attach_handler+0x57/0x90
Dec 10 14:21:41 better kernel:        [<c03b6f29>] input_register_device+0x1a9/0x210
Dec 10 14:21:41 better kernel:        [<c03b8cc6>] atkbd_connect+0x206/0x230
Dec 10 14:21:41 better kernel:        [<c03b1c68>] serio_connect_driver+0x28/0x50
Dec 10 14:21:41 better kernel:        [<c0394c27>] driver_probe_device+0x87/0x190
Dec 10 14:21:41 better kernel:        [<c0394eb4>] __driver_attach+0xb4/0xc0
Dec 10 14:21:41 better kernel:        [<c0393fdc>] bus_for_each_dev+0x3c/0x60
Dec 10 14:21:41 better kernel:        [<c0394a96>] driver_attach+0x16/0x20
Dec 10 14:21:41 better kernel:        [<c0394e00>] __driver_attach+0x0/0xc0
Dec 10 14:21:41 better kernel:        [<c03b29a6>] serio_thread+0x256/0x360
Dec 10 14:21:41 better kernel:        [<c021b280>] finish_task_switch+0x0/0xb0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c03b2750>] serio_thread+0x0/0x360
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #4 (input_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better kernel:        [<c021b280>] finish_task_switch+0x0/0xb0
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better kernel:        [<c043f7cb>] mutex_lock_interruptible_nested+0x8b/0x380
Dec 10 14:21:41 better kernel:        [<c03b6ed4>] input_register_device+0x154/0x210
Dec 10 14:21:41 better last message repeated 2 times
Dec 10 14:21:41 better kernel:        [<f8e6dda8>] rt2x00rfkill_register+0x78/0xd0 [rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8e6bb9f>] rt2x00lib_initialize+0x13f/0x160 [rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8e6c68a>] rt2x00mac_start+0x3a/0x70
[rt2x00lib]
Dec 10 14:21:41 better kernel:        [<f8ef0b77>] ieee80211_open+0x1e7/0x4a0
[mac80211]
Dec 10 14:21:41 better kernel:        [<c023f6d8>] mark_held_locks+0x38/0x70
Dec 10 14:21:41 better kernel:        [<c0224986>] local_bh_enable_ip+0x86/0x110
Dec 10 14:21:41 better kernel:        [<c03cde19>] dev_set_rx_mode+0x19/0x50
Dec 10 14:21:41 better kernel:        [<c03d04dc>] dev_open+0x4c/0x80
Dec 10 14:21:41 better kernel:        [<c03cef52>] dev_change_flags+0x82/0x1b0
Dec 10 14:21:41 better kernel:        [<c03cd3e2>] __dev_get_by_name+0x72/0x90
Dec 10 14:21:41 better kernel:        [<c04176f0>] devinet_ioctl+0x500/0x6a0
Dec 10 14:21:41 better kernel:        [<c03d0330>] dev_ioctl+0x480/0x560
Dec 10 14:21:41 better kernel:        [<c03c1942>] sock_ioctl+0xd2/0x230
Dec 10 14:21:41 better kernel:        [<c03c1870>] sock_ioctl+0x0/0x230
Dec 10 14:21:41 better kernel:        [<c028ac3b>] do_ioctl+0x2b/0x90
Dec 10 14:21:41 better kernel:        [<c028aea1>] vfs_ioctl+0x201/0x2d0
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c028afc6>] sys_ioctl+0x56/0x70
Dec 10 14:21:41 better kernel:        [<c020431e>] sysenter_past_esp+0x5f/0xa5
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #3 (rtnl_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c020ae7f>] save_stack_trace+0x1f/0x40
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c03da340>] linkwatch_event+0x0/0x30
Dec 10 14:21:41 better kernel:        [<c03da345>] linkwatch_event+0x5/0x30
Dec 10 14:21:41 better kernel:        [<c022f43b>] run_workqueue+0x15b/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #2 ((linkwatch_work).work){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c03da340>] linkwatch_event+0x0/0x30
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f437>] run_workqueue+0x157/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #1 (events){--..}:
Dec 10 14:21:41 better kernel:        [<c0240980>] __lock_acquire+0xbc0/0x1080
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c043fdec>] mutex_lock_nested+0x18c/0x2f0
Dec 10 14:21:41 better kernel:        [<c023f86f>] trace_hardirqs_on+0xaf/0x160
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c022fac3>] flush_workqueue+0x43/0x70
Dec 10 14:21:41 better kernel:        [<c022fa80>] flush_workqueue+0x0/0x70
Dec 10 14:21:41 better kernel:        [<f8d04338>] hub_suspend+0x48/0x50
[usbcore]
Dec 10 14:21:41 better kernel:        [<f8d04340>] hub_resume+0x0/0x10
[usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09c18>] usb_suspend_both+0xc8/0x2f0
[usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d098e4>] usb_autopm_do_device+0xc4/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09f70>] usb_autosuspend_work+0x0/0x10 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d09f70>] usb_autosuspend_work+0x0/0x10 [usbcore]
Dec 10 14:21:41 better kernel:        [<c022f43b>] run_workqueue+0x15b/0x1e0
Dec 10 14:21:41 better kernel:        [<c022f3e4>] run_workqueue+0x104/0x1e0
Dec 10 14:21:41 better kernel:        [<c022fe82>] worker_thread+0x82/0xe0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<c022fe00>] worker_thread+0x0/0xe0
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: -> #0 (&dev->pm_mutex){--..}:
Dec 10 14:21:41 better kernel:        [<c02407ab>] __lock_acquire+0x9eb/0x1080
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:        [<f8d034ee>] usb_disconnect+0x12e/0x140
[usbcore]
Dec 10 14:21:41 better kernel:        [<f8d049d0>] hub_thread+0x460/0xcb0
[usbcore]
Dec 10 14:21:41 better kernel:        [<c04413bb>] _spin_unlock_irq+0x2b/0x50
Dec 10 14:21:41 better kernel:        [<c021b2db>] finish_task_switch+0x5b/0xb0
Dec 10 14:21:41 better kernel:        [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:        [<f8d04570>] hub_thread+0x0/0xcb0
[usbcore]
Dec 10 14:21:41 better kernel:        [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:        [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:        [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:        [<ffffffff>] 0xffffffff
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: other info that might help us debug this:
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: 1 lock held by khubd/680:
Dec 10 14:21:41 better kernel:  #0:  (&dev->pm_mutex/1){--..}, at: [<f8d034b1>] usb_disconnect+0xf1/0x140 [usbcore]
Dec 10 14:21:41 better kernel: 
Dec 10 14:21:41 better kernel: stack backtrace:
Dec 10 14:21:41 better kernel: Pid: 680, comm: khubd Not tainted 2.6.24-rc4-lg
#1
Dec 10 14:21:41 better kernel:  [<c023eb4a>] print_circular_bug_tail+0x7a/0x90
Dec 10 14:21:41 better kernel:  [<c02407ab>] __lock_acquire+0x9eb/0x1080
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<c0240e9f>] lock_acquire+0x5f/0x80
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<c043fcdf>] mutex_lock_nested+0x7f/0x2f0
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d0984b>] usb_autopm_do_device+0x2b/0x110 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d034ee>] usb_disconnect+0x12e/0x140 [usbcore]
Dec 10 14:21:41 better kernel:  [<f8d049d0>] hub_thread+0x460/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:  [<c04413bb>] _spin_unlock_irq+0x2b/0x50
Dec 10 14:21:41 better kernel:  [<c021b2db>] finish_task_switch+0x5b/0xb0
Dec 10 14:21:41 better kernel:  [<c0233070>] autoremove_wake_function+0x0/0x40
Dec 10 14:21:41 better kernel:  [<f8d04570>] hub_thread+0x0/0xcb0 [usbcore]
Dec 10 14:21:41 better kernel:  [<c0232dd2>] kthread+0x42/0x70
Dec 10 14:21:41 better kernel:  [<c0232d90>] kthread+0x0/0x70
Dec 10 14:21:41 better kernel:  [<c0204f5b>] kernel_thread_helper+0x7/0x1c
Dec 10 14:21:41 better kernel:  =======================
Comment 4 Marcus Better 2007-12-10 12:54:10 UTC
Andrew Morton skrev:
>> http://bugzilla.kernel.org/show_bug.cgi?id=9532
>>
>>            Summary: circular locking dependency when unplugging USB keyboard
>> I got the following messages when unplugging a USB-connected wireless
>> keyboard.
> 
> Appears to be a regression.  The device was dead after this.

Sorry, I have to try to confirm the deadness again tomorrow. It's 
possible that the keyboard needed some prodding (pressing some sort of 
reset button), although it usually just works.

Marcus
Comment 5 Alan Stern 2007-12-10 13:45:31 UTC
Created attachment 13955 [details]
Convert flush_scheduled_work to cancel_work_sync in hub.c

Does the problem occur repeatably?  If it does, you ought to be able to tell whether this patch helps.
Comment 6 Marcus Better 2007-12-11 01:35:06 UTC
> ------- Comment #5 from stern@rowland.harvard.edu  2007-12-10 13:45 -------
> Convert flush_scheduled_work to cancel_work_sync in hub.c
>
> Does the problem occur repeatably?

Yes, the problem is reproducible but only occurs the first time the keyboard 
is unplugged. If I repeatedly insert and unplug it, the message is not shown.

I also have to modify my previous report: the keyboard now works after 
plugging it in (even without the patch).

>  If it does, you ought to be able to tell whether this patch helps.

Yes, it eliminates the messages.

Cheers,

Marcus
Comment 7 Alan Stern 2007-12-11 13:07:07 UTC
The patch has been submitted.  You can close the bug whenever you want.
Comment 8 Rafael J. Wysocki 2007-12-17 15:50:24 UTC
Fixed by:

commit d48bd977e0dd8c17081d12242bfc09d743ea0d26
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Tue Dec 11 16:02:23 2007 -0500

    USB: fix locking loop by avoiding flush_scheduled_work

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d48bd977e0dd8c17081d12242bfc09d743ea0d26

Note You need to log in before you can comment on or make changes to this bug.