* [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices
[not found] <20250513021009.145708-1-jiawenwu@trustnetic.com>
@ 2025-05-13 2:10 ` Jiawen Wu
2025-05-14 11:19 ` Simon Horman
2025-05-15 2:40 ` patchwork-bot+netdevbpf
2025-05-13 2:10 ` [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout Jiawen Wu
2025-05-13 2:10 ` [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command Jiawen Wu
2 siblings, 2 replies; 7+ messages in thread
From: Jiawen Wu @ 2025-05-13 2:10 UTC (permalink / raw)
To: netdev, rmk+kernel, horms, pabeni, kuba, edumazet, davem,
andrew+netdev
Cc: mengyuanlou, Jiawen Wu
In the new firmware version, the shadow ram reserves some space to store
I2C information, so the checksum calculation needs to skip this section.
Otherwise, the driver will fail to probe because the invalid EEPROM
checksum.
Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c | 8 +++++++-
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
index 4b9921b7bb11..a054b259d435 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c
@@ -99,9 +99,15 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum)
}
local_buffer = eeprom_ptrs;
- for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++)
+ for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++) {
+ if (wx->mac.type == wx_mac_aml) {
+ if (i >= TXGBE_EEPROM_I2C_SRART_PTR &&
+ i < TXGBE_EEPROM_I2C_END_PTR)
+ local_buffer[i] = 0xffff;
+ }
if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM)
*checksum += local_buffer[i];
+ }
kvfree(eeprom_ptrs);
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
index 9c1c26234cad..f423012dec22 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_type.h
@@ -158,6 +158,8 @@
#define TXGBE_EEPROM_VERSION_L 0x1D
#define TXGBE_EEPROM_VERSION_H 0x1E
#define TXGBE_ISCSI_BOOT_CONFIG 0x07
+#define TXGBE_EEPROM_I2C_SRART_PTR 0x580
+#define TXGBE_EEPROM_I2C_END_PTR 0x800
#define TXGBE_MAX_MSIX_VECTORS 64
#define TXGBE_MAX_FDIR_INDICES 63
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout
[not found] <20250513021009.145708-1-jiawenwu@trustnetic.com>
2025-05-13 2:10 ` [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices Jiawen Wu
@ 2025-05-13 2:10 ` Jiawen Wu
2025-05-14 11:20 ` Simon Horman
2025-05-13 2:10 ` [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command Jiawen Wu
2 siblings, 1 reply; 7+ messages in thread
From: Jiawen Wu @ 2025-05-13 2:10 UTC (permalink / raw)
To: netdev, rmk+kernel, horms, pabeni, kuba, edumazet, davem,
andrew+netdev
Cc: mengyuanlou, Jiawen Wu
For the new SW-FW interaction, the timeout waiting for the firmware to
return is too short. So that some mailbox commands cannot be completed.
Use the 'timeout' parameter instead of fixed timeout value for flexible
configuration.
Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index aed45abafb1b..ccdc57e9b0d5 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -434,8 +434,8 @@ static int wx_host_interface_command_r(struct wx *wx, u32 *buffer,
wr32m(wx, WX_SW2FW_MBOX_CMD, WX_SW2FW_MBOX_CMD_VLD, WX_SW2FW_MBOX_CMD_VLD);
/* polling reply from FW */
- err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 1000, 50000,
- true, wx, buffer, send_cmd);
+ err = read_poll_timeout(wx_poll_fw_reply, reply, reply, 2000,
+ timeout * 1000, true, wx, buffer, send_cmd);
if (err) {
wx_err(wx, "Polling from FW messages timeout, cmd: 0x%x, index: %d\n",
send_cmd, wx->swfw_index);
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command
[not found] <20250513021009.145708-1-jiawenwu@trustnetic.com>
2025-05-13 2:10 ` [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices Jiawen Wu
2025-05-13 2:10 ` [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout Jiawen Wu
@ 2025-05-13 2:10 ` Jiawen Wu
2025-05-14 11:20 ` Simon Horman
2 siblings, 1 reply; 7+ messages in thread
From: Jiawen Wu @ 2025-05-13 2:10 UTC (permalink / raw)
To: netdev, rmk+kernel, horms, pabeni, kuba, edumazet, davem,
andrew+netdev
Cc: mengyuanlou, Jiawen Wu
For the new SW-FW interaction, missing the error return if there is an
unknown command. It causes the driver to mistakenly believe that the
interaction is complete. This problem occurs when new driver is paired
with old firmware, which does not support the new mailbox commands.
Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ethernet/wangxun/libwx/wx_hw.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index ccdc57e9b0d5..490d34233d38 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -442,6 +442,12 @@ static int wx_host_interface_command_r(struct wx *wx, u32 *buffer,
goto rel_out;
}
+ if (hdr->cmd_or_resp.ret_status == 0x80) {
+ wx_err(wx, "Unknown FW command: 0x%x\n", send_cmd);
+ err = -EINVAL;
+ goto rel_out;
+ }
+
/* expect no reply from FW then return */
if (!return_data)
goto rel_out;
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices
2025-05-13 2:10 ` [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices Jiawen Wu
@ 2025-05-14 11:19 ` Simon Horman
2025-05-15 2:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 7+ messages in thread
From: Simon Horman @ 2025-05-14 11:19 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, rmk+kernel, pabeni, kuba, edumazet, davem, andrew+netdev,
mengyuanlou
On Tue, May 13, 2025 at 10:10:07AM +0800, Jiawen Wu wrote:
> In the new firmware version, the shadow ram reserves some space to store
> I2C information, so the checksum calculation needs to skip this section.
> Otherwise, the driver will fail to probe because the invalid EEPROM
> checksum.
>
> Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout
2025-05-13 2:10 ` [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout Jiawen Wu
@ 2025-05-14 11:20 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2025-05-14 11:20 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, rmk+kernel, pabeni, kuba, edumazet, davem, andrew+netdev,
mengyuanlou
On Tue, May 13, 2025 at 10:10:08AM +0800, Jiawen Wu wrote:
> For the new SW-FW interaction, the timeout waiting for the firmware to
> return is too short. So that some mailbox commands cannot be completed.
> Use the 'timeout' parameter instead of fixed timeout value for flexible
> configuration.
>
> Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command
2025-05-13 2:10 ` [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command Jiawen Wu
@ 2025-05-14 11:20 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2025-05-14 11:20 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, rmk+kernel, pabeni, kuba, edumazet, davem, andrew+netdev,
mengyuanlou
On Tue, May 13, 2025 at 10:10:09AM +0800, Jiawen Wu wrote:
> For the new SW-FW interaction, missing the error return if there is an
> unknown command. It causes the driver to mistakenly believe that the
> interaction is complete. This problem occurs when new driver is paired
> with old firmware, which does not support the new mailbox commands.
>
> Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices
2025-05-13 2:10 ` [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices Jiawen Wu
2025-05-14 11:19 ` Simon Horman
@ 2025-05-15 2:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-15 2:40 UTC (permalink / raw)
To: Jiawen Wu
Cc: netdev, rmk+kernel, horms, pabeni, kuba, edumazet, davem,
andrew+netdev, mengyuanlou
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 13 May 2025 10:10:07 +0800 you wrote:
> In the new firmware version, the shadow ram reserves some space to store
> I2C information, so the checksum calculation needs to skip this section.
> Otherwise, the driver will fail to probe because the invalid EEPROM
> checksum.
>
> Fixes: 2e5af6b2ae85 ("net: txgbe: Add basic support for new AML devices")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
>
> [...]
Here is the summary with links:
- [net,v2,1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices
https://git.kernel.org/netdev/net/c/141a8dec88ba
- [net,v2,2/3] net: libwx: Fix FW mailbox reply timeout
https://git.kernel.org/netdev/net/c/42efa358f033
- [net,v2,3/3] net: libwx: Fix FW mailbox unknown command
https://git.kernel.org/netdev/net/c/09e76365baa1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-15 2:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250513021009.145708-1-jiawenwu@trustnetic.com>
2025-05-13 2:10 ` [PATCH net v2 1/3] net: txgbe: Fix to calculate EEPROM checksum for AML devices Jiawen Wu
2025-05-14 11:19 ` Simon Horman
2025-05-15 2:40 ` patchwork-bot+netdevbpf
2025-05-13 2:10 ` [PATCH net v2 2/3] net: libwx: Fix FW mailbox reply timeout Jiawen Wu
2025-05-14 11:20 ` Simon Horman
2025-05-13 2:10 ` [PATCH net v2 3/3] net: libwx: Fix FW mailbox unknown command Jiawen Wu
2025-05-14 11:20 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).