Re: [PATCH] usb: hcd: allow wakeups while suspended for Moorestown

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

 



On Fri, 8 Apr 2011, Alan Stern wrote:

> On Thu, 7 Apr 2011, Greg KH wrote:
> 
> > Here's Thomas's first cut at doing this, totally untested and written
> > during a legal track at the LF Collab summit.
> > 
> > Kristen, can you take this and test and see if it works for you?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > 
> > Subject: usb.patch
> > From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > Date: Thu, 07 Apr 2011 23:35:16 +0200
> > 
> > Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > ---
> >  drivers/usb/core/hcd.c      |   42 ++++++++++++++++++++----------------------
> >  drivers/usb/host/ehci-hcd.c |   33 +++++++++++++++++++++++++++------
> >  drivers/usb/host/ehci-pci.c |    1 +
> >  include/linux/usb/hcd.h     |    1 +
> >  4 files changed, 49 insertions(+), 28 deletions(-)
> 
> This isn't correct, for a couple of reasons.  The most important reason 
> shows up here:
> 
> > Index: linux-2.6/drivers/usb/host/ehci-hcd.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/usb/host/ehci-hcd.c
> > +++ linux-2.6/drivers/usb/host/ehci-hcd.c
> > @@ -764,10 +764,35 @@ static int ehci_run (struct usb_hcd *hcd
> >  static irqreturn_t ehci_irq (struct usb_hcd *hcd)
> >  {
> >  	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
> > +	u32			status;
> > +
> > +	spin_lock(&ehci->lock);
> > +
> > +	status = ehci_readl(ehci, &ehci->regs->status);
> > +	if (status & INTR_MASK)
> > +		ehci_writel(ehci, 0, &ehci->regs->intr_enable);
> > +
> > +	spin_unlock(&ehci->lock);
> > +
> > +	return status & INTR_MASK ? IRQ_WAKE_THREAD : IRQ_NONE;
> > +}
> 
> The status information gets thrown away.  It has to be saved for later 
> use.

Whoops, I spoke too soon.  The information doesn't get thrown away.  
Forget I mentioned it.

On the other hand, the interrupts need to be re-enabled somewhere.  I 
didn't notice that anywhere in the patch.

Also, the patch assumes that ehci_threaded_irq will be called only in 
response to interrupt events.  That isn't (or at least, it isn't 
supposed to be) true.  There are places where usb_hcd_irq() is invoked 
directly from other code.

Alan Stern

--
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