diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-04-12 10:46:10 -0700 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-04-28 16:32:26 -0400 |
commit | 747f4d7a9d1bc07e3f9f22c84201ffb0abee1634 (patch) | |
tree | b7e6087b366f8300a0c7bde77e756a403f29f033 /drivers/staging/rdma/hfi1/ud.c | |
parent | f39cc34df7ed919c5c7630a8a7a701939356c37c (diff) | |
download | linux-stable-747f4d7a9d1bc07e3f9f22c84201ffb0abee1634.tar.gz linux-stable-747f4d7a9d1bc07e3f9f22c84201ffb0abee1634.tar.bz2 linux-stable-747f4d7a9d1bc07e3f9f22c84201ffb0abee1634.zip |
IB/qib, IB/hfi1: Fix up UD loopback use of irq flags
The dual lock patch moved locking around and missed an issue
with handling irq flags when processing UD loopback
packets. This issue was revealed by smatch.
Fix for both qib and hfi1 to pass the saved flags to the UD request
builder and handle the changes correctly.
Fixes: 46a80d62e6e0 ("IB/qib, staging/rdma/hfi1: add s_hlock for use in post send")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/ud.c')
-rw-r--r-- | drivers/staging/rdma/hfi1/ud.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rdma/hfi1/ud.c b/drivers/staging/rdma/hfi1/ud.c index ae8a70f703eb..1e503ad0bebb 100644 --- a/drivers/staging/rdma/hfi1/ud.c +++ b/drivers/staging/rdma/hfi1/ud.c @@ -322,7 +322,7 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) (lid == ppd->lid || (lid == be16_to_cpu(IB_LID_PERMISSIVE) && qp->ibqp.qp_type == IB_QPT_GSI)))) { - unsigned long flags; + unsigned long tflags = ps->flags; /* * If DMAs are in progress, we can't generate * a completion for the loopback packet since @@ -335,10 +335,10 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) goto bail; } qp->s_cur = next_cur; - local_irq_save(flags); - spin_unlock_irqrestore(&qp->s_lock, flags); + spin_unlock_irqrestore(&qp->s_lock, tflags); ud_loopback(qp, wqe); - spin_lock_irqsave(&qp->s_lock, flags); + spin_lock_irqsave(&qp->s_lock, tflags); + ps->flags = tflags; hfi1_send_complete(qp, wqe, IB_WC_SUCCESS); goto done_free_tx; } |