Recursive locking bug in Linux 3.19 USB stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



linux-usb:

I'm seeing the following recursive locking issue in Linux 3.19 USB stack.

This happens on every boot on BCM7xxxx (MIPS) STB board with Dell 30"
monitor's built-in USB hub connected to the BCM7xxx USB port.

I think the problem is:
ehci_irq()
  spin_lock_irqsave(&ehci->lock, flags);
  ...
  if (bh) ehci_work (ehci);
   ...
   hub_irq()
     ehci_urb_enqueue()
       intr_submit()
         spin_lock_irqsave (&ehci->lock, flags);

I can't test the 4.1-rc code immediately, but looking at the code, the
same issue is present there.

Any suggestions on how to fix this?

[    3.917000] =============================================
[    3.917000] [ INFO: possible recursive locking detected ]
[    3.917000] 3.19.0 #1 Not tainted
[    3.917000] ---------------------------------------------
[    3.917000] hotplug/815 is trying to acquire lock:
[    3.917000]  (&(&ehci->lock)->rlock){-.-...}, at: [<8051bdcc>]
ehci_urb_enqueue+0x1fc/0xe80
[    3.917000]
[    3.917000] but task is already holding lock:
[    3.917000]  (&(&ehci->lock)->rlock){-.-...}, at: [<8051a330>]
ehci_irq+0x4c/0x5f4
[    3.917000]
[    3.917000] other info that might help us debug this:
[    3.917000]  Possible unsafe locking scenario:
[    3.917000]
[    3.917000]        CPU0
[    3.917000]        ----
[    3.917000]   lock(&(&ehci->lock)->rlock);
[    3.917000]   lock(&(&ehci->lock)->rlock);
[    3.917000]
[    3.917000]  *** DEADLOCK ***
[    3.917000]
[    3.917000]  May be due to missing lock nesting notation
[    3.917000]
[    3.917000] 2 locks held by hotplug/815:
[    3.917000]  #0:  (&mm->mmap_sem){++++++}, at: [<80018f2c>]
__do_page_fault+0xbc/0x42c
[    3.917000]  #1:  (&(&ehci->lock)->rlock){-.-...}, at: [<8051a330>]
ehci_irq+0x4c/0x5f4
[    3.917000]
[    3.917000] stack backtrace:
[    3.917000] CPU: 0 PID: 815 Comm: hotplug Not tainted 3.19.0-gfiber0+ #1
[    3.917000] Stack : 80088158 80087534 00000000 8008678c 00000000
00000000 80088124 8089cca0
          808952a8 0000032f 00000000 80b3399c 00000001 00000000
002ca165 80088158
          002ca165 803a2b10 80960000 00000000 8089cca0 ce3fd7ec
0000032f 8072f6a4
          00000000 8002a174 00000000 00000000 ce3fd7ec 00000000
80088158 80956867
          00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
          ...
[    3.917000] Call Trace:
[    3.917000] [<8000fa28>] show_stack+0x78/0x90
[    3.917000] [<8073324c>] dump_stack+0xd0/0x144
[    3.917000] [<8007b948>] __lock_acquire+0x15bc/0x171c
[    3.917000] [<8007c340>] lock_acquire+0xe8/0x1d8
[    3.917000] [<8073b1dc>] _raw_spin_lock_irqsave+0x60/0x80
[    3.917000] [<8051bdcc>] ehci_urb_enqueue+0x1fc/0xe80
[    3.917000] [<804f708c>] usb_hcd_submit_urb+0x100/0x440
[    3.917000] [<804eaf5c>] hub_irq+0xb0/0x170
[    3.917000] [<804f4ebc>] __usb_hcd_giveback_urb+0x90/0x1d8
[    3.917000] [<80512468>] qh_completions+0x44c/0x714
[    3.917000] [<80519930>] ehci_work.part.61+0x190/0xa3c
[    3.917000] [<8051a664>] ehci_irq+0x380/0x5f4
[    3.917000] [<804f3b3c>] usb_hcd_irq+0x3c/0x58
[    3.917000] [<80089c24>] handle_irq_event_percpu+0xb4/0x338
[    3.917000] [<80089f0c>] handle_irq_event+0x64/0xa8
[    3.917000] [<8008df48>] handle_level_irq+0x130/0x1b8
[    3.917000] [<8008900c>] generic_handle_irq+0x48/0x64
[    3.917000] [<8073c328>] do_IRQ+0x28/0x34
[    3.917000] [<80003e68>] brcm_intc_dispatch+0x124/0x1f0
[    3.917000] [<80004010>] plat_irq_dispatch+0xdc/0x11c
[    3.917000] [<800082c0>] ret_from_irq+0x0/0x4
[    3.917000] [<8012f360>] do_cow_fault+0xb0/0x1f8
[    3.917000] [<8012f8e8>] handle_pte_fault+0x208/0x470
[    3.917000] [<8012fc58>] handle_mm_fault+0x108/0x168
[    3.917000] [<80018fa0>] __do_page_fault+0x130/0x42c
[    3.917000] [<800082c4>] resume_userspace_check+0x0/0x10
[    3.917000]
[    3.917000] random: nonblocking pool is initialized
[    3.917000] BUG: spinlock lockup suspected on CPU#0, hotplug/815
[    3.917000]  lock: 0xcf69428c, .magic: dead4ead, .owner:
hotplug/815, .owner_cpu: 0
[    3.917000] CPU: 0 PID: 815 Comm: hotplug Not tainted 3.19.0-gfiber0+ #1
[    3.917000] Stack : 80088158 80087298 00000000 10008300 00000000
00000000 80088124 8089cca0
          808952a8 0000032f 00000000 80b3399c 809a0580 cf694000
