Re: USB storage vanilla kernel 3.13 hang on DELL PRECISION M6400

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 13 Feb 2014, Thomas Gleixner wrote:

> On Thu, 13 Feb 2014, Alan Stern wrote:
> > On Thu, 13 Feb 2014, Thomas Gleixner wrote:
> > I can think of two other solutions.  The first is to move the
> > non-hardirq-safe hrtimers into threaded softirq context, as mentioned
> > above.
> 
> Right, but that's major surgery.
>  
> > The second is for ehci_hrtimer_func to schedule a tasklet instead of
> > doing its work directly.  But this seems like an awkward workaround for 
> > something which shouldn't be a problem in the first place.
> 
> Eeew.
>  
> > Of the three, using spin_lock_irqsave in ehci_irq is the simplest.  If 
> > the hrtimers can't be moved to threaded context, that's what I'll end 
> > up doing.
> 
> I think, that's the simplest option for now. We'll look into the
> hrtimer issue anyway, but as I said it's not a two lines patch.

Thanks for the help, Thomas.

Stefani, please try the patch below, with "threadirq" and the plain
vanilla kernel.  It ought to fix your problem, but let's make certain.

Alan Stern



Index: usb-3.14/drivers/usb/host/ehci-hcd.c
===================================================================
--- usb-3.14.orig/drivers/usb/host/ehci-hcd.c
+++ usb-3.14/drivers/usb/host/ehci-hcd.c
@@ -683,10 +683,11 @@ EXPORT_SYMBOL_GPL(ehci_setup);
 static irqreturn_t ehci_irq (struct usb_hcd *hcd)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	unsigned long		flags;
 	u32			status, masked_status, pcd_status = 0, cmd;
 	int			bh;
 
-	spin_lock (&ehci->lock);
+	spin_lock_irqsave(&ehci->lock, flags);
 
 	status = ehci_readl(ehci, &ehci->regs->status);
 
@@ -704,7 +705,7 @@ static irqreturn_t ehci_irq (struct usb_
 
 	/* 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 +816,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;

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux