All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support
Date: Tue, 5 Jan 2021 18:53:48 +0100	[thread overview]
Message-ID: <75b9c711-54af-8d21-f7aa-dc4662ed2234@denx.de> (raw)
In-Reply-To: <X/SkAOV6s9vbSYh1@lunn.ch>

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.

  reply	other threads:[~2021-01-05 17:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 16:15 [PATCH] [RFC] net: phy: smsc: Add magnetics VIO regulator support Marek Vasut
2021-01-05 17:38 ` Andrew Lunn
2021-01-05 17:53   ` Marek Vasut [this message]
2021-01-05 19:03     ` Andrew Lunn
2021-01-05 21:38       ` Marek Vasut
2021-01-05 19:40 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75b9c711-54af-8d21-f7aa-dc4662ed2234@denx.de \
    --to=marex@denx.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.