[linux-yocto] [PATCH] usb ehci-ci13612: Enable HCD_BH mode in ci13612 since EHCI doesn't work without it anymore.

Zhenbo Gao zhenbo.gao at windriver.com
Tue May 24 00:05:27 PDT 2016


From: Fredrik Markstrom <fredrik.markstrom at gmail.com>

The non-HCD_BH mode has a AB-BA lock problem, but we wan't HCD_BH mode anyway since it
performs better and all other ehci drivers uses it. It will cause the lockdep splat below:

[    4.240663] ======================================================
[    4.246838] [ INFO: possible circular locking dependency detected ]
[    4.253101] 4.1.15-rt13-wrl800.1_1.21_1p1+ #98 Not tainted
[    4.258581] -------------------------------------------------------
[    4.264844] swapper/0/0 is trying to acquire lock:
[    4.269629]  (&(&io->lock)->rlock){-.....}, at: [<c07a2850>] sg_complete+0x20/0x1cc
[    4.277320]
               but task is already holding lock:
[    4.283148]  (&(&ehci->lock)->rlock){-.-...}, at: [<c07b5cc8>] ehci_irq+0x20/0x2a4
[    4.290743]
               which lock already depends on the new lock.

[    4.298916]
               the existing dependency chain (in reverse order) is:
[    4.306393]
               -> #1 (&(&ehci->lock)->rlock){-.-...}:
[    4.311379]        [<c07b42c8>] ehci_urb_enqueue+0x74/0xdb0
[    4.316958]        [<c079fce0>] usb_hcd_submit_urb+0xac/0x7e0
[    4.322708]        [<c07a2098>] usb_sg_wait+0x4c/0x148
[    4.327850]        [<c07b79c8>] usb_stor_bulk_transfer_sglist.part.2+0x7c/0xd8
[    4.335076]        [<c07b7a6c>] usb_stor_bulk_srb+0x48/0x50
[    4.340652]        [<c07b7b88>] usb_stor_Bulk_transport+0x114/0x36c
[    4.346921]        [<c07b83b0>] usb_stor_invoke_transport+0x20/0x470
[    4.353278]        [<c07b96ec>] usb_stor_control_thread+0x144/0x220
[    4.359548]        [<c044abb0>] kthread+0xe0/0xf8
[    4.364258]        [<c040f7f8>] ret_from_fork+0x14/0x3c
[    4.369489]
               -> #0 (&(&io->lock)->rlock){-.....}:
[    4.374300]        [<c094dac8>] _raw_spin_lock_irq+0x40/0x50
[    4.379964]        [<c07a2850>] sg_complete+0x20/0x1cc
[    4.385107]        [<c079ec78>] __usb_hcd_giveback_urb+0x98/0x140
[    4.391204]        [<c07b20f8>] qh_completions+0x368/0x4a8
[    4.396694]        [<c07b5a88>] ehci_work.part.16+0x754/0x888
[    4.402444]        [<c07b5f34>] ehci_irq+0x28c/0x2a4
[    4.407411]        [<c079e0a4>] usb_hcd_irq+0x24/0x38
[    4.412466]        [<c047fd9c>] handle_irq_event_percpu+0xa4/0x59c
[    4.418650]        [<c04802d0>] handle_irq_event+0x3c/0x5c
[    4.424138]        [<c04832fc>] handle_fasteoi_irq+0xc4/0x1a4
[    4.429888]        [<c047f6e4>] __handle_domain_irq+0xa0/0x110
[    4.435724]        [<c04096f8>] axxia_gic_handle_irq+0x26c/0x294
[    4.441733]        [<c094e684>] __irq_svc+0x44/0x90
[    4.446614]        [<c046cfa4>] cpu_startup_entry+0xcc/0x410
[    4.452277]        [<c046cfa4>] cpu_startup_entry+0xcc/0x410
[    4.457938]        [<c0b22cac>] start_kernel+0x3e0/0x3ec
[    4.463255]        [<00408088>] 0x408088

Signed-off-by: Fredrik Markstrom <fredrik.markstrom at gmail.com>
Signed-off-by: Zhenbo Gao <zhenbo.gao at windriver.com>
---
 drivers/usb/host/ehci-ci13612.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 81d954f..d5d5f30 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -232,7 +232,7 @@ static const struct hc_driver ci13612_hc_driver = {
 	.product_desc		= "CI13612A EHCI USB Host Controller",
 	.hcd_priv_size		= sizeof(struct ehci_hcd),
 	.irq			= ehci_irq,
-	.flags			= HCD_MEMORY | HCD_USB2,
+	.flags			= HCD_MEMORY | HCD_USB2 | HCD_BH,
 	.reset			= ci13612_ehci_init,
 	.start			= ci13612_ehci_run,
 	.stop			= ehci_stop,
-- 
1.9.1



More information about the linux-yocto mailing list