RE: [PATCH net] net: txgbe: fix module identification
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: 2026-06-03 03:21:01
On Tue, Jun 2, 2026 9:15 PM, Andrew Lunn wrote:
On Tue, Jun 02, 2026 at 10:54:43AM +0800, Jiawen Wu wrote:quoted
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.