diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_cq.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_cq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_cq.c b/drivers/infiniband/hw/ipath/ipath_cq.c index 9014ef63eedc..a6f04d27ec57 100644 --- a/drivers/infiniband/hw/ipath/ipath_cq.c +++ b/drivers/infiniband/hw/ipath/ipath_cq.c | |||
@@ -90,6 +90,8 @@ void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int solicited) | |||
90 | wc->queue[head].sl = entry->sl; | 90 | wc->queue[head].sl = entry->sl; |
91 | wc->queue[head].dlid_path_bits = entry->dlid_path_bits; | 91 | wc->queue[head].dlid_path_bits = entry->dlid_path_bits; |
92 | wc->queue[head].port_num = entry->port_num; | 92 | wc->queue[head].port_num = entry->port_num; |
93 | /* Make sure queue entry is written before the head index. */ | ||
94 | smp_wmb(); | ||
93 | wc->head = next; | 95 | wc->head = next; |
94 | 96 | ||
95 | if (cq->notify == IB_CQ_NEXT_COMP || | 97 | if (cq->notify == IB_CQ_NEXT_COMP || |
@@ -139,7 +141,8 @@ int ipath_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry) | |||
139 | 141 | ||
140 | if (tail == wc->head) | 142 | if (tail == wc->head) |
141 | break; | 143 | break; |
142 | 144 | /* Make sure entry is read after head index is read. */ | |
145 | smp_rmb(); | ||
143 | qp = ipath_lookup_qpn(&to_idev(cq->ibcq.device)->qp_table, | 146 | qp = ipath_lookup_qpn(&to_idev(cq->ibcq.device)->qp_table, |
144 | wc->queue[tail].qp_num); | 147 | wc->queue[tail].qp_num); |
145 | entry->qp = &qp->ibqp; | 148 | entry->qp = &qp->ibqp; |