mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
IB/hfi1: Fix missing lock/unlock in verbs drain callback
The iowait_sdma_drained() callback lacked locking to
protect the qp s_flags field.
This causes the s_flags to be out of sync
on multiple CPUs, potentially corrupting the s_flags.
Fixes: a545f5308b
("staging/rdma/hfi: fix CQ completion order issue")
Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
e6d2e0176e
commit
b9b06cb6fe
1 changed files with 2 additions and 0 deletions
|
@ -519,10 +519,12 @@ static void iowait_sdma_drained(struct iowait *wait)
|
||||||
* do the flush work until that QP's
|
* do the flush work until that QP's
|
||||||
* sdma work has finished.
|
* sdma work has finished.
|
||||||
*/
|
*/
|
||||||
|
spin_lock(&qp->s_lock);
|
||||||
if (qp->s_flags & RVT_S_WAIT_DMA) {
|
if (qp->s_flags & RVT_S_WAIT_DMA) {
|
||||||
qp->s_flags &= ~RVT_S_WAIT_DMA;
|
qp->s_flags &= ~RVT_S_WAIT_DMA;
|
||||||
hfi1_schedule_send(qp);
|
hfi1_schedule_send(qp);
|
||||||
}
|
}
|
||||||
|
spin_unlock(&qp->s_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue