Netdev List
 help / color / mirror / Atom feed
From: Aleksander Jan Bajkowski <olek2@wp.pl>
To: Andrew Lunn <andrew@lunn.ch>
Cc: skyline@mail.ru, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs polarity modes
Date: Tue, 24 Nov 2026 21:08:13 +0100	[thread overview]
Message-ID: <4dd66fbe-4528-4e88-91d4-87e147aa71cd@wp.pl> (raw)
In-Reply-To: <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch>

Hi Andrew

On 22/11/2026 22:55, Andrew Lunn wrote:
> On Sun, Nov 22, 2026 at 10:28:55PM +0100, Aleksander Jan Bajkowski wrote:
>> Keep the LED polarization settings and restore them after a hardware
>> reset. This modification is actually only necessary on devices with a
>> wired PHY reset line and a driver that resets the PHY during the
>> link-up/link-down events. I found a single DTS file in OpenWRT
>> (armada-385-fortinet-fg-5xe.dtsi) that matches this hardware configuration.
> Mainline does not really care about OpenWRT. However, why does
> armada-385-fortinet-fg-5xe.dtsi do this? Is it because of an errata in
> the PHY? Such an errata we might care about.

This is not an errata. This is a direct response to sashiko's report[1]:

Take a board with a PHY reset GPIO and a MAC driver that connects the PHY
in ndo_open and disconnects it in ndo_stop. Wouldn't each "ip link set
down" followed by "ip link set up" put the LED pins back to their reset
default polarity and drive state?

This is actually a widespread  issue. PHYs from various vendors restore the
default state of the registers after a hardware reset. Phylink does not
restore triggers later.

1. 
https://sashiko.dev/#/message/179032601295.2160803.13373677668767022640%40kernel.org 

>
>>   static int marvell_config_init(struct phy_device *phydev)
>>   {
>> +	struct marvell_priv *priv = phydev->priv;
>> +	int err;
>> +
>>   	/* Set default LED */
>>   	marvell_config_led(phydev);
>>   
>> +	/* Restore the LED polarity settings after a reset. */
>> +	if (priv->led_polarity_mask) {
>> +		err = phy_modify_paged(phydev, MII_MARVELL_LED_PAGE,
>> +				       MII_88E1318S_PHY_LED_POL,
>> +				       priv->led_polarity_mask,
>> +				       priv->led_polarity_val);
> This does not make much sense to me. If you have lost polarity, you
> have also likely lost the LED blinks modes. So you are only restoring
> part of the state?
>
> And this is for a device which does not even exist in mainline.
>
> I suggest KISS, throw this out.

That makes sense. I'll throw it out in the next iteration. We may
return to this topic once someone adds an dts upstream that requires
such a modification.

Best regards,
Aleksander


      reply	other threads:[~2026-11-24 20:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 21:28 [PATCH net-next v3] net: phy: marvell: add support for PHY LEDs polarity modes Aleksander Jan Bajkowski
2026-11-22 21:55 ` Andrew Lunn
2026-11-24 20:08   ` Aleksander Jan Bajkowski [this message]

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=4dd66fbe-4528-4e88-91d4-87e147aa71cd@wp.pl \
    --to=olek2@wp.pl \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skyline@mail.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox