All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Andrew Lunn'" <andrew@lunn.ch>
Cc: <netdev@vger.kernel.org>,
	"'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'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>,
	"'Russell King'" <linux@armlinux.org.uk>,
	"'Simon Horman'" <horms@kernel.org>, <netdev@vger.kernel.org>,
	"'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'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>,
	"'Russell King'" <linux@armlinux.org.uk>,
	"'Simon Horman'" <horms@kernel.org>
Subject: RE: [PATCH net] net: txgbe: fix module identification
Date: Wed, 3 Jun 2026 11:19:27 +0800	[thread overview]
Message-ID: <095b01dcf307$c8af8920$5a0e9b60$@trustnetic.com> (raw)
In-Reply-To: <9945fe19-815b-4e27-8446-c21cdfaa16d9@lunn.ch>

On Tue, Jun 2, 2026 9:15 PM, Andrew Lunn wrote:
> On Tue, Jun 02, 2026 at 10:54:43AM +0800, Jiawen Wu wrote:
> > For AML devices, there are some issues where the wrong module
> > indentified then configure PHY failed.
> >
> > The module info buffers should be initialized to 0 before the firmware
> > returns information. And DECLARE_PHY_INTERFACE_MASK() does not guarantee
> > zeroed contents, so explicitly clear the temporary interface masks before
> > setting supported interfaces.
> >
> > Rework txgbe_identify_module() to validate module identifiers through
> > explicit type checks instead of relying on transceiver_type heuristics.
> > When using the SFP module, transceiver_type could be a random value,
> > because it was read from an invalid register.
> 
> This seems like multiple fixes. Please break the patch up.

OK.

> The current DECLARE_PHY_INTERFACE_MASK() is not great. It is mostly
> used by phylink in structures which get allocated and zeroed. But here
> you have it as a stack variable. Maybe we want a new variant which
> includes = {} ?

I'll change it to:
  unsigned long interfaces[PHY_INTERFACE_MODE_MAX] = {};

If PHYLINK could optimize DECLARE_PHY_INTERFACE_MASK(), it would be better.



      reply	other threads:[~2026-06-03  3:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02  2:54 [PATCH net] net: txgbe: fix module identification Jiawen Wu
2026-06-02 13:14 ` Andrew Lunn
2026-06-03  3:19   ` Jiawen Wu [this message]

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='095b01dcf307$c8af8920$5a0e9b60$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mengyuanlou@net-swift.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.