Thread (19 messages) 19 messages, 2 authors, 2026-06-02

Re: [PATCH net-next 7/9] net: dsa: microchip: implement port_hsr_join for KSZ9477 only

From: Bastien Curutchet <hidden>
Date: 2026-06-02 14:06:11
Also in: lkml

Hi again Paolo,

On 6/2/26 2:35 PM, Bastien Curutchet wrote:
Hi Paolo,

On 6/1/26 11:03 AM, Paolo Abeni wrote:
quoted
On 5/26/26 11:47 AM, Bastien Curutchet (Schneider Electric) wrote:
quoted
@@ -1744,12 +1784,20 @@ void ksz9477_hsr_join(struct dsa_switch *ds, 
int port, struct net_device *hsr)
      /* Setup HW supported features for lan HSR ports */
      user = dsa_to_port(ds, port)->user;
      user->features |= KSZ9477_SUPPORTED_HSR_FEATURES;
+
+    dev->hsr_dev = hsr;
+    dev->hsr_ports |= BIT(port);
+
+    return 0;
  }
-void ksz9477_hsr_leave(struct dsa_switch *ds, int port, struct 
net_device *hsr)
+static int ksz9477_hsr_leave(struct dsa_switch *ds, int port,
+                 struct net_device *hsr)
  {
      struct ksz_device *dev = ds->priv;
+    WARN_ON(dev->chip_id != KSZ9477_CHIP_ID);
Since the new op is used only by the relevant switch version, I think
you could/should remove the above warning.
Ack, will do.
I'm having second thoughts now that I'm about to do it.

This HSR feature is only supported by the KSZ9477 itself, not by all the 
switches using ksz9477_switch_ops. A check is done against the 
KSZ9477_CHIP_ID in ksz9477_hsr_join(). This WARN_ON is kind of symmetric 
with the ksz9477_hsr_join()'s check so, IMHO, it makes sense to keep it.



Best regards,
Bastien
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help