Skip to content

Commit d56e57c

Browse files
shimodaygregkh
authored andcommitted
usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing"
This patch reverts the commit 835e424 ("usb: host: xhci-plat: enable clk in resume timing") because this driver also has runtime PM and the commit 5608691 ("clk: renesas: cpg-mssr: Restore module clocks during resume") will restore the clock on R-Car H3 environment. If the xhci_plat_suspend() disables the clk, the system cannot enable the clk in resume like the following behavior: < In resume > - genpd_resume_noirq() runs and enable the clk (enable_count = 1) - cpg_mssr_resume_noirq() restores the clk register. -- Since the clk was disabled in suspend, cpg_mssr_resume_noirq() will disable the clk and keep the enable_count. - Even if xhci_plat_resume() calls clk_prepare_enable(), since the enable_count is 1, the clk will be not enabled. After this patch is applied, the cpg-mssr driver will save the clk as enable, so the clk will be enabled in resume. Fixes: 835e424 ("usb: host: xhci-plat: enable clk in resume timing") Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a5f5968 commit d56e57c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
360360
{
361361
struct usb_hcd *hcd = dev_get_drvdata(dev);
362362
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
363-
int ret;
364363

365364
/*
366365
* xhci_suspend() needs `do_wakeup` to know whether host is allowed
@@ -370,12 +369,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
370369
* reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
371370
* also applies to runtime suspend.
372371
*/
373-
ret = xhci_suspend(xhci, device_may_wakeup(dev));
374-
375-
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
376-
clk_disable_unprepare(xhci->clk);
377-
378-
return ret;
372+
return xhci_suspend(xhci, device_may_wakeup(dev));
379373
}
380374

381375
static int __maybe_unused xhci_plat_resume(struct device *dev)
@@ -384,9 +378,6 @@ static int __maybe_unused xhci_plat_resume(struct device *dev)
384378
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
385379
int ret;
386380

387-
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
388-
clk_prepare_enable(xhci->clk);
389-
390381
ret = xhci_priv_resume_quirk(hcd);
391382
if (ret)
392383
return ret;

0 commit comments

Comments
 (0)