summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@redhat.com>2014-02-24 11:09:22 -0500
committerJosh Boyer <jwboyer@redhat.com>2014-02-24 11:10:50 -0500
commit4c81e23fa19e35c1fed8adfe8863743be69c9a8c (patch)
tree602343167e2e9aba87f456b1a6b159d679401469
parent8ee4982e1f0c632fb6f39767ec6ab83c6edc3f33 (diff)
downloadkernel-4c81e23fa19e35c1fed8adfe8863743be69c9a8c.tar.gz
kernel-4c81e23fa19e35c1fed8adfe8863743be69c9a8c.tar.xz
kernel-4c81e23fa19e35c1fed8adfe8863743be69c9a8c.zip
Fix lockdep issue in EHCI when using threaded IRQs (rhbz 1056170)
-rw-r--r--kernel.spec9
-rw-r--r--usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch57
2 files changed, 66 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec
index 0eb9008f7..eaf0da1de 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -624,6 +624,9 @@ Patch25201: cifs-sanity-check-length-of-data-to-send-before-sending.patch
#rhbz 1062833
Patch25202: dma-debug-account-for-cachelines-and-read-only-mappings.patch
+#rhbz 1056170
+Patch25025: usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1270,6 +1273,9 @@ ApplyPatch cifs-sanity-check-length-of-data-to-send-before-sending.patch
#rhbz 1062833
ApplyPatch dma-debug-account-for-cachelines-and-read-only-mappings.patch
+#rhbz 1056170
+ApplyPatch usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2049,6 +2055,9 @@ fi
# ||----w |
# || ||
%changelog
+* Mon Feb 24 2014 Josh Boyer <jwboyer@fedoraproject.org>
+- Fix lockdep issue in EHCI when using threaded IRQs (rhbz 1056170)
+
* Mon Feb 24 2014 Josh Boyer <jwboyer@fedoraproject.org> - 3.14.0-0.rc4.git0.1
- Linux v3.14-rc4
- Disable debugging options.
diff --git a/usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch b/usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch
new file mode 100644
index 000000000..9593c14e2
--- /dev/null
+++ b/usb-ehci-fix-deadlock-when-threadirqs-option-is-used.patch
@@ -0,0 +1,57 @@
+ehci_irq() and ehci_hrtimer_func() can deadlock on ehci->lock when
+threadirqs option is used. To prevent the deadlock use
+spin_lock_irqsave() in ehci_irq().
+
+This change can be reverted when hrtimer callbacks become threaded.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+---
+ drivers/usb/host/ehci-hcd.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
+index 4711427..0bc6410 100644
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -685,8 +685,15 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
+ struct ehci_hcd *ehci = hcd_to_ehci (hcd);
+ u32 status, masked_status, pcd_status = 0, cmd;
+ int bh;
++ unsigned long flags;
+
+- spin_lock (&ehci->lock);
++ /*
++ * For threadirqs option we use spin_lock_irqsave() variant to prevent
++ * deadlock with ehci hrtimer callback, because hrtimer callbacks run
++ * in interrupt context even when threadirqs is specified. We can go
++ * back to spin_lock() variant when hrtimer callbacks become threaded.
++ */
++ spin_lock_irqsave(&ehci->lock, flags);
+
+ status = ehci_readl(ehci, &ehci->regs->status);
+
+@@ -704,7 +711,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
+
+ /* Shared IRQ? */
+ if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) {
+- spin_unlock(&ehci->lock);
++ spin_unlock_irqrestore(&ehci->lock, flags);
+ return IRQ_NONE;
+ }
+
+@@ -815,7 +822,7 @@ dead:
+
+ if (bh)
+ ehci_work (ehci);
+- spin_unlock (&ehci->lock);
++ spin_unlock_irqrestore(&ehci->lock, flags);
+ if (pcd_status)
+ usb_hcd_poll_rh_status(hcd);
+ return IRQ_HANDLED;
+--
+1.7.11.7
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-usb" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file