summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/cq.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-03-28 10:34:19 +0300
committerDave Airlie <airlied@redhat.com>2017-03-28 10:34:19 +0300
commite5c1ff14757afe21733ddee9cc4bbaeaeadbf803 (patch)
tree0da1c9aaf772fac30fe68590a4ca1c3dd439cebd /drivers/infiniband/core/cq.c
parent65d1086c44791112188f6aebbdc3a27cab3736d3 (diff)
parentc02ed2e75ef4c74e41e421acb4ef1494671585e8 (diff)
downloadlinux-e5c1ff14757afe21733ddee9cc4bbaeaeadbf803.tar.xz
Backmerge tag 'v4.11-rc4' into drm-next
Linux 4.11-rc4 The i915 GVT team need the rc4 code to base some more code on.
Diffstat (limited to 'drivers/infiniband/core/cq.c')
-rw-r--r--drivers/infiniband/core/cq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index e95510117a6d..f2ae75fa3128 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -29,7 +29,13 @@ static int __ib_process_cq(struct ib_cq *cq, int budget)
{
int i, n, completed = 0;
- while ((n = ib_poll_cq(cq, IB_POLL_BATCH, cq->wc)) > 0) {
+ /*
+ * budget might be (-1) if the caller does not
+ * want to bound this call, thus we need unsigned
+ * minimum here.
+ */
+ while ((n = ib_poll_cq(cq, min_t(u32, IB_POLL_BATCH,
+ budget - completed), cq->wc)) > 0) {
for (i = 0; i < n; i++) {
struct ib_wc *wc = &cq->wc[i];
@@ -196,7 +202,7 @@ void ib_free_cq(struct ib_cq *cq)
irq_poll_disable(&cq->iop);
break;
case IB_POLL_WORKQUEUE:
- flush_work(&cq->work);
+ cancel_work_sync(&cq->work);
break;
default:
WARN_ON_ONCE(1);