| From c263f644add3d6ad81f9d62a99284fde408f0caa Mon Sep 17 00:00:00 2001 |
| From: Jiawen Wu <jiawenwu@trustnetic.com> |
| Date: Wed, 22 Apr 2026 15:18:37 +0800 |
| Subject: net: txgbe: fix firmware version check |
| |
| From: Jiawen Wu <jiawenwu@trustnetic.com> |
| |
| commit c263f644add3d6ad81f9d62a99284fde408f0caa upstream. |
| |
| 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> |
| Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> |
| Link: https://patch.msgid.link/C787AA5C07598B13+20260422071837.372731-1-jiawenwu@trustnetic.com |
| Signed-off-by: Jakub Kicinski <kuba@kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++- |
| 1 file changed, 2 insertions(+), 1 deletion(-) |
| |
| --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c |
| +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c |
| @@ -867,7 +867,8 @@ static int txgbe_probe(struct pci_dev *p |
| "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); |