There is threadirqs kenel boot option which allow to force interrupt
routines to be performed as thread. 

USB irq routines use spin_lock(*hci->lock) variant without disabling
interrupts, what is perfectly fine, but that can cause deadlock when
forced thread irqs are used. Deadlock scenario is quite reproducible for
me, as I can not boot system with threadirqs option, when some USB
device is connected. Patch marks USB irq routines with IRQF_NO_THREAD
to prevent forced threading.

Signed-off-by: Stanislaw Gruszka <sgrus...@redhat.com>
---
 drivers/usb/core/hcd-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index d59d993..b4fa1a5 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -264,7 +264,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
                down_write(&companions_rwsem);
                dev_set_drvdata(&dev->dev, hcd);
                for_each_companion(dev, hcd, ehci_pre_add);
-               retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
+               retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED | 
IRQF_NO_THREAD);
                if (retval != 0)
                        dev_set_drvdata(&dev->dev, NULL);
                for_each_companion(dev, hcd, ehci_post_add);
@@ -272,7 +272,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
        } else {
                down_read(&companions_rwsem);
                dev_set_drvdata(&dev->dev, hcd);
-               retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
+               retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED | 
IRQF_NO_THREAD);
                if (retval != 0)
                        dev_set_drvdata(&dev->dev, NULL);
                else
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to