* [PATCH net] net: txgbe: fix firmware version check
@ 2026-04-22 7:18 Jiawen Wu
2026-04-22 19:01 ` Jacob Keller
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Wu @ 2026-04-22 7:18 UTC (permalink / raw)
To: netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jacob Keller,
Jiawen Wu, stable
For the device SP, the firmware version is a 32-bit value where the
lower 20 bits represent the base version number. And the customized
firmware version populates the upper 12 bits with a specific
identification number.
For other devices AML 25G and 40G, the upper 12 bits of the firmware
version is always non-zero, and they have other naming conventions.
Only SP devices need to check this to tell if XPCS will work properly.
So the judgement of MAC type is added here.
And the original logic compared the entire 32-bit value against 0x20010,
which caused the outdated base firmwares bypass the version check
without a warning. Apply a mask 0xfffff to isolate the lower 20 bits for
an accurate base version comparison.
Fixes: ab928c24e6cd ("net: txgbe: add FW version warning")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
index ec32a5f422f2..8b7c3753bb6a 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
@@ -864,7 +864,8 @@ static int txgbe_probe(struct pci_dev *pdev,
"0x%08x", etrack_id);
}
- if (etrack_id < 0x20010)
+ if (wx->mac.type == wx_mac_sp &&
+ ((etrack_id & 0xfffff) < 0x20010))
dev_warn(&pdev->dev, "Please upgrade the firmware to 0x20010 or above.\n");
err = txgbe_test_hostif(wx);
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: txgbe: fix firmware version check
2026-04-22 7:18 [PATCH net] net: txgbe: fix firmware version check Jiawen Wu
@ 2026-04-22 19:01 ` Jacob Keller
0 siblings, 0 replies; 2+ messages in thread
From: Jacob Keller @ 2026-04-22 19:01 UTC (permalink / raw)
To: Jiawen Wu, netdev
Cc: Mengyuan Lou, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, stable
On 4/22/2026 12:18 AM, Jiawen Wu wrote:
> For the device SP, the firmware version is a 32-bit value where the
> lower 20 bits represent the base version number. And the customized
> firmware version populates the upper 12 bits with a specific
> identification number.
>
> For other devices AML 25G and 40G, the upper 12 bits of the firmware
> version is always non-zero, and they have other naming conventions.
>
> Only SP devices need to check this to tell if XPCS will work properly.
> So the judgement of MAC type is added here.
>
> And the original logic compared the entire 32-bit value against 0x20010,
> which caused the outdated base firmwares bypass the version check
> without a warning. Apply a mask 0xfffff to isolate the lower 20 bits for
> an accurate base version comparison.
>
> Fixes: ab928c24e6cd ("net: txgbe: add FW version warning")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
> drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> index ec32a5f422f2..8b7c3753bb6a 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> @@ -864,7 +864,8 @@ static int txgbe_probe(struct pci_dev *pdev,
> "0x%08x", etrack_id);
> }
>
> - if (etrack_id < 0x20010)
> + if (wx->mac.type == wx_mac_sp &&
> + ((etrack_id & 0xfffff) < 0x20010))
> dev_warn(&pdev->dev, "Please upgrade the firmware to 0x20010 or above.\n");
>
Minor nit/comment, and I don't have any objection to merging as-is.
This might be more readable with a FIELD_GET() and an associated mask. I
guess the mask is fairly obvious, so it doesn't really warrant a v2 of
the fix.
Either way:
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Thanks,
Jake
> err = txgbe_test_hostif(wx);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-22 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 7:18 [PATCH net] net: txgbe: fix firmware version check Jiawen Wu
2026-04-22 19:01 ` Jacob Keller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox