OSDN Git Service

iw_cxgb4: atomically flush the qp
authorSteve Wise <swise@opengridcomputing.com>
Thu, 9 Nov 2017 15:21:26 +0000 (07:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:45:19 +0000 (09:45 +0100)
commitf73c380ab3fea85e4fbc66f5cc6f9e6551b89f24
treec9d9a4091376d474a9594af7e6ccc4a92982021c
parentc7f500dd4ff1f9032e1f73cdb0d4bc8cb6515bb3
iw_cxgb4: atomically flush the qp

commit bc52e9ca74b9a395897bb640c6671b2cbf716032 upstream.

__flush_qp() has a race condition where during the flush operation,
the qp lock is released allowing another thread to possibly post a WR,
which corrupts the queue state, possibly causing crashes.  The lock was
released to preserve the cq/qp locking hierarchy of cq first, then qp.
However releasing the qp lock is not necessary; both RQ and SQ CQ locks
can be acquired first, followed by the qp lock, and then the RQ and SQ
flushing can be done w/o unlocking.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/cxgb4/qp.c