From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
Biju Das <biju.das.jz@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH net-next] net: phy: mscc: Add support for PHY LEDs on VSC8541
Date: Fri, 7 Nov 2025 12:28:50 +0000 [thread overview]
Message-ID: <aQ3mAhaZQa8_99Ah@shell.armlinux.org.uk> (raw)
In-Reply-To: <CA+V-a8vFEHr+3yR7=JAki3YDe==dAUv3m4PrD-nWhVg8hXgJcQ@mail.gmail.com>
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@lunn.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!
next prev parent reply other threads:[~2025-11-07 12:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 20:03 [PATCH net-next] net: phy: mscc: Add support for PHY LEDs on VSC8541 Prabhakar
2025-11-06 20:45 ` Andrew Lunn
2025-11-07 10:34 ` Lad, Prabhakar
2025-11-07 12:28 ` Russell King (Oracle) [this message]
2025-11-07 12:53 ` Lad, Prabhakar
2025-11-07 13:14 ` Andrew Lunn
2025-11-07 18:55 ` Lad, Prabhakar
2025-11-07 19:01 ` Andrew Lunn
2025-11-07 19:07 ` Lad, Prabhakar
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=aQ3mAhaZQa8_99Ah@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=biju.das.jz@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=hkallweit1@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vladimir.oltean@nxp.com \
/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