@@ -1495,6 +1495,7 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
*/
set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
+ wake_up_all(&rdev->rcfw.cmdq.waitq);
mutex_unlock(&bnxt_re_mutex);
return 0;
@@ -118,7 +118,8 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie, u8 opcode)
/* Non zero means command completed */
ret = wait_event_timeout(cmdq->waitq,
- !test_bit(cbit, cmdq->cmdq_bitmap),
+ !test_bit(cbit, cmdq->cmdq_bitmap) ||
+ test_bit(ERR_DEVICE_DETACHED, &cmdq->flags),
msecs_to_jiffies(RCFW_FW_STALL_TIMEOUT_SEC
* 1000));