]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: rockchip: naneng-combphy: Always configure SSC spread direction
authorAlexey Charkov <alchark@flipper.net>
Tue, 14 Jul 2026 15:41:20 +0000 (19:41 +0400)
committerVinod Koul <vkoul@kernel.org>
Mon, 20 Jul 2026 11:10:15 +0000 (16:40 +0530)
Commit 0b31f297557f ("phy: rockchip: naneng-combphy: Consolidate SSC
configuration") moved the SSC spread spectrum direction setup into the
new rk_combphy_common_cfg_ssc() helper. That helper returns early when
the 'rockchip,enable-ssc' property is absent, whereas the equivalent
RK3568_PHYREG32 direction writes previously ran unconditionally in the
per-type switch statements, independent of whether SSC modulation was
actually enabled.

As no in-tree board sets 'rockchip,enable-ssc', this changed the behavior
at least for USB3 on RK3576, which now fails to bring up the link.
USB 2.0 still enumerates, but USB 3.0 does not, and the SuperSpeed root
port floods the log every second with:

  usb usb2-port1: Cannot enable. Maybe the USB cable is bad?

This was observed on two different RK3576 devices with a CoreChips SL6341
USB 2.0/3.0 hub connected to the USB DRD controller running in host mode.

Perform the SSC direction writes for PCIe/USB3 (and SATA) before the
enable_ssc check so that they always run, as they did before the
consolidation.

Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/all/CAKTNdwH_ZMQa-97h+tqdsWqXKtorkFF9wHAMn60-8ZGKuze_Mg@mail.gmail.com/
Fixes: 0b31f297557f ("phy: rockchip: naneng-combphy: Consolidate SSC configuration")
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Tested-by: Liu Changjie <liucj1228@outlook.com>
Link: https://patch.msgid.link/20260714-naneng-ssc-fix-v1-1-1c40a58061ae@flipper.net
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c

index 2b0f152f54709138f70c79ef0a56b39f2f9f18e1..7843356a4dd472bb4c6deb63c32dae0aebc77ad5 100644 (file)
@@ -452,9 +452,6 @@ static void rk_combphy_common_cfg_ssc(struct rockchip_combphy_priv *priv, unsign
        struct device_node *np = priv->dev->of_node;
        u32 val;
 
-       if (!priv->enable_ssc)
-               return;
-
        /* Set SSC downward spread spectrum for PCIe and USB3 */
        if (priv->type == PHY_TYPE_PCIE || priv->type == PHY_TYPE_USB3) {
                val = FIELD_PREP(RK3568_PHYREG32_SSC_MASK, RK3568_PHYREG32_SSC_DOWNWARD);
@@ -471,6 +468,9 @@ static void rk_combphy_common_cfg_ssc(struct rockchip_combphy_priv *priv, unsign
                                         RK3568_PHYREG32);
        }
 
+       if (!priv->enable_ssc)
+               return;
+
        /* Enable SSC */
        val = readl(priv->mmio + RK3568_PHYREG8);
        val |= RK3568_PHYREG8_SSC_EN;