OSDN Git Service

USB: ehci: drop workaround for forced irq threading
authorJohan Hovold <johan@kernel.org>
Mon, 22 Mar 2021 11:12:49 +0000 (12:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 11:37:46 +0000 (12:37 +0100)
Force-threaded interrupt handlers used to run with interrupts enabled,
something which could lead to deadlocks in case a threaded handler
shared a lock with code running in hard interrupt context (e.g. timer
callbacks) and did not explicitly disable interrupts.

Since commit 81e2073c175b ("genirq: Disable interrupts for force
threaded handlers") interrupt handlers always run with interrupts
disabled on non-RT so that drivers no longer need to do handle forced
threading ("threadirqs").

Drop the now obsolete workaround added by commit a1227f3c1030 ("usb:
ehci: fix deadlock when threadirqs option is used").

Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322111249.32141-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-hcd.c

index 2237d22..94b5e64 100644 (file)
@@ -705,15 +705,8 @@ 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;
 
-       /*
-        * 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);
+       spin_lock(&ehci->lock);
 
        status = ehci_readl(ehci, &ehci->regs->status);
 
@@ -731,7 +724,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
 
        /* Shared IRQ? */
        if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) {
-               spin_unlock_irqrestore(&ehci->lock, flags);
+               spin_unlock(&ehci->lock);
                return IRQ_NONE;
        }
 
@@ -842,7 +835,7 @@ dead:
 
        if (bh)
                ehci_work (ehci);
-       spin_unlock_irqrestore(&ehci->lock, flags);
+       spin_unlock(&ehci->lock);
        if (pcd_status)
                usb_hcd_poll_rh_status(hcd);
        return IRQ_HANDLED;