[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8tswHeQfhPweDf=EeJ-pt=tzSHkevvOLdRuvkzyotnnhw@mail.gmail.com>
Date: Fri, 7 Nov 2025 12:53:04 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
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
Hi Russell,
Thank you for the review.
On Fri, Nov 7, 2025 at 12:28 PM Russell King (Oracle)
<linux@...linux.org.uk> wrote:
>
> 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().
>
Ok, I will drop this implementation and also drop the locks from
vsc85xx_led_cntl_set() and switch to phy_modify.
Cheers,
Prabhakar
Powered by blists - more mailing lists