diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-28 15:26:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-28 15:26:48 +0200 |
commit | 8439a69e72888daa7d2667980efaf20d8bbe7b20 (patch) | |
tree | ff262847ff4f6797c9df882379ea0498a8822a18 /drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c | |
parent | b9920ca3b53728aaa836f138f74ebb37776b9f57 (diff) | |
parent | cc4a41fe5541a73019a864883297bd5043aa6d98 (diff) | |
download | talos-obmc-linux-8439a69e72888daa7d2667980efaf20d8bbe7b20.tar.gz talos-obmc-linux-8439a69e72888daa7d2667980efaf20d8bbe7b20.zip |
Merge 4.13-rc7 into staging-next
We want the staging and iio fixes in here to handle the merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c')
-rw-r--r-- | drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c index 69bda611d313..90aa326fd7c0 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c @@ -65,13 +65,28 @@ int pvrdma_req_notify_cq(struct ib_cq *ibcq, struct pvrdma_dev *dev = to_vdev(ibcq->device); struct pvrdma_cq *cq = to_vcq(ibcq); u32 val = cq->cq_handle; + unsigned long flags; + int has_data = 0; val |= (notify_flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED ? PVRDMA_UAR_CQ_ARM_SOL : PVRDMA_UAR_CQ_ARM; + spin_lock_irqsave(&cq->cq_lock, flags); + pvrdma_write_uar_cq(dev, val); - return 0; + if (notify_flags & IB_CQ_REPORT_MISSED_EVENTS) { + unsigned int head; + + has_data = pvrdma_idx_ring_has_data(&cq->ring_state->rx, + cq->ibcq.cqe, &head); + if (unlikely(has_data == PVRDMA_INVALID_IDX)) + dev_err(&dev->pdev->dev, "CQ ring state invalid\n"); + } + + spin_unlock_irqrestore(&cq->cq_lock, flags); + + return has_data; } /** |