Thread (5 messages) flat view 5 messages, 2 authors, 2021-01-05

Re: [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support

From: Marek Vasut <marex@denx.de>
Date: 2021-01-05 17:54:46

On 1/5/21 6:38 PM, Andrew Lunn wrote:
quoted
+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help