[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75b9c711-54af-8d21-f7aa-dc4662ed2234@denx.de>
Date: Tue, 5 Jan 2021 18:53:48 +0100
From: Marek Vasut <marex@...x.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support
On 1/5/21 6:38 PM, Andrew Lunn wrote:
>> +static void smsc_link_change_notify(struct phy_device *phydev)
>> +{
>> + struct smsc_phy_priv *priv = phydev->priv;
>> +
>> + if (!priv->vddio)
>> + return;
>> +
>> + if (phydev->state == PHY_HALTED)
>> + regulator_disable(priv->vddio);
>> +
>> + if (phydev->state == PHY_NOLINK)
>> + regulator_enable(priv->vddio);
>
> NOLINK is an interesting choice. Could you explain that please.
It's the first state after interface is up.
> I fear this is not going to be very robust to state machine
> changes. And since it is hidden away in a driver, it is going to be
> forgotten about. You might want to think about making it more robust.
I marked the patch as RFC because I would like input on how to implement
this properly. Note that since the regulator supplies the magnetics,
which might be shared between multiple ports with different PHYs, I
don't think this code should even be in the PHY driver, but somewhere
else -- but I don't know where.
Powered by blists - more mailing lists