usb: xhci: Avoid calling wakeup_enable without set_wakeup_capable

Commit 6076cdc395 ("usb: host: Disable system wakeup if remote
wakeup is not required")has introduced a check in xhci_plat_probe
where if device_may_wakeup is set for the parent device, then
device_wakeup_enable is called on xhci-plat, but calling
device_wakeup_enable without device_set_wakeup_capable is useless.

Now when xhci_plat_suspend is called the xhci_suspend will check
for device_may_wakeup and here the result will be FALSE.
In xhci suspend the do_wakeup is checked, if FALSE then it will
try to call xhci_disable_port_wake_on_bits where it will try
to do a readl operation. This will lead the core to hang since
xhci is already suspended and we tried to do a readl.

Fix this by replacing device_wakeup_enable with device_init_wakeup.
This will set the do_wakeup to be true and therefore avoid calling
xhci_disable_port_wake_on_bits and bail out when checked for
HCD_HW_ACCESSIBLE.

Change-Id: Id3fad841ebe07b777dc229ced36364ad31e6d81d
Signed-off-by: Udipto Goswami <ugoswami@codeaurora.org>
This commit is contained in:
Udipto Goswami 2021-05-11 22:36:13 +05:30
commit d6aab69a01

View file

@ -276,7 +276,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
}
if (device_may_wakeup(sysdev))
device_wakeup_enable(hcd->self.controller);
device_init_wakeup(hcd->self.controller, 1);
xhci->main_hcd = hcd;
xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,