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

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

This patch reverts the commit 835e4241 ("usb: host: xhci-plat:
enable clk in resume timing") because this driver also has runtime PM
and the commit 56086910 ("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: 835e4241 ("usb: host: xhci-plat: enable clk in resume timing")
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>
上级 a5f59683
...@@ -360,7 +360,6 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) ...@@ -360,7 +360,6 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
int ret;
/* /*
* xhci_suspend() needs `do_wakeup` to know whether host is allowed * 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) ...@@ -370,12 +369,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)
* reconsider this when xhci_plat_suspend enlarges its scope, e.g., * reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
* also applies to runtime suspend. * also applies to runtime suspend.
*/ */
ret = xhci_suspend(xhci, device_may_wakeup(dev)); return 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 __maybe_unused xhci_plat_resume(struct device *dev) static int __maybe_unused xhci_plat_resume(struct device *dev)
...@@ -384,9 +378,6 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) ...@@ -384,9 +378,6 @@ static int __maybe_unused xhci_plat_resume(struct device *dev)
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
int ret; int ret;
if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk))
clk_prepare_enable(xhci->clk);
ret = xhci_priv_resume_quirk(hcd); ret = xhci_priv_resume_quirk(hcd);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册