提交 835e4241 编写于 作者: Y Yoshihiro Shimoda 提交者: Greg Kroah-Hartman

usb: host: xhci-plat: enable clk in resume timing

This patch enables the clk in resume timing when device_may_wakeup()
is false. Otherwise, kernel panic happens when R-Car resumes the system
from Suspend-to-RAM because the clk is disabled.
Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b0c69b4b
......@@ -347,6 +347,7 @@ static int xhci_plat_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
int ret;
/*
* xhci_suspend() needs `do_wakeup` to know whether host is allowed
......@@ -356,7 +357,12 @@ static int xhci_plat_suspend(struct device *dev)
* reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
* also applies to runtime suspend.
*/
return xhci_suspend(xhci, device_may_wakeup(dev));
ret = xhci_suspend(xhci, device_may_wakeup(dev));
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
clk_disable_unprepare(xhci->clk);
return ret;
}
static int xhci_plat_resume(struct device *dev)
......@@ -364,6 +370,9 @@ static int xhci_plat_resume(struct device *dev)
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
clk_prepare_enable(xhci->clk);
return xhci_resume(xhci, 0);
}
#endif /* CONFIG_PM_SLEEP */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册