summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/mr.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 12:27:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 12:27:35 +0200
commitb24d0d5b12a678b96676348976982686fbe222b4 (patch)
tree565ce37d2d971cb94436241bc2ac48028b6b66d0 /drivers/infiniband/sw/rdmavt/mr.c
parenteeprom: at24: use SPDX identifier instead of GPL boiler-plate (diff)
parentLinux 4.16-rc7 (diff)
downloadlinux-b24d0d5b12a678b96676348976982686fbe222b4.tar.xz
linux-b24d0d5b12a678b96676348976982686fbe222b4.zip
Merge 4.16-rc7 into char-misc-next
We want the hyperv fix in here for merging and testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/mr.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/mr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c
index 1b2e5362a3ff..cc429b567d0a 100644
--- a/drivers/infiniband/sw/rdmavt/mr.c
+++ b/drivers/infiniband/sw/rdmavt/mr.c
@@ -489,11 +489,13 @@ static int rvt_check_refs(struct rvt_mregion *mr, const char *t)
unsigned long timeout;
struct rvt_dev_info *rdi = ib_to_rvt(mr->pd->device);
- if (percpu_ref_is_zero(&mr->refcount))
- return 0;
- /* avoid dma mr */
- if (mr->lkey)
+ if (mr->lkey) {
+ /* avoid dma mr */
rvt_dereg_clean_qps(mr);
+ /* @mr was indexed on rcu protected @lkey_table */
+ synchronize_rcu();
+ }
+
timeout = wait_for_completion_timeout(&mr->comp, 5 * HZ);
if (!timeout) {
rvt_pr_err(rdi,