From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Simon Horman <horms@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: airoha: Fix GDM2 loopback configuration for USB serdes
Date: Wed, 4 Mar 2026 09:29:05 +0100 [thread overview]
Message-ID: <aaftUXaSD0u5ZhO7@lore-desk> (raw)
In-Reply-To: <20260303141624.GD71509@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2704 bytes --]
> On Sat, Feb 28, 2026 at 01:20:33PM +0100, Lorenzo Bianconi wrote:
> > Flow Control source port mapping for USB serdes needs to be configured
> > according to the GDM port nbd parameter. This is a preliminary patch
> > since nbd parameter is specific for the given port serdes and needs to
> > be read from the DTS (in the current codebase is assigned statically).
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Hi Lorenzo,
>
> Is this a fix? If so, should it have a fixes tag? And be targeted at net?
> Otherwise, perhaps drop the "Fix" from the subject.
Hi Simon,
This is a preliminary patch in order to completely fix the loopback
configuration for USB serdes but the point is we are not supporting
USB serdes upstream yet (there is only OpenWrt support available at
the moment). Do you think we should target net-next or net in this
case?
>
> Also, I think it would be worth explaining the situation
> before and after this patch.
>
> > ---
> > drivers/net/ethernet/airoha/airoha_eth.c | 10 ++++++----
> > drivers/net/ethernet/airoha/airoha_regs.h | 5 +----
> > 2 files changed, 7 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> > index 3779f93b47bc13ae21d4ae088dece4712dc214e5..37fc2b33d3af8a190a74efc69ed54f163afa6412 100644
> > --- a/drivers/net/ethernet/airoha/airoha_eth.c
> > +++ b/drivers/net/ethernet/airoha/airoha_eth.c
> > @@ -1729,10 +1729,12 @@ static int airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
> > SP_CPORT_MASK(val),
> > FE_PSE_PORT_CDM2 << __ffs(SP_CPORT_MASK(val)));
> >
> > - if (port->id != AIROHA_GDM3_IDX && airoha_is_7581(eth))
> > - airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6,
> > - FC_ID_OF_SRC_PORT24_MASK,
> > - FIELD_PREP(FC_ID_OF_SRC_PORT24_MASK, 2));
> > + if (port->id == AIROHA_GDM4_IDX && airoha_is_7581(eth)) {
> > + u32 mask = FC_ID_OF_SRC_PORT_MASK(nbq);
>
> AI generated code review flags that the commit message talks about nbd.
> But here we have nbq.
yes, my mistake. It is supposed to be nbq and not nbd.
>
> > +
> > + airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6, mask,
> > + AIROHA_GDM2_IDX << __ffs(mask));
>
> Perhaps naïvely I would have used FIELD_PREP here.
> Maybe that leads to an incorrect result. But if not,
> is a shift used here for consistency with the code at
> the beginning of this hunk?
ack, I think we can FIELD_PREP() now. In the past we can't use FIELD_PREP()
with non-compile constant mask, but now it is doable.
Regards,
Lorenzo
>
> > + }
> >
> > return 0;
> > }
>
> ...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-03-04 8:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 12:20 [PATCH net-next] net: airoha: Fix GDM2 loopback configuration for USB serdes Lorenzo Bianconi
2026-03-03 14:16 ` Simon Horman
2026-03-04 8:29 ` Lorenzo Bianconi [this message]
2026-03-06 13:42 ` Simon Horman
2026-03-06 15:13 ` 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=aaftUXaSD0u5ZhO7@lore-desk \
--to=lorenzo@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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