From: Lorenzo Bianconi <lorenzo@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v8 09/10] net: airoha: Introduce WAN device flag
Date: Wed, 20 May 2026 14:46:36 +0200 [thread overview]
Message-ID: <ag2tLKJfVLV82o7t@lore-desk> (raw)
In-Reply-To: <20260520085933.C009F1F00893@smtp.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2460 bytes --]
[...]
>
> [ ... ]
> > +static int airoha_dev_init(struct net_device *netdev)
> > +{
> > + struct airoha_gdm_dev *dev = netdev_priv(netdev);
> > + struct airoha_gdm_port *port = dev->port;
> >
> > switch (port->id) {
> > case AIROHA_GDM3_IDX:
> > + case AIROHA_GDM4_IDX: {
> > + struct airoha_eth *eth = dev->eth;
> >
> > + /* GDM2 supports a single net_device */
> > + if (eth->ports[1] && eth->ports[1]->devs[0])
> > + break;
>
> Is there a strict probe-order dependency for these interfaces?
>
> If GDM3 or GDM4 is probed before GDM2, eth->ports[1]->devs[0] will be NULL.
> This leads GDM3/GDM4 to assume GDM2 is inactive, take the WAN role, and force
> GDM2 into loopback mode.
>
> Later, when GDM2 initializes:
>
> > + case AIROHA_GDM2_IDX:
> > + /* GDM2 is always used as wan */
> > + dev->flags |= AIROHA_PRIV_F_WAN;
> > break;
>
> It unconditionally assigns itself the WAN role.
>
> Does this probe ordering create multiple WAN devices and leave GDM2's
> hardware silently misconfigured since its routing capabilities were disabled
> by GDM3's loopback configuration?
This is not a real issue since GDM2 is always registered before GDM3/GDM4.
>
> > default:
> > break;
> > }
> >
> > + airoha_dev_set_qdma(dev);
> > + airoha_set_macaddr(dev, netdev->dev_addr);
>
> When setting the MAC address, airoha_set_macaddr() does the following:
>
> static void airoha_set_macaddr(struct airoha_gdm_dev *dev, const u8 *addr)
> {
> ...
> reg = airoha_is_lan_gdm_dev(dev) ? REG_FE_LAN_MAC_H : REG_FE_WAN_MAC_H;
> ...
> airoha_fe_wr(eth, reg, val);
> }
>
> Since REG_FE_LAN_MAC_H is a global forwarding engine register rather than
> per-port, will initializing subsequent LAN devices overwrite the hardware
> MAC filter configured by the first LAN device?
>
> Might this cause the hardware to drop packets for LAN interfaces that do not
> match the single overwritten MAC address?
>
> (Note: This was observed to be fixed later in the series by commit "net:
> airoha: Support multiple LAN/WAN interfaces for hw MAC address configuration",
> but is mentioned here as it appears to introduce a regression in this commit.)
As pointed out here, this is resolved in a subsequent patch in the series.
Regards,
Lorenzo
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260519-airoha-eth-multi-serdes-v8-0-6bd70e329df6@kernel.org?part=9
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-05-20 12:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 8:57 [PATCH net-next v8 00/10] net: airoha: Support multiple net_devices connected to the same GDM port Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 01/10] dt-bindings: net: airoha: Add GDM port ethernet child node Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 02/10] net: airoha: Introduce airoha_gdm_dev struct Lorenzo Bianconi
2026-05-20 8:59 ` sashiko-bot
2026-05-20 12:25 ` Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 03/10] net: airoha: Move airoha_qdma pointer in " Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 04/10] net: airoha: Rely on airoha_gdm_dev pointer in airoha_is_lan_gdm_port() Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 05/10] net: airoha: Move qos_sq_bmap in airoha_gdm_dev struct Lorenzo Bianconi
2026-05-20 8:59 ` sashiko-bot
2026-05-20 12:24 ` Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 06/10] net: airoha: Move {cpu,fwd}_tx_packets " Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 07/10] net: airoha: Support multiple net_devices for a single FE GDM port Lorenzo Bianconi
2026-05-20 8:59 ` sashiko-bot
2026-05-20 12:28 ` Lorenzo Bianconi
2026-05-20 12:33 ` Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 08/10] net: airoha: Do not stop GDM port if it is shared Lorenzo Bianconi
2026-05-19 8:57 ` [PATCH net-next v8 09/10] net: airoha: Introduce WAN device flag Lorenzo Bianconi
2026-05-20 8:59 ` sashiko-bot
2026-05-20 12:46 ` Lorenzo Bianconi [this message]
2026-05-19 8:57 ` [PATCH net-next v8 10/10] net: airoha: Support multiple LAN/WAN interfaces for hw MAC address configuration Lorenzo Bianconi
2026-05-20 8:59 ` sashiko-bot
2026-05-20 12:49 ` Lorenzo Bianconi
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=ag2tLKJfVLV82o7t@lore-desk \
--to=lorenzo@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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