]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: rockchip-pcie: Enable all four lanes if required
authorValmantas Paliksa <walmis@gmail.com>
Mon, 30 Jun 2025 22:25:14 +0000 (19:25 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:22 +0000 (18:41 +0200)
[ Upstream commit c3fe7071e196e25789ecf90dbc9e8491a98884d7 ]

Current code enables only Lane 0 because pwr_cnt will be incremented on
first call to the function. Let's reorder the enablement code to enable
all 4 lanes through GRF.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Valmantas Paliksa <walmis@gmail.com>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/16b610aab34e069fd31d9f57260c10df2a968f80.1751322015.git.geraldogabriel@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/rockchip/phy-rockchip-pcie.c

index 63e88abc66c6ad2d496eac7d3466a5cd0ade0e45..4e2dfd01adf2ff09da5129579171e6ac44ca89e5 100644 (file)
@@ -159,6 +159,12 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
 
        guard(mutex)(&rk_phy->pcie_mutex);
 
+       regmap_write(rk_phy->reg_base,
+                    rk_phy->phy_data->pcie_laneoff,
+                    HIWORD_UPDATE(!PHY_LANE_IDLE_OFF,
+                                  PHY_LANE_IDLE_MASK,
+                                  PHY_LANE_IDLE_A_SHIFT + inst->index));
+
        if (rk_phy->pwr_cnt++) {
                return 0;
        }
@@ -175,12 +181,6 @@ static int rockchip_pcie_phy_power_on(struct phy *phy)
                                   PHY_CFG_ADDR_MASK,
                                   PHY_CFG_ADDR_SHIFT));
 
-       regmap_write(rk_phy->reg_base,
-                    rk_phy->phy_data->pcie_laneoff,
-                    HIWORD_UPDATE(!PHY_LANE_IDLE_OFF,
-                                  PHY_LANE_IDLE_MASK,
-                                  PHY_LANE_IDLE_A_SHIFT + inst->index));
-
        /*
         * No documented timeout value for phy operation below,
         * so we make it large enough here. And we use loop-break