IB/core: Protect against self-requeue of a cq work item
authorSagi Grimberg <[email protected]>
Wed, 8 Mar 2017 20:00:52 +0000 (22:00 +0200)
committerDoug Ledford <[email protected]>
Fri, 24 Mar 2017 20:40:31 +0000 (16:40 -0400)
We need to make sure that the cq work item does not
run when we are destroying the cq. Unlike flush_work,
cancel_work_sync protects against self-requeue of the
work item (which we can do in ib_cq_poll_work).

Signed-off-by: Sagi Grimberg <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>--
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
drivers/infiniband/core/cq.c

index e95510117a6dd7069f1251796eaebd1ea8283693..2746d2eb3d52c4036518b26e2b22038de80bd788 100644 (file)
@@ -196,7 +196,7 @@ void ib_free_cq(struct ib_cq *cq)
                irq_poll_disable(&cq->iop);
                break;
        case IB_POLL_WORKQUEUE:
-               flush_work(&cq->work);
+               cancel_work_sync(&cq->work);
                break;
        default:
                WARN_ON_ONCE(1);