Re: [PATCH v2] net: phy: marvell: Honor phy LED set by system firmware on a Dell hardware

From: Andrew Lunn
Date: Fri Jan 21 2022 - 08:10:42 EST


> > > -static void marvell_config_led(struct phy_device *phydev)
> > > +static int marvell_find_led_config(struct phy_device *phydev)
> > > {
> > > - u16 def_config;
> > > - int err;
> > > + int def_config;
> > > +
> > > + if (phydev->dev_flags & PHY_USE_FIRMWARE_LED) {
> > > + def_config = phy_read_paged(phydev, MII_MARVELL_LED_PAGE, MII_PHY_LED_CTRL);
> > > + return def_config < 0 ? -1 : def_config;
> >
> > What about the other two registers which configure the LEDs?
>
> Do you mean the other two LEDs? They are not used on this machine.

Have you read the datasheet for the PHY? It has three registers for
configuring the LEDs. There is one register which controls the blink
mode, a register which controls polarity, and a third register which
controls how long each blink lasts, and interrupts. If you are going
to save the configuration over suspend/resume you probably need to
save all three.

This last register is also important for WoL, which is why i asked
about it.

Andrew