On Fri, 23 Jan 2015, Nicolas Pitre wrote:
> On Fri, 23 Jan 2015, Alan Stern wrote:
>
> > On Wed, 21 Jan 2015, Rafael J. Wysocki wrote:
> >
> > > Well, OK, so there is the case when the controller is not suspended, but
> > > it
> > > doesn't generate interrupts for wakeup signals from devices, which
> > > generally
> > > is different from the case when the controller itself is suspended too
> > > that
> > > requires it to be wakeup-capable for things to work.
> > >
> > > An additional flag may still be better then.
> >
> > We can do that if it turns out to be necessary, but let's try something
> > simpler first. Nicolas, does this patch fix the problem?
>
> No, it doesn't.
All right, then how about this?
Alan Stern
Index: usb-3.19/include/linux/usb/hcd.h
===================================================================
--- usb-3.19.orig/include/linux/usb/hcd.h
+++ usb-3.19/include/linux/usb/hcd.h
@@ -146,6 +146,8 @@ struct usb_hcd {
unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */
unsigned can_do_streams:1; /* HC supports streams */
unsigned tpl_support:1; /* OTG & EH TPL support */
+ unsigned cant_recv_wakeups:1;
+ /* wakeup requests from downstream aren't received */
unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */
Index: usb-3.19/drivers/usb/host/isp1760-hcd.c
===================================================================
--- usb-3.19.orig/drivers/usb/host/isp1760-hcd.c
+++ usb-3.19/drivers/usb/host/isp1760-hcd.c
@@ -2247,6 +2247,9 @@ struct usb_hcd *isp1760_register(phys_ad
hcd->rsrc_start = res_start;
hcd->rsrc_len = res_len;
+ /* This driver doesn't support wakeup requests */
+ hcd->cant_recv_wakeups = 1;
+
ret = usb_add_hcd(hcd, irq, irqflags);
if (ret)
goto err_unmap;
Index: usb-3.19/drivers/usb/core/driver.c
===================================================================
--- usb-3.19.orig/drivers/usb/core/driver.c
+++ usb-3.19/drivers/usb/core/driver.c
@@ -1780,6 +1780,18 @@ static int autosuspend_check(struct usb_
dev_dbg(&udev->dev, "remote wakeup needed for autosuspend\n");
return -EOPNOTSUPP;
}
+
+ /*
+ * If the device is a direct child of the root hub and the HCD
+ * doesn't handle wakeup requests, don't allow autosuspend when
+ * wakeup is needed.
+ */
+ if (w && udev->parent == udev->bus->root_hub &&
+ bus_to_hcd(udev->bus)->cant_recv_wakeups) {
+ dev_dbg(&udev->dev, "HCD doesn't handle wakeup requests\n");
+ return -EOPNOTSUPP;
+ }
+
udev->do_remote_wakeup = w;
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html