Skip to content

Commit 93b289b

Browse files
kwan-intcjgunthorpe
authored andcommitted
IB/hfi1: Clear the IOWAIT pending bits when QP is put into error state
When a QP is put into error state, it may be waiting for send engine resources. In this case, the QP will be removed from the send engine's waiting list, but its IOWAIT pending bits are not cleared. This will normally not have any major impact as the QP is being destroyed. However, the QP still needs to wind down its operations, such as draining the send queue by scheduling the send engine. Clearing the pending bits will avoid any potential complications. In addition, if the QP will eventually hang, clearing the pending bits can help debugging by presenting a consistent picture if the user dumps the qp_stats. This patch clears a QP's IOWAIT_PENDING_IB and IO_PENDING_TID bits in priv->s_iowait.flags in this case. Fixes: 5da0fc9 ("IB/hfi1: Prepare resource waits for dual leg") Reviewed-by: Mike Marciniszyn <[email protected]> Reviewed-by: Alex Estrin <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 662d664 commit 93b289b

File tree

1 file changed

+2
-0
lines changed
  • drivers/infiniband/hw/hfi1

1 file changed

+2
-0
lines changed

drivers/infiniband/hw/hfi1/qp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,8 @@ void notify_error_qp(struct rvt_qp *qp)
899899
!(qp->s_flags & RVT_S_BUSY) &&
900900
!(priv->s_flags & RVT_S_BUSY)) {
901901
qp->s_flags &= ~HFI1_S_ANY_WAIT_IO;
902+
iowait_clear_flag(&priv->s_iowait, IOWAIT_PENDING_IB);
903+
iowait_clear_flag(&priv->s_iowait, IOWAIT_PENDING_TID);
902904
list_del_init(&priv->s_iowait.list);
903905
priv->s_iowait.lock = NULL;
904906
rvt_put_qp(qp);

0 commit comments

Comments
 (0)