Commit cca1efc9 authored by Alan Stern's avatar Alan Stern Committed by Luis Henriques

USB: add flag for HCDs that can't receive wakeup requests (isp1760-hcd)

commit 074f9dd5 upstream.

Currently the USB stack assumes that all host controller drivers are
capable of receiving wakeup requests from downstream devices.
However, this isn't true for the isp1760-hcd driver, which means that
it isn't safe to do a runtime suspend of any device attached to a
root-hub port if the device requires wakeup.

This patch adds a "cant_recv_wakeups" flag to the usb_hcd structure
and sets the flag in isp1760-hcd.  The core is modified to prevent a
direct child of the root hub from being put into runtime suspend with
wakeup enabled if the flag is set.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Tested-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 27e636e8
...@@ -1800,6 +1800,18 @@ static int autosuspend_check(struct usb_device *udev) ...@@ -1800,6 +1800,18 @@ static int autosuspend_check(struct usb_device *udev)
dev_dbg(&udev->dev, "remote wakeup needed for autosuspend\n"); dev_dbg(&udev->dev, "remote wakeup needed for autosuspend\n");
return -EOPNOTSUPP; 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; udev->do_remote_wakeup = w;
return 0; return 0;
} }
......
...@@ -2247,6 +2247,9 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len, ...@@ -2247,6 +2247,9 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len,
hcd->rsrc_start = res_start; hcd->rsrc_start = res_start;
hcd->rsrc_len = res_len; hcd->rsrc_len = res_len;
/* This driver doesn't support wakeup requests */
hcd->cant_recv_wakeups = 1;
ret = usb_add_hcd(hcd, irq, irqflags); ret = usb_add_hcd(hcd, irq, irqflags);
if (ret) if (ret)
goto err_unmap; goto err_unmap;
......
...@@ -144,6 +144,8 @@ struct usb_hcd { ...@@ -144,6 +144,8 @@ struct usb_hcd {
unsigned has_tt:1; /* Integrated TT in root hub */ unsigned has_tt:1; /* Integrated TT in root hub */
unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */
unsigned can_do_streams:1; /* HC supports streams */ unsigned can_do_streams:1; /* HC supports streams */
unsigned cant_recv_wakeups:1;
/* wakeup requests from downstream aren't received */
unsigned int irq; /* irq allocated */ unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */ void __iomem *regs; /* device memory/io */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment