From: Marek Vasut <marex@denx.de>
To: Sava Jakovljev <sjakovljev@outlook.com>
Cc: savaj@meyersound.com, Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: realtek: Fix setting of PHY LEDs Mode B bit on RTL8211F
Date: Wed, 21 Aug 2024 05:54:48 +0200 [thread overview]
Message-ID: <95f514f6-7445-41ee-a18b-ce558ee15849@denx.de> (raw)
In-Reply-To: <PAWP192MB21287372F30C4E55B6DF6158C38E2@PAWP192MB2128.EURP192.PROD.OUTLOOK.COM>
On 8/21/24 4:16 AM, Sava Jakovljev wrote:
> From: Sava Jakovljev <savaj@meyersound.com>
>
> The current implementation incorrectly sets the mode bit of the PHY chip.
> Bit 15 (RTL8211F_LEDCR_MODE) should not be shifted together with the
> configuration nibble of a LED- it should be set independently of the
> index of the LED being configured.
> As a consequence, the RTL8211F LED control is actually operating in Mode A.
> Fix the error by or-ing final register value to write with a const-value of
> RTL8211F_LEDCR_MODE, thus setting Mode bit explicitly.
>
> Fixes: 17784801d888 ("net: phy: realtek: Add support for PHY LEDs on RTL8211F")
>
> Signed-off-by: Sava Jakovljev <savaj@meyersound.com>
> ---
> drivers/net/phy/realtek.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> index 87865918dab6..25e5bfbb6f89 100644
> --- a/drivers/net/phy/realtek.c
> +++ b/drivers/net/phy/realtek.c
> @@ -555,7 +555,7 @@ static int rtl8211f_led_hw_control_set(struct phy_device *phydev, u8 index,
> unsigned long rules)
> {
> const u16 mask = RTL8211F_LEDCR_MASK << (RTL8211F_LEDCR_SHIFT * index);
> - u16 reg = RTL8211F_LEDCR_MODE; /* Mode B */
> + u16 reg = 0;
>
> if (index >= RTL8211F_LED_COUNT)
> return -EINVAL;
> @@ -575,6 +575,7 @@ static int rtl8211f_led_hw_control_set(struct phy_device *phydev, u8 index,
> }
>
> reg <<= RTL8211F_LEDCR_SHIFT * index;
> + reg |= RTL8211F_LEDCR_MODE; /* Mode B */
Nice find, thanks !
Reviewed-by: Marek Vasut <marex@denx.de>
next prev parent reply other threads:[~2024-08-21 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 2:16 Sava Jakovljev
2024-08-21 3:54 ` Marek Vasut [this message]
2024-08-22 11:02 ` Paolo Abeni
2024-08-22 11:10 ` patchwork-bot+netdevbpf
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=95f514f6-7445-41ee-a18b-ce558ee15849@denx.de \
--to=marex@denx.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=savaj@meyersound.com \
--cc=sjakovljev@outlook.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
all inboxes | Powered by JetHome®