On 10/23/2017 12:48 AM, Florian Fainelli wrote
On 10/22/2017 03:30 PM, Richard Leitner wrote:
On 10/22/2017 08:31 PM, Florian Fainelli wrote:
On 10/22/2017 06:11 AM, Richard Leitner wrote:
But back to this patch: Is it OK the way it fixes the issue?
Fugang and Andrew probably know this hardware a lot better, I would have
to look at the code path a bit more to understand if an alternative
solution is possible. It sounds like your patch could create a power
consumption regression, so maybe add a check for the PHY ID that is
problematic by doing something like:
if (priv->phydev->drv && priv->phydev->drv->phy_id == XXXX_XXXX) where
XXXX_XXXX is the LAN870 PHY ID (obtained from MII register 2 & 3).
I already had a patch which does this check and triggers a reset of the PHY after the refclk was enabled (in fec_enet_clk_enable) in case the phy_id matches. This would IMHO avoid all power consumption regressions... It was something like:
switch (priv->phydev->drv->phy_id) {
case XXXX:
case XXXX:
ret = fec_reset_phy(ndev);
if (ret)
goto failed_reset;
if (ndev->phydev) {
ret = phy_init_hw(ndev->phydev);
if (ret)
goto failed_reset;
}
}