mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: Paolo Abeni <pabeni@redhat.com>,
	Woojung Huh <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Russell King <linux@armlinux.org.uk>
Cc: "Pascal Eberhard" <pascal.eberhard@se.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Tristram Ha" <tristram.ha@microchip.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 7/9] net: dsa: microchip: implement port_hsr_join for KSZ9477 only
Date: Tue, 2 Jun 2026 16:06:02 +0200	[thread overview]
Message-ID: <20276935-8e9d-4c6b-a4e4-d73b6bcef6a0@bootlin.com> (raw)
In-Reply-To: <0a79ac7d-2a57-4679-bd35-92fea2575b19@bootlin.com>

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:
>> On 5/26/26 11:47 AM, Bastien Curutchet (Schneider Electric) wrote:
>>> @@ -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

  reply	other threads:[~2026-06-02 14:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  9:47 [PATCH net-next 0/9] net: dsa: microchip: remove unnecessary dsa_switch_ops callbacks Bastien Curutchet (Schneider Electric)
2026-05-26  9:47 ` [PATCH net-next 1/9] net: dsa: microchip: remove useless common cls_flower_{add/del} operations Bastien Curutchet (Schneider Electric)
2026-05-26  9:47 ` [PATCH net-next 2/9] net: dsa: microchip: remove VLAN operations for ksz8463 Bastien Curutchet
2026-05-26  9:47 ` [PATCH net-next 3/9] net: dsa: microchip: implement get_phy_flags only if needed Bastien Curutchet (Schneider Electric)
2026-05-26  9:47 ` [PATCH net-next 4/9] net: dsa: microchip: remove setup_rgmii_delay() KSZ operation Bastien Curutchet (Schneider Electric)
2026-06-01  8:49   ` Paolo Abeni
2026-06-02 12:15     ` Bastien Curutchet
2026-05-26  9:47 ` [PATCH net-next 5/9] net: dsa: microchip: implement .support_eee() only if needed Bastien Curutchet (Schneider Electric)
2026-06-01  8:55   ` Paolo Abeni
2026-06-02 12:21     ` Bastien Curutchet
2026-05-26  9:47 ` [PATCH net-next 6/9] net: dsa: microchip: implement .{get/set}_wol " Bastien Curutchet (Schneider Electric)
2026-06-01  8:59   ` Paolo Abeni
2026-06-02 12:34     ` Bastien Curutchet
2026-05-26  9:47 ` [PATCH net-next 7/9] net: dsa: microchip: implement port_hsr_join for KSZ9477 only Bastien Curutchet (Schneider Electric)
2026-06-01  9:03   ` Paolo Abeni
2026-06-02 12:35     ` Bastien Curutchet
2026-06-02 14:06       ` Bastien Curutchet [this message]
2026-05-26  9:47 ` [PATCH net-next 8/9] net: dsa: microchip: implement lan937x-specific MDIO registration Bastien Curutchet (Schneider Electric)
2026-05-26  9:47 ` [PATCH net-next 9/9] net: dsa: microchip: implement port_teardown only if needed Bastien Curutchet (Schneider Electric)

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=20276935-8e9d-4c6b-a4e4-d73b6bcef6a0@bootlin.com \
    --to=bastien.curutchet@bootlin.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=pascal.eberhard@se.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tristram.ha@microchip.com \
    --cc=woojung.huh@microchip.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

Powered by JetHome