Skip to content

Commit

Permalink
Merge branch 'hinic-BugFixes'
Browse files Browse the repository at this point in the history
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 <kuba@kernel.org>
  • Loading branch information
kuba-moo committed Sep 5, 2020
2 parents cc8e58f + 0c97ee5 commit 02146a9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@

#define MGMT_MSG_TIMEOUT 5000

#define SET_FUNC_PORT_MBOX_TIMEOUT 30000

#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)

Expand Down Expand Up @@ -361,16 +365,22 @@ 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;
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,
MSG_NOT_RESP, timeout);
}
}

static void recv_mgmt_msg_work_handler(struct work_struct *work)
Expand Down

0 comments on commit 02146a9

Please sign in to comment.