net: stmmac: Fix for LPM issue with boot kpi configuration

With Early Ethernet enabled Link is not up after S2R.
reset the PHY at S2R to fix the Link issue.

Change-Id: I8549d4af7c4dcdc84abcf8deb136028925db5dae
Signed-off-by: Uppalamarthi Sowmya <quic_usowmya@quicinc.com>
This commit is contained in:
Uppalamarthi Sowmya 2024-07-04 12:09:10 +05:30 committed by Suraj Jaiswal
parent b0e9354523
commit 4d90e82bad
3 changed files with 7 additions and 1 deletions

View File

@ -2468,6 +2468,7 @@ static int qcom_ethqos_resume(struct device *dev)
struct net_device *ndev = NULL;
struct qcom_ethqos *ethqos;
int ret;
struct stmmac_priv *priv;
ETHQOSDBG("Resume Enter\n");
if (of_device_is_compatible(dev->of_node, "qcom,emac-smmu-embedded"))
@ -2490,11 +2491,15 @@ static int qcom_ethqos_resume(struct device *dev)
ETHQOSERR(" Resume not possible\n");
return -EINVAL;
}
priv = netdev_priv(ndev);
qcom_ethqos_phy_resume_clks(ethqos);
if (ethqos->gdsc_off_on_suspend)
ethqos_set_func_clk_en(ethqos);
if (priv->plat->early_eth)
priv->plat->need_reset = 1;
ret = stmmac_resume(dev);
ETHQOSDBG("<--Resume Exit\n");

View File

@ -352,7 +352,7 @@ int stmmac_mdio_reset(struct mii_bus *bus)
unsigned int mii_address = priv->hw->mii.addr;
bool active_high = false;
if (priv->plat->early_eth)
if (priv->plat->early_eth && !priv->plat->need_reset)
return 0;
#ifdef CONFIG_OF

View File

@ -304,5 +304,6 @@ struct plat_stmmacenet_data {
void (*phy_irq_enable)(void *priv);
void (*phy_irq_disable)(void *priv);
bool early_eth;
bool need_reset;
};
#endif