Skip to contentSkip to conversation

hinic: BugFixes

PATCH Applied Luo bin 2 participants 4 messages Sep 4, 2020 – Sep 5, 2020

Subsystems (3)
lore
Share & tools
lore

Luo bin

author
#0 lore raw

cover hinic: BugFixes

The bugs fixed in this patchset have been present since the following commits:
patch #1: Fixes: 00e57a6d4ad3 ("net-next/hinic: Add Tx operation") patch #2: Fixes: 5e126e7c4e52 ("hinic: add firmware update support")

Luo bin (2):
hinic: bump up the timeout of SET_FUNC_STATE cmd
hinic: bump up the timeout of UPDATE_FW cmd

 .../net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 20 ++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 hinic: bump up the timeout of SET_FUNC_STATE cmd

We free memory regardless of the return value of SET_FUNC_STATE cmd in hinic_close function to avoid memory leak and this cmd may timeout when fw is busy with handling other cmds, so we bump up the timeout of this cmd to ensure it won't return failure.

Fixes 00e57a6d4ad3 ("net-next/hinic: Add Tx operation")
---
 .../net/ethernet/huawei/hinic/hinic_hw_mgmt.c    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +11 -5
index c6ce5966284c..0d56c6ceccd9 100644
@@ -47,6 +47,8 @@
 
 #define MGMT_MSG_TIMEOUT                5000
 
+#define SET_FUNC_PORT_MBOX_TIMEOUT	30000
+
 #define SET_FUNC_PORT_MGMT_TIMEOUT	25000
 
 #define mgmt_to_pfhwdev(pf_mgmt)        \
@@ -361,16 +363,20 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
 		return -EINVAL;
 	}
 
-	if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
-		timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
+	if (HINIC_IS_VF(hwif)) {
+		if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
+			timeout = SET_FUNC_PORT_MBOX_TIMEOUT;
 
-	if (HINIC_IS_VF(hwif))
 		return hinic_mbox_to_pf(pf_to_mgmt->hwdev, mod, cmd, buf_in,
-					in_size, buf_out, out_size, 0);
-	else
+					in_size, buf_out, out_size, timeout);
+	} else {
+		if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
+			timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
+
 		return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
 				buf_out, out_size, MGMT_DIRECT_SEND,
 				MSG_NOT_RESP, timeout);
+	}
 }
 
 static void recv_mgmt_msg_work_handler(struct work_struct *work)
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/2 hinic: bump up the timeout of UPDATE_FW cmd

In reply to Luo bin

Firmware erases the entire flash region which may take several seconds before flashing, so we bump up the timeout to ensure this cmd won't return failure.

Fixes 5e126e7c4e52 ("hinic: add firmware update support")
---
 drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +4 -0
index 0d56c6ceccd9..2ebae6cb5db5 100644
@@ -51,6 +51,8 @@
 
 #define SET_FUNC_PORT_MGMT_TIMEOUT	25000
 
+#define UPDATE_FW_MGMT_TIMEOUT		20000
+
 #define mgmt_to_pfhwdev(pf_mgmt)        \
 		container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
 
@@ -372,6 +374,8 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
 	} else {
 		if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
 			timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
+		else if (cmd == HINIC_PORT_CMD_UPDATE_FW)
+			timeout = UPDATE_FW_MGMT_TIMEOUT;
 
 		return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
 				buf_out, out_size, MGMT_DIRECT_SEND,
Signature · 1 line
2.17.1
maintainer Applied
#3 lore raw
In reply to Luo bin
Quoted 4 lines · On Fri, 4 Sep 2020 16:37:27 +0800 Luo bin wrote:

The bugs fixed in this patchset have been present since the following commits:
patch #1: Fixes: 00e57a6d4ad3 ("net-next/hinic: Add Tx operation") patch #2: Fixes: 5e126e7c4e52 ("hinic: add firmware update support")

Applied.