Skip to content

Commit 0da7c32

Browse files
Luo bindavem330
authored andcommitted
hinic: fix wrong para of wait_for_completion_timeout
the second input parameter of wait_for_completion_timeout should be jiffies instead of millisecond Signed-off-by: Luo bin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 33f15da commit 0da7c32

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq,
389389

390390
spin_unlock_bh(&cmdq->cmdq_lock);
391391

392-
if (!wait_for_completion_timeout(&done, CMDQ_TIMEOUT)) {
392+
if (!wait_for_completion_timeout(&done,
393+
msecs_to_jiffies(CMDQ_TIMEOUT))) {
393394
spin_lock_bh(&cmdq->cmdq_lock);
394395

395396
if (cmdq->errcode[curr_prod_idx] == &errcode)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#define MSG_NOT_RESP 0xFFFF
4545

46-
#define MGMT_MSG_TIMEOUT 1000
46+
#define MGMT_MSG_TIMEOUT 5000
4747

4848
#define mgmt_to_pfhwdev(pf_mgmt) \
4949
container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
@@ -267,7 +267,8 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt,
267267
goto unlock_sync_msg;
268268
}
269269

270-
if (!wait_for_completion_timeout(recv_done, MGMT_MSG_TIMEOUT)) {
270+
if (!wait_for_completion_timeout(recv_done,
271+
msecs_to_jiffies(MGMT_MSG_TIMEOUT))) {
271272
dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id);
272273
err = -ETIMEDOUT;
273274
goto unlock_sync_msg;

0 commit comments

Comments
 (0)