Skip to content

Commit a002785

Browse files
kadesai16rleon
authored andcommitted
RDMA/bnxt_re: cancel all control path command waiters upon error
When an error is detected in FW, wake up all the waiters as the all of them need to be completed with timeout. Add the device error state also as a wait condition. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent bb8c936 commit a002785

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,7 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
14951495
*/
14961496
set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
14971497
set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
1498+
wake_up_all(&rdev->rcfw.cmdq.waitq);
14981499
mutex_unlock(&bnxt_re_mutex);
14991500

15001501
return 0;

drivers/infiniband/hw/bnxt_re/qplib_rcfw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie, u8 opcode)
116116
return -ETIMEDOUT;
117117

118118
wait_event_timeout(cmdq->waitq,
119-
!test_bit(cbit, cmdq->cmdq_bitmap),
119+
!test_bit(cbit, cmdq->cmdq_bitmap) ||
120+
test_bit(ERR_DEVICE_DETACHED, &cmdq->flags),
120121
msecs_to_jiffies(RCFW_FW_STALL_TIMEOUT_SEC
121122
* 1000));
122-
123123
if (!test_bit(cbit, cmdq->cmdq_bitmap))
124124
return 0;
125125

0 commit comments

Comments
 (0)