Skip to content

Commit

Permalink
IB/mlx4: Lock SQ lock in mlx4_ib_post_send()
Browse files Browse the repository at this point in the history
Because of a typo, mlx4_ib_post_send() takes the same lock rq.lock as
mlx4_ib_post_recv().  Correct the code so the intended sq.lock is
taken when posting a send.

Noticed by Yossi Leybovitch and pointed out by Jack Morgenstein from
Mellanox.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Roland Dreier committed Oct 30, 2007
1 parent 09f60f8 commit 96db0e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
int size;
int i;

spin_lock_irqsave(&qp->rq.lock, flags);
spin_lock_irqsave(&qp->sq.lock, flags);

ind = qp->sq.head;

Expand Down Expand Up @@ -1448,7 +1448,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
(qp->sq.wqe_cnt - 1));
}

spin_unlock_irqrestore(&qp->rq.lock, flags);
spin_unlock_irqrestore(&qp->sq.lock, flags);

return err;
}
Expand Down

0 comments on commit 96db0e0

Please sign in to comment.