net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC
authorAndrey Konovalov <andrey.konovalov@linaro.org>
Thu, 26 Jan 2023 21:35:39 +0000 (00:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Feb 2023 11:59:43 +0000 (12:59 +0100)
[ Upstream commit 54aa39a513dbf2164ca462a19f04519b2407a224 ]

Currently in phy_init_eee() the driver unconditionally configures the PHY
to stop RX_CLK after entering Rx LPI state. This causes an LPI interrupt
storm on my qcs404-base board.

Change the PHY initialization so that for "qcom,qcs404-ethqos" compatible
device RX_CLK continues to run even in Rx LPI state.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
include/linux/stmmac.h

index 835caa15d55fff9d97f6007505c0e5da4109ae9d..732774645c1a680b0365e7df02fbe8bea4a6c695 100644 (file)
@@ -560,6 +560,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
        plat_dat->has_gmac4 = 1;
        plat_dat->pmt = 1;
        plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
+       if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
+               plat_dat->rx_clk_runs_in_lpi = 1;
 
        ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
        if (ret)
index 4bba0444c764a4d6c7e734abaedcff403b583a9d..84e1740b12f1b58242ef4f03fe7c9b4560343c7a 100644 (file)
@@ -1077,7 +1077,8 @@ static void stmmac_mac_link_up(struct phylink_config *config,
 
        stmmac_mac_set(priv, priv->ioaddr, true);
        if (phy && priv->dma_cap.eee) {
-               priv->eee_active = phy_init_eee(phy, 1) >= 0;
+               priv->eee_active =
+                       phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0;
                priv->eee_enabled = stmmac_eee_init(priv);
                priv->tx_lpi_enabled = priv->eee_enabled;
                stmmac_set_eee_pls(priv, priv->hw, true);
index fb2e88614f5d17e77c1b459b7f20b2a0032b5230..313edd19bf5457b79947664fa70c08f82881efe6 100644 (file)
@@ -252,6 +252,7 @@ struct plat_stmmacenet_data {
        int rss_en;
        int mac_port_sel_speed;
        bool en_tx_lpi_clockgating;
+       bool rx_clk_runs_in_lpi;
        int has_xgmac;
        bool vlan_fail_q_en;
        u8 vlan_fail_q;