summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Walleij <linusw@kernel.org>2026-07-31 23:06:06 +0200
committerJakub Kicinski <kuba@kernel.org>2026-08-04 17:00:53 -0700
commit6d356e408670e2c0919e32b2958d1947fdf104f2 (patch)
tree1b69e6a6931efc0a5d38bb1da7f0381ddd6f4263 /drivers
parentc509971352a6e6e6dcedb9222133c0ce0e54c8d2 (diff)
downloadlinux-6d356e408670e2c0919e32b2958d1947fdf104f2.tar.gz
linux-6d356e408670e2c0919e32b2958d1947fdf104f2.zip
net: dsa: realtek: rtl8366rb: Fix up port isolation
Sashiko reports that we incorrectly disable isolation in the setup loop while what we want to do is to enable it. Enable it by unconditionally setting the enable bit 0 in rtl8366rb_port_set_isolation() so a mask of 0 when passed in will enable isolation and isolate from ALL ports. Fix up the comments so it is clear what is going on, including a missing word in the helper function. Reported-by: Paolo Abeni <pabeni@redhat.com> Closes: https://sashiko.dev/#/patchset/20260630-rtl8366rb-improvements-v2-0-05eb9d6a37f5%40kernel.org Signed-off-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260731-rtl8366rb-fixes-v4-1-fbf0c95b829a@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dsa/realtek/rtl8366rb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/dsa/realtek/rtl8366rb.c b/drivers/net/dsa/realtek/rtl8366rb.c
index d2fa8ff6a5d0..f11831b66de8 100644
--- a/drivers/net/dsa/realtek/rtl8366rb.c
+++ b/drivers/net/dsa/realtek/rtl8366rb.c
@@ -794,11 +794,10 @@ static int rtl8366rb_setup_all_leds_off(struct realtek_priv *priv)
static int rtl8366rb_port_set_isolation(struct realtek_priv *priv, int port,
u32 mask)
{
- /* Bit 0 enables isolation so set this if we enable isolation
- * any of the ports an clear it if we disable on all of them.
+ /* Bit 0 enables isolation, the mask indicates allowed forwarding
+ * ports
*/
- if (mask)
- mask = RTL8366RB_PORT_ISO_PORTS(mask) | RTL8366RB_PORT_ISO_EN;
+ mask = RTL8366RB_PORT_ISO_PORTS(mask) | RTL8366RB_PORT_ISO_EN;
return regmap_write(priv->map, RTL8366RB_PORT_ISO(port),
mask);
@@ -974,7 +973,7 @@ static int rtl8366rb_setup(struct dsa_switch *ds)
if (!dsa_port_is_user(dp))
continue;
- /* Forward only to the CPU */
+ /* Forward only to the CPU(s), isolate from all other ports */
ret = rtl8366rb_port_set_isolation(priv, dp->index, upports_mask);
if (ret)
return ret;