[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQ3mAhaZQa8_99Ah@shell.armlinux.org.uk>
Date: Fri, 7 Nov 2025 12:28:50 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Vladimir Oltean <vladimir.oltean@....com>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Biju Das <biju.das.jz@...renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH net-next] net: phy: mscc: Add support for PHY LEDs on
VSC8541
On Fri, Nov 07, 2025 at 10:34:32AM +0000, Lad, Prabhakar wrote:
> On Thu, Nov 6, 2025 at 8:45 PM Andrew Lunn <andrew@...n.ch> wrote:
> > > +static int vsc85xx_led_cntl_set_lock_unlock(struct phy_device *phydev,
> > > + u8 led_num,
> > > + u8 mode, bool lock)
> > > {
> > > int rc;
> > > u16 reg_val;
> > >
> > > - mutex_lock(&phydev->lock);
> > > + if (lock)
> > > + mutex_lock(&phydev->lock);
> > > reg_val = phy_read(phydev, MSCC_PHY_LED_MODE_SEL);
> > > reg_val &= ~LED_MODE_SEL_MASK(led_num);
> > > reg_val |= LED_MODE_SEL(led_num, (u16)mode);
> > > rc = phy_write(phydev, MSCC_PHY_LED_MODE_SEL, reg_val);
> > > - mutex_unlock(&phydev->lock);
> > > + if (lock)
> > > + mutex_unlock(&phydev->lock);
If you used the provided helpers rather than open-coding a read-modify-
write, then you wouldn't even need this lock. Please use phy_modify().
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists