Skip to content

RFC net: dsa: realtek: fix LED support for rtl8366rb

Luiz Angelo Daros de Luca netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: dsa: realtek: keep default LED state in rtl8366rbdrivers/net/dsa/realtek/rtl8366rb.c+20 -670 replies
2/2net: dsa: realtek: add LED drivers for rtl8366rbdrivers/net/dsa/realtek/rtl8366rb.c+245 -240 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLinus Walleij
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC net-next 0/2] net: dsa: realtek: fix LED support for rtl8366rb

The rtl8366rb switch family has 4 LED groups, with one LED from each group for each of its 6 ports. LEDs in this family can be controlled manually using a bitmap or triggered by hardware. It's important to note that hardware triggers are configured at the LED group level, meaning all LEDs in the same group share the same hardware triggers settings.

The first part of this series involves dropping most of the existing code, as, except for disabling the LEDs, it was not working as expected. If not disabled, the LEDs will retain their default settings after a switch reset, which may be sufficient for many devices.

The second part introduces the LED driver to control the switch LEDs from sysfs or device-tree. This driver still allows the LEDs to retain their default settings, but it will shift to the software-based OS LED triggers if any configuration is changed. Subsequently, the LEDs will operate as normal LEDs until the switch undergoes another reset.

Netdev LED trigger supports offloading to hardware triggers. Unfortunately, this isn't possible with the current LED API for this switch family. When the hardware trigger is enabled, it applies to all LEDs in the LED group while the LED API decides to offload based on only the state of a single LED. To avoid inconsistency between LEDs, offloading would need to check if all LEDs in the group share the same compatible settings and atomically enable offload for all LEDs.

This patch series has a minor conflict with the other realtek refacatoring series at the priv->ds access.

- dsa_switch_for_each_port(dp, priv->ds) {
+ dsa_switch_for_each_port(dp, &priv->ds) {