Skip to content

Commit 02146a9

Browse files
committed
Merge branch 'hinic-BugFixes'
Luo bin says: ==================== hinic: BugFixes The bugs fixed in this patchset have been present since the following commits: patch #1: Fixes: 00e57a6 ("net-next/hinic: Add Tx operation") patch #2: Fixes: 5e126e7 ("hinic: add firmware update support") ==================== Signed-off-by: Jakub Kicinski <[email protected]>
2 parents cc8e58f + 0c97ee5 commit 02146a9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c

+15-5
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@
4747

4848
#define MGMT_MSG_TIMEOUT 5000
4949

50+
#define SET_FUNC_PORT_MBOX_TIMEOUT 30000
51+
5052
#define SET_FUNC_PORT_MGMT_TIMEOUT 25000
5153

54+
#define UPDATE_FW_MGMT_TIMEOUT 20000
55+
5256
#define mgmt_to_pfhwdev(pf_mgmt) \
5357
container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
5458

@@ -361,16 +365,22 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
361365
return -EINVAL;
362366
}
363367

364-
if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
365-
timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
368+
if (HINIC_IS_VF(hwif)) {
369+
if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
370+
timeout = SET_FUNC_PORT_MBOX_TIMEOUT;
366371

367-
if (HINIC_IS_VF(hwif))
368372
return hinic_mbox_to_pf(pf_to_mgmt->hwdev, mod, cmd, buf_in,
369-
in_size, buf_out, out_size, 0);
370-
else
373+
in_size, buf_out, out_size, timeout);
374+
} else {
375+
if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
376+
timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
377+
else if (cmd == HINIC_PORT_CMD_UPDATE_FW)
378+
timeout = UPDATE_FW_MGMT_TIMEOUT;
379+
371380
return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
372381
buf_out, out_size, MGMT_DIRECT_SEND,
373382
MSG_NOT_RESP, timeout);
383+
}
374384
}
375385

376386
static void recv_mgmt_msg_work_handler(struct work_struct *work)

0 commit comments

Comments
 (0)