cdc64900 80088158
          cdc64900 803a2b10 812e0efa 00000000 8089cca0 ce3fd874
0000032f 8072f6a4
          00000000 8002a174 80088124 8089bf08 ce3fd874 00000000
14050000 80956867
          00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
          ...
[    3.917000] Call Trace:
[    3.917000] [<8000fa28>] show_stack+0x78/0x90
[    3.917000] [<8073324c>] dump_stack+0xd0/0x144
[    3.917000] [<8007fce0>] do_raw_spin_lock+0x198/0x1cc
[    3.917000] [<8073b1e4>] _raw_spin_lock_irqsave+0x68/0x80
[    3.917000] [<8051bdcc>] ehci_urb_enqueue+0x1fc/0xe80
[    3.917000] [<804f708c>] usb_hcd_submit_urb+0x100/0x440
[    3.917000] [<804eaf5c>] hub_irq+0xb0/0x170
[    3.917000] [<804f4ebc>] __usb_hcd_giveback_urb+0x90/0x1d8
[    3.917000] [<80512468>] qh_completions+0x44c/0x714
[    3.917000] [<80519930>] ehci_work.part.61+0x190/0xa3c
[    3.917000] [<8051a664>] ehci_irq+0x380/0x5f4
[    3.917000] [<804f3b3c>] usb_hcd_irq+0x3c/0x58
[    3.917000] [<80089c24>] handle_irq_event_percpu+0xb4/0x338
[    3.917000] [<80089f0c>] handle_irq_event+0x64/0xa8
[    3.917000] [<8008df48>] handle_level_irq+0x130/0x1b8
[    3.917000] [<8008900c>] generic_handle_irq+0x48/0x64
[    3.917000] [<8073c328>] do_IRQ+0x28/0x34
[    3.917000] [<80003e68>] brcm_intc_dispatch+0x124/0x1f0
[    3.917000] [<80004010>] plat_irq_dispatch+0xdc/0x11c
[    3.917000] [<800082c0>] ret_from_irq+0x0/0x4
[    3.917000] [<8012f360>] do_cow_fault+0xb0/0x1f8
[    3.917000] [<8012f8e8>] handle_pte_fault+0x208/0x470
[    3.917000] [<8012fc58>] handle_mm_fault+0x108/0x168
[    3.917000] [<80018fa0>] __do_page_fault+0x130/0x42c
[    3.917000] [<800082c4>] resume_userspace_check+0x0/0x10
[    3.917000]
[    3.917000] ------------[ cut here ]------------
[    3.917000] WARNING: CPU: 0 PID: 815 at kernel/smp.c:401
smp_call_function_many+0x134/0x398()
[    3.917000] Modules linked in:
[    3.917000] CPU: 0 PID: 815 Comm: hotplug Not tainted 3.19.0-gfiber0+ #1
[    3.917000] Stack : 80088158 00000000 00000000 00000000 00000000
00000000 80088124 8089cca0
          808952a8 0000032f 00000000 80b3399c 00000000 00000001
00000000 80088158
          00000000 803a2b10 812e0ef8 00000000 8089cca0 ce3fd7c4
0000032f 8072f6a4
          800b9298 8002a174 00000191 00000000 ce3fd7c4 00000000
00000000 80956867
          00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
          ...
[    3.917000] Call Trace:
[    3.917000] [<8000fa28>] show_stack+0x78/0x90
[    3.917000] [<8073324c>] dump_stack+0xd0/0x144
[    3.917000] [<8002a300>] warn_slowpath_common+0xac/0xe8
[    3.917000] [<8002a3f4>] warn_slowpath_null+0x28/0x34
[    3.917000] [<800b9298>] smp_call_function_many+0x134/0x398
[    3.917000] [<800b954c>] smp_call_function+0x50/0xa4
[    3.917000] [<8007fce8>] do_raw_spin_lock+0x1a0/0x1cc
[    3.917000] [<8073b1e4>] _raw_spin_lock_irqsave+0x68/0x80
[    3.917000] [<8051bdcc>] ehci_urb_enqueue+0x1fc/0xe80
[    3.917000] [<804f708c>] usb_hcd_submit_urb+0x100/0x440
[    3.917000] [<804eaf5c>] hub_irq+0xb0/0x170
[    3.917000] [<804f4ebc>] __usb_hcd_giveback_urb+0x90/0x1d8
[    3.917000] [<80512468>] qh_completions+0x44c/0x714
[    3.917000] [<80519930>] ehci_work.part.61+0x190/0xa3c
[    3.917000] [<8051a664>] ehci_irq+0x380/0x5f4
[    3.917000] [<804f3b3c>] usb_hcd_irq+0x3c/0x58
[    3.917000] [<80089c24>] handle_irq_event_percpu+0xb4/0x338
[    3.917000] [<80089f0c>] handle_irq_event+0x64/0xa8
[    3.917000] [<8008df48>] handle_level_irq+0x130/0x1b8
[    3.917000] [<8008900c>] generic_handle_irq+0x48/0x64
[    3.917000] [<8073c328>] do_IRQ+0x28/0x34
[    3.917000] [<80003e68>] brcm_intc_dispatch+0x124/0x1f0
[    3.917000] [<80004010>] plat_irq_dispatch+0xdc/0x11c
[    3.917000] [<800082c0>] ret_from_irq+0x0/0x4
[    3.917000] [<8012f360>] do_cow_fault+0xb0/0x1f8
[    3.917000] [<8012f8e8>] handle_pte_fault+0x208/0x470
[    3.917000] [<8012fc58>] handle_mm_fault+0x108/0x168
[    3.917000] [<80018fa0>] __do_page_fault+0x130/0x42c
[    3.917000] [<800082c4>] resume_userspace_check+0x0/0x10
[    3.917000]
[    3.917000] ---[ end trace f8165acd8065ab80 ]---
[    3.917000] ------------[ cut here ]------------
[    3.917000] WARNING: CPU: 0 PID: 815 at kernel/smp.c:293
smp_call_function_single+0x110/0x140()
[    3.917000] Modules linked in:
[    3.917000] CPU: 0 PID: 815 Comm: hotplug Tainted: G        W
3.19.0-gfiber0+ #1
[    3.917000] Stack : 80088158 00000000 00000000 00000000 00000000
00000000 80088124 8089cca0
          808952a8 0000032f 00000000 80b3399c 809a0580 cf694000
cdc64900 80088158
          cdc64900 803a2ba4 812e0ef8 00000000 8089cca0 ce3fd7d4
0000032f 8072f6a4
          800b8ed0 8002a0d8 00000125 00000000 ce3fd7d4 00000000
cdc64900 80956867
          00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
          ...
[    3.917000] Call Trace:
[    3.917000] [<8000fa28>] show_stack+0x78/0x90
[    3.917000] [<8073324c>] dump_stack+0xd0/0x144
[    3.917000] [<8002a300>] warn_slowpath_common+0xac/0xe8
[    3.917000] [<8002a3f4>] warn_slowpath_null+0x28/0x34
[    3.917000] [<800b8ed0>] smp_call_function_single+0x110/0x140
[    3.917000] [<800b954c>] smp_call_function+0x50/0xa4
[    3.917000] [<8007fce8>] do_raw_spin_lock+0x1a0/0x1cc
[    3.917000] [<8073b1e4>] _raw_spin_lock_irqsave+0x68/0x80
[    3.917000] [<8051bdcc>] ehci_urb_enqueue+0x1fc/0xe80
[    3.917000] [<804f708c>] usb_hcd_submit_urb+0x100/0x440
[    3.917000] [<804eaf5c>] hub_irq+0xb0/0x170
[    3.917000] [<804f4ebc>] __usb_hcd_giveback_urb+0x90/0x1d8
[    3.917000] [<80512468>] qh_completions+0x44c/0x714
[    3.917000] [<80519930>] ehci_work.part.61+0x190/0xa3c
[    3.917000] [<8051a664>] ehci_irq+0x380/0x5f4
[    3.917000] [<804f3b3c>] usb_hcd_irq+0x3c/0x58
[    3.917000] [<80089c24>] handle_irq_event_percpu+0xb4/0x338
[    3.917000] [<80089f0c>] handle_irq_event+0x64/0xa8
[    3.917000] [<8008df48>] handle_level_irq+0x130/0x1b8
[    3.917000] [<8008900c>] generic_handle_irq+0x48/0x64
[    3.917000] [<8073c328>] do_IRQ+0x28/0x34
[    3.917000] [<80003e68>] brcm_intc_dispatch+0x124/0x1f0
[    3.917000] [<80004010>] plat_irq_dispatch+0xdc/0x11c
[    3.917000] [<800082c0>] ret_from_irq+0x0/0x4
[    3.917000] [<8012f360>] do_cow_fault+0xb0/0x1f8
[    3.917000] [<8012f8e8>] handle_pte_fault+0x208/0x470
[    3.917000] [<8012fc58>] handle_mm_fault+0x108/0x168
[    3.917000] [<80018fa0>] __do_page_fault+0x130/0x42c
[    3.917000] [<800082c4>] resume_userspace_check+0x0/0x10
[    3.917000]
[    3.917000] ---[ end trace f8165acd8065ab81 ]---
[    3.917000] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W
3.19.0-gfiber0+ #1
[    3.917000] task: cf4c3ed0 ti: cf4ee000 task.ti: cf4ee000
[    3.917000] $ 0   : 00000000 10008b01 00000000 00000000
[    3.917000] $ 4   : 8000a580 00000000 00000000 7fffffff
[    3.917000] $ 8   : 00000000 ffffffe7 ffffffff ffffffff
[    3.917000] $12   : cf4efeec ffff9fff fffbffff ffffffff
[    3.917000] $16   : 49c2eb06 80996b40 80950000 8095333c
[    3.917000] $20   : 808c0024 00000001 00000001 80990000
[    3.917000] $24   : 00000001 8000a560
[    3.917000] $28   : cf4ee000 cf4efef0 04c2ea80 8007151c
[    3.917000] Hi    : 01e8b3b4
[    3.917000] Lo    : 9bb4a06c
[    3.917000] epc   : 80008720 __r4k_wait+0x20/0x40
[    3.917000] ra    : 8007151c cpu_startup_entry+0x24c/0x390
[    3.917000] Status: 10008b03 KERNEL EXL IE
[    3.917000] Cause : 00800200 (ExcCode 00)
[    3.917000] PrId  : 00025a11 (Broadcom BMIPS5000)
[    3.917000] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W
3.19.0-gfiber0+ #1
[    3.917000] Stack : 80088158 8095cde4 00000001 80087bb0 00000000
00000000 80088124 8089cca0
          808952a8 00000000 00000001 80b3399c 00000000 8094a400
04c2ea80 80088158
          04c2ea80 803a2ba4 00000000 00000000 8089cca0 cf4efc9c
00000000 8072f6a4
          80088158 8002a0d8 00000000 00000000 cf4efc9c 00000000
80088124 80956867
          00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
          ...
[    3.917000] Call Trace:
[    3.917000] [<8000fa28>] show_stack+0x78/0x90
[    3.917000] [<8073324c>] dump_stack+0xd0/0x144
[    3.917000] [<800b9b80>] flush_smp_call_function_queue+0xe4/0x21c
[    3.917000] [<8073c35c>] smp_call_function_interrupt+0x28/0x34
[    3.917000] [<80015164>] bmips5000_ipi_interrupt+0x50/0x80
[    3.917000] [<80089c24>] handle_irq_event_percpu+0xb4/0x338
[    3.917000] [<8008e9e4>] handle_percpu_irq+0xb8/0xf8
[    3.917000] [<8008900c>] generic_handle_irq+0x48/0x64
[    3.917000] [<8073c328>] do_IRQ+0x28/0x34
[    3.917000] [<80003ff0>] plat_irq_dispatch+0xbc/0x11c
[    3.917000] [<800082c0>] ret_from_irq+0x0/0x4
[    3.917000] [<80008720>] __r4k_wait+0x20/0x40
[    3.917000] [<8007151c>] cpu_startup_entry+0x24c/0x390
[    3.917000] [<80015d70>] bmips_secondary_reentry+0x0/0x30
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux