USB: use IRQF_DISABLED for HCD interrupt handlers
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 6 Dec 2007 19:47:08 +0000 (14:47 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 17 Dec 2007 18:47:15 +0000 (10:47 -0800)
Host controller IRQs are supposed to be serviced with interrupts
disabled.  This patch (as1026) adds an IRQF_DISABLED flag to all the
controller drivers that lack it.  It also replaces the
spin_lock_irqsave() and spin_unlock_irqrestore() calls in uhci_irq()
with simple spin_lock() and spin_unlock().

This fixes Bugzilla #9335.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd-pci.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ohci-ppc-of.c
drivers/usb/host/ohci-ssb.c
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/uhci-hcd.c

index 5cf6d5f9acbdb749340b0f8922f5ec177afbe3f5..3fb9af80cbf4319e133f1434453a38ae538944d2 100644 (file)
@@ -125,7 +125,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
 
        pci_set_master (dev);
 
-       retval = usb_add_hcd (hcd, dev->irq, IRQF_SHARED);
+       retval = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED);
        if (retval != 0)
                goto err4;
        return retval;
index b7b7bfbce527e057c7f509d0260b98609a7eeca5..430821cb95c8f32dae781f26a44290ae9138a7e3 100644 (file)
@@ -122,7 +122,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
        temp = in_le32(hcd->regs + 0x1a8);
        out_le32(hcd->regs + 0x1a8, temp | 0x3);
 
-       retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
+       retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
        if (retval != 0)
                goto err4;
        return retval;
index 0a74269201502e4381ecc609b6f039568d99b537..0c3e6b790b7b8e1372005940389d648affd69392 100644 (file)
@@ -142,7 +142,7 @@ ohci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
 
        ohci_hcd_init(ohci);
 
-       rv = usb_add_hcd(hcd, irq, 0);
+       rv = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (rv == 0)
                return 0;
 
index fe70e72340de4e0735d40f67279a5d4ebcb6ce08..6e9c2d6db88756370c5b2f7d9a1bf9cc5d2beabe 100644 (file)
@@ -160,7 +160,7 @@ static int ssb_ohci_attach(struct ssb_device *dev)
        hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
        if (!hcd->regs)
                goto err_put_hcd;
-       err = usb_add_hcd(hcd, dev->irq, IRQF_SHARED);
+       err = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED);
        if (err)
                goto err_iounmap;
 
index ae8ec4474eb801a1a748d3480cbbcb3fed1ddfd8..0ce2fc5e396b130dba59bca0bd2310658814624a 100644 (file)
@@ -2197,7 +2197,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
        INIT_LIST_HEAD(&r8a66597->child_device);
 
        hcd->rsrc_start = res->start;
-       ret = usb_add_hcd(hcd, irq, 0);
+       ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (ret != 0) {
                err("Failed to add hcd");
                goto clean_up;
index 4db17f75f4f1a51268767ae1bf0b09f8c6461ec9..ec987897b8ededd485ac67a0a877a144cb24b39c 100644 (file)
@@ -378,7 +378,6 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
        unsigned short status;
-       unsigned long flags;
 
        /*
         * Read the interrupt status, and write it back to clear the
@@ -398,7 +397,7 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
                        dev_err(uhci_dev(uhci), "host controller process "
                                        "error, something bad happened!\n");
                if (status & USBSTS_HCH) {
-                       spin_lock_irqsave(&uhci->lock, flags);
+                       spin_lock(&uhci->lock);
                        if (uhci->rh_state >= UHCI_RH_RUNNING) {
                                dev_err(uhci_dev(uhci),
                                        "host controller halted, "
@@ -415,16 +414,16 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
                                 * pending unlinks */
                                mod_timer(&hcd->rh_timer, jiffies);
                        }
-                       spin_unlock_irqrestore(&uhci->lock, flags);
+                       spin_unlock(&uhci->lock);
                }
        }
 
        if (status & USBSTS_RD)
                usb_hcd_poll_rh_status(hcd);
        else {
-               spin_lock_irqsave(&uhci->lock, flags);
+               spin_lock(&uhci->lock);
                uhci_scan_schedule(uhci);
-               spin_unlock_irqrestore(&uhci->lock, flags);
+               spin_unlock(&uhci->lock);
        }
 
        return IRQ_HANDLED;