Skip to content

Commit 9f15cd4

Browse files
Ryceancurrygregkh
authored andcommitted
phy: usb: Fix clock imbalance for suspend/resume
commit 8484199 upstream. We should be disabling clocks when wake from USB is not needed. Since this wasn't done, we had a clock imbalance since clocks were always being enabled on resume. Fixes: ae532b2 ("phy: usb: Add "wake on" functionality for newer Synopsis XHCI controllers") Fixes: b0c0b66 ("phy: usb: Add support for wake and USB low power mode for 7211 S2/S5") Signed-off-by: Justin Chen <justinpopo6@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/1665005418-15807-7-git-send-email-justinpopo6@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 795537e commit 9f15cd4

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ void brcm_usb_dvr_init_7216(struct brcm_usb_init_params *params)
430430

431431
params->family_name = "7216";
432432
params->ops = &bcm7216_ops;
433-
params->suspend_with_clocks = true;
434433
}
435434

436435
void brcm_usb_dvr_init_7211b0(struct brcm_usb_init_params *params)
@@ -440,5 +439,4 @@ void brcm_usb_dvr_init_7211b0(struct brcm_usb_init_params *params)
440439

441440
params->family_name = "7211";
442441
params->ops = &bcm7211b0_ops;
443-
params->suspend_with_clocks = true;
444442
}

drivers/phy/broadcom/phy-brcm-usb-init.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct brcm_usb_init_params {
6161
const struct brcm_usb_init_ops *ops;
6262
struct regmap *syscon_piarbctl;
6363
bool wake_enabled;
64-
bool suspend_with_clocks;
6564
};
6665

6766
void brcm_usb_dvr_init_4908(struct brcm_usb_init_params *params);

drivers/phy/broadcom/phy-brcm-usb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static int brcm_usb_phy_suspend(struct device *dev)
598598
* and newer XHCI->2.0-clks/3.0-clks.
599599
*/
600600

601-
if (!priv->ini.suspend_with_clocks) {
601+
if (!priv->ini.wake_enabled) {
602602
if (priv->phys[BRCM_USB_PHY_3_0].inited)
603603
clk_disable_unprepare(priv->usb_30_clk);
604604
if (priv->phys[BRCM_USB_PHY_2_0].inited ||
@@ -615,8 +615,10 @@ static int brcm_usb_phy_resume(struct device *dev)
615615
{
616616
struct brcm_usb_phy_data *priv = dev_get_drvdata(dev);
617617

618-
clk_prepare_enable(priv->usb_20_clk);
619-
clk_prepare_enable(priv->usb_30_clk);
618+
if (!priv->ini.wake_enabled) {
619+
clk_prepare_enable(priv->usb_20_clk);
620+
clk_prepare_enable(priv->usb_30_clk);
621+
}
620622
brcm_usb_init_ipp(&priv->ini);
621623

622624
/*

0 commit comments

Comments
 (0)