]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2025 10:11:16 +0000 (11:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2025 10:11:16 +0000 (11:11 +0100)
added patches:
phy-usb-fix-clock-imbalance-for-suspend-resume.patch
phy-usb-use-slow-clock-for-wake-enabled-suspend.patch

queue-5.10/phy-usb-fix-clock-imbalance-for-suspend-resume.patch [new file with mode: 0644]
queue-5.10/phy-usb-use-slow-clock-for-wake-enabled-suspend.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/phy-usb-fix-clock-imbalance-for-suspend-resume.patch b/queue-5.10/phy-usb-fix-clock-imbalance-for-suspend-resume.patch
new file mode 100644 (file)
index 0000000..42a0141
--- /dev/null
@@ -0,0 +1,76 @@
+From 8484199c09347bdd5d81ee8a2bc530850f900797 Mon Sep 17 00:00:00 2001
+From: Justin Chen <justinpopo6@gmail.com>
+Date: Wed, 5 Oct 2022 14:30:18 -0700
+Subject: phy: usb: Fix clock imbalance for suspend/resume
+
+From: Justin Chen <justinpopo6@gmail.com>
+
+commit 8484199c09347bdd5d81ee8a2bc530850f900797 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: ae532b2b7aa5 ("phy: usb: Add "wake on" functionality for newer Synopsis XHCI controllers")
+Fixes: b0c0b66c0b43 ("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>
+---
+ drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c |    2 --
+ drivers/phy/broadcom/phy-brcm-usb-init.h          |    1 -
+ drivers/phy/broadcom/phy-brcm-usb.c               |    8 +++++---
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
++++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
+@@ -430,7 +430,6 @@ void brcm_usb_dvr_init_7216(struct brcm_
+       params->family_name = "7216";
+       params->ops = &bcm7216_ops;
+-      params->suspend_with_clocks = true;
+ }
+ void brcm_usb_dvr_init_7211b0(struct brcm_usb_init_params *params)
+@@ -440,5 +439,4 @@ void brcm_usb_dvr_init_7211b0(struct brc
+       params->family_name = "7211";
+       params->ops = &bcm7211b0_ops;
+-      params->suspend_with_clocks = true;
+ }
+--- a/drivers/phy/broadcom/phy-brcm-usb-init.h
++++ b/drivers/phy/broadcom/phy-brcm-usb-init.h
+@@ -61,7 +61,6 @@ struct  brcm_usb_init_params {
+       const struct brcm_usb_init_ops *ops;
+       struct regmap *syscon_piarbctl;
+       bool wake_enabled;
+-      bool suspend_with_clocks;
+ };
+ void brcm_usb_dvr_init_7445(struct brcm_usb_init_params *params);
+--- a/drivers/phy/broadcom/phy-brcm-usb.c
++++ b/drivers/phy/broadcom/phy-brcm-usb.c
+@@ -585,7 +585,7 @@ static int brcm_usb_phy_suspend(struct d
+                * and newer XHCI->2.0-clks/3.0-clks.
+                */
+-              if (!priv->ini.suspend_with_clocks) {
++              if (!priv->ini.wake_enabled) {
+                       if (priv->phys[BRCM_USB_PHY_3_0].inited)
+                               clk_disable_unprepare(priv->usb_30_clk);
+                       if (priv->phys[BRCM_USB_PHY_2_0].inited ||
+@@ -602,8 +602,10 @@ static int brcm_usb_phy_resume(struct de
+ {
+       struct brcm_usb_phy_data *priv = dev_get_drvdata(dev);
+-      clk_prepare_enable(priv->usb_20_clk);
+-      clk_prepare_enable(priv->usb_30_clk);
++      if (!priv->ini.wake_enabled) {
++              clk_prepare_enable(priv->usb_20_clk);
++              clk_prepare_enable(priv->usb_30_clk);
++      }
+       brcm_usb_init_ipp(&priv->ini);
+       /*
diff --git a/queue-5.10/phy-usb-use-slow-clock-for-wake-enabled-suspend.patch b/queue-5.10/phy-usb-use-slow-clock-for-wake-enabled-suspend.patch
new file mode 100644 (file)
index 0000000..5c9511b
--- /dev/null
@@ -0,0 +1,41 @@
+From 700c44b508020a3ea29d297c677f8d4ab14b7e6a Mon Sep 17 00:00:00 2001
+From: Justin Chen <justinpopo6@gmail.com>
+Date: Wed, 5 Oct 2022 14:30:17 -0700
+Subject: phy: usb: Use slow clock for wake enabled suspend
+
+From: Justin Chen <justinpopo6@gmail.com>
+
+commit 700c44b508020a3ea29d297c677f8d4ab14b7e6a upstream.
+
+The logic was incorrect when switching to slow clock. We want the slow
+clock if wake_enabled is set.
+
+Fixes: ae532b2b7aa5 ("phy: usb: Add "wake on" functionality for newer Synopsis XHCI controllers")
+Signed-off-by: Justin Chen <justinpopo6@gmail.com>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/1665005418-15807-6-git-send-email-justinpopo6@gmail.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
++++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
+@@ -337,13 +337,12 @@ static void usb_uninit_common_7216(struc
+       pr_debug("%s\n", __func__);
+-      if (!params->wake_enabled) {
+-              USB_CTRL_SET(ctrl, USB_PM, USB_PWRDN);
+-
++      if (params->wake_enabled) {
+               /* Switch to using slower clock during suspend to save power */
+               USB_CTRL_SET(ctrl, USB_PM, XHC_S2_CLK_SWITCH_EN);
+-      } else {
+               usb_wake_enable_7216(params, true);
++      } else {
++              USB_CTRL_SET(ctrl, USB_PM, USB_PWRDN);
+       }
+ }
index 0c5a804db1b9ce606c44513f425f7e5f4b90c431..81c0cc5913b22102bb1ff230ab63f54cb187fc65 100644 (file)
@@ -13,7 +13,6 @@ tcp-dccp-allow-a-connection-when-sk_max_ack_backlog-.patch
 net_sched-cls_flow-validate-tca_flow_rshift-attribut.patch
 cxgb4-avoid-removal-of-uninserted-tid.patch
 tls-fix-tls_sw_sendmsg-error-handling.patch
-net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch
 netfilter-nf_tables-imbalance-in-flowtable-binding.patch
 netfilter-conntrack-clamp-maximum-hashtable-size-to-.patch
 afs-fix-the-maximum-cell-name-length.patch
@@ -78,3 +77,5 @@ drm-bridge-adv7511-unregister-cec-i2c-device-after-c.patch
 drm-bridge-adv7511-use-dev_err_probe-in-probe-functi.patch
 drm-adv7511-fix-use-after-free-in-adv7533_attach_dsi.patch
 sctp-sysctl-rto_min-max-avoid-using-current-nsproxy.patch
+phy-usb-use-slow-clock-for-wake-enabled-suspend.patch
+phy-usb-fix-clock-imbalance-for-suspend-resume.patch