Skip to contentSkip to conversation

net: dsa: realtek: Fix LED group port bit for non-zero LED group

PATCH Applied Marek Behún 3 participants 3 messages Mar 11 – Mar 12

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: realtek: Fix LED group port bit for non-zero LED group

The rtl8366rb_led_group_port_mask() function always returns LED port bit in LED group 0; the switch statement returns the same thing in all non-default cases.

This means that the driver does not currently support configuring LEDs in non-zero LED groups.

Fix this.

Fixes 32d617005475a71e ("net: dsa: realtek: add LED drivers for rtl8366rb")

---
I was just looking at the driver code ouf of curiosity and saw this.

I don't have corresponing hardware nor documentation.

But it seems to be a copy-paste mistake from early driver development that was not fixed later, maybe because the original developer had only a board with port LEDs in LED group 0...

---
 drivers/net/dsa/realtek/rtl8366rb-leds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/dsa/realtek/rtl8366rb-leds.c +3 -3
index 99c890681ae6..509ffd3f8db5 100644
@@ -12,11 +12,11 @@ static inline u32 rtl8366rb_led_group_port_mask(u8 led_group, u8 port)
 	case 0:
 		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
 	case 1:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_X_1_CTRL_MASK, BIT(port));
 	case 2:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_2_X_CTRL_MASK, BIT(port));
 	case 3:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_X_3_CTRL_MASK, BIT(port));
 	default:
 		return 0;
 	}
Signature · 1 line
2.52.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Marek Behún

The rtl8366rb_led_group_port_mask() function always returns LED port bit in LED group 0; the switch statement returns the same thing in all non-default cases.

This means that the driver does not currently support configuring LEDs in non-zero LED groups.

Fix this.

Fixes 32d617005475a71e ("net: dsa: realtek: add LED drivers for rtl8366rb")
Quoted 8 lines

---
I was just looking at the driver code ouf of curiosity and saw this.

I don't have corresponing hardware nor documentation.

But it seems to be a copy-paste mistake from early driver development that was not fixed later, maybe because the original developer had only a board with port LEDs in LED group 0...

Patch looks sensible.

Andrew

#2 lore raw
In reply to Marek Behún
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 11 Mar 2026 12:12:37 +0100 you wrote:

The rtl8366rb_led_group_port_mask() function always returns LED port bit in LED group 0; the switch statement returns the same thing in all non-default cases.

This means that the driver does not currently support configuring LEDs in non-zero LED groups.

[...]

Here is the summary with links:
- [net] net: dsa: realtek: Fix LED group port bit for non-zero LED group

    https://git.kernel.org/netdev/net/c/e8f0dc024ce5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html