Skip to content

Commit 335ebf6

Browse files
Steve Wisejgunthorpe
authored andcommitted
iw_cxgb4: only clear the ARMED bit if a notification is needed
In __flush_qp(), the CQ ARMED bit was being cleared regardless of whether any notification is actually needed. This resulted in the iser termination logic getting stuck in ib_drain_sq() because the CQ was not marked ARMED and thus the drain CQE notification wasn't triggered. This new bug was exposed when this commit was merged: commit cbb40fa ("iw_cxgb4: only call the cq comp_handler when the cq is armed") Signed-off-by: Steve Wise <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d0e312f commit 335ebf6

File tree

1 file changed

+4
-4
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+4
-4
lines changed

drivers/infiniband/hw/cxgb4/qp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,21 +1285,21 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
12851285
spin_unlock_irqrestore(&rchp->lock, flag);
12861286

12871287
if (schp == rchp) {
1288-
if (t4_clear_cq_armed(&rchp->cq) &&
1289-
(rq_flushed || sq_flushed)) {
1288+
if ((rq_flushed || sq_flushed) &&
1289+
t4_clear_cq_armed(&rchp->cq)) {
12901290
spin_lock_irqsave(&rchp->comp_handler_lock, flag);
12911291
(*rchp->ibcq.comp_handler)(&rchp->ibcq,
12921292
rchp->ibcq.cq_context);
12931293
spin_unlock_irqrestore(&rchp->comp_handler_lock, flag);
12941294
}
12951295
} else {
1296-
if (t4_clear_cq_armed(&rchp->cq) && rq_flushed) {
1296+
if (rq_flushed && t4_clear_cq_armed(&rchp->cq)) {
12971297
spin_lock_irqsave(&rchp->comp_handler_lock, flag);
12981298
(*rchp->ibcq.comp_handler)(&rchp->ibcq,
12991299
rchp->ibcq.cq_context);
13001300
spin_unlock_irqrestore(&rchp->comp_handler_lock, flag);
13011301
}
1302-
if (t4_clear_cq_armed(&schp->cq) && sq_flushed) {
1302+
if (sq_flushed && t4_clear_cq_armed(&schp->cq)) {
13031303
spin_lock_irqsave(&schp->comp_handler_lock, flag);
13041304
(*schp->ibcq.comp_handler)(&schp->ibcq,
13051305
schp->ibcq.cq_context);

0 commit comments

Comments
 (0)