aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h2
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index b7e2844f096b..8f36e231bdf5 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -905,7 +905,7 @@ struct nes_hw_qp {
905}; 905};
906 906
907struct nes_hw_cq { 907struct nes_hw_cq {
908 struct nes_hw_cqe volatile *cq_vbase; /* PCI memory for host rings */ 908 struct nes_hw_cqe *cq_vbase; /* PCI memory for host rings */
909 void (*ce_handler)(struct nes_device *nesdev, struct nes_hw_cq *cq); 909 void (*ce_handler)(struct nes_device *nesdev, struct nes_hw_cq *cq);
910 dma_addr_t cq_pbase; /* PCI memory for host rings */ 910 dma_addr_t cq_pbase; /* PCI memory for host rings */
911 u16 cq_head; 911 u16 cq_head;
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index f9a5d4390892..ee74f7c7a6da 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1976,7 +1976,7 @@ static int nes_destroy_cq(struct ib_cq *ib_cq)
1976 1976
1977 if (nescq->cq_mem_size) 1977 if (nescq->cq_mem_size)
1978 pci_free_consistent(nesdev->pcidev, nescq->cq_mem_size, 1978 pci_free_consistent(nesdev->pcidev, nescq->cq_mem_size,
1979 (void *)nescq->hw_cq.cq_vbase, nescq->hw_cq.cq_pbase); 1979 nescq->hw_cq.cq_vbase, nescq->hw_cq.cq_pbase);
1980 kfree(nescq); 1980 kfree(nescq);
1981 1981
1982 return ret; 1982 return ret;
@@ -3610,6 +3610,12 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
3610 while (cqe_count < num_entries) { 3610 while (cqe_count < num_entries) {
3611 if (le32_to_cpu(nescq->hw_cq.cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX]) & 3611 if (le32_to_cpu(nescq->hw_cq.cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX]) &
3612 NES_CQE_VALID) { 3612 NES_CQE_VALID) {
3613 /*
3614 * Make sure we read CQ entry contents *after*
3615 * we've checked the valid bit.
3616 */
3617 rmb();
3618
3613 cqe = nescq->hw_cq.cq_vbase[head]; 3619 cqe = nescq->hw_cq.cq_vbase[head];
3614 nescq->hw_cq.cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX] = 0; 3620 nescq->hw_cq.cq_vbase[head].cqe_words[NES_CQE_OPCODE_IDX] = 0;
3615 u32temp = le32_to_cpu(cqe.cqe_words[NES_CQE_COMP_COMP_CTX_LOW_IDX]); 3621 u32temp = le32_to_cpu(cqe.cqe_words[NES_CQE_COMP_COMP_CTX_LOW_IDX]);