From: Andrew Lunn <andrew@lunn.ch>
To: Aleksander Jan Bajkowski <olek2@wp.pl>
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: Sun, 22 Nov 2026 22:55:31 +0100 [thread overview]
Message-ID: <992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch> (raw)
In-Reply-To: <20261122213034.548858-1-olek2@wp.pl>
On Sun, Nov 22, 2026 at 10:28:55PM +0100, Aleksander Jan Bajkowski wrote:
> Add the led_polarity_set callback for setting LED polarity. Implement
> this callback for the 88E1116R, 88E1318 and 88E1510 PHYs. This should
> also work on other Marvell PHYs, but I don't have access to the TRM or
> the hardware.
Marvell have an SDK called DSDT, which covers their PHYs. It is GPL
licensed, but not widely distributed. If you can find a copy, it will
give you all the details for determining which PHYs this will work
for. Just be warned, the code is horrible.
> 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.
> 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.
Andrew
prev parent reply other threads:[~2026-11-22 21:55 UTC|newest]
Thread overview: 2+ 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 [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=992ef2e7-4334-4b0e-b1ea-5ac1360fefea@lunn.ch \
--to=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=olek2@wp.pl \
--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