diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_keys.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_keys.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c index 851763d7d2db..dd487c100f5b 100644 --- a/drivers/infiniband/hw/ipath/ipath_keys.c +++ b/drivers/infiniband/hw/ipath/ipath_keys.c | |||
@@ -61,7 +61,7 @@ int ipath_alloc_lkey(struct ipath_lkey_table *rkt, struct ipath_mregion *mr) | |||
61 | r = (r + 1) & (rkt->max - 1); | 61 | r = (r + 1) & (rkt->max - 1); |
62 | if (r == n) { | 62 | if (r == n) { |
63 | spin_unlock_irqrestore(&rkt->lock, flags); | 63 | spin_unlock_irqrestore(&rkt->lock, flags); |
64 | ipath_dbg(KERN_INFO "LKEY table full\n"); | 64 | ipath_dbg("LKEY table full\n"); |
65 | ret = 0; | 65 | ret = 0; |
66 | goto bail; | 66 | goto bail; |
67 | } | 67 | } |
@@ -133,6 +133,12 @@ int ipath_lkey_ok(struct ipath_qp *qp, struct ipath_sge *isge, | |||
133 | * being reversible by calling bus_to_virt(). | 133 | * being reversible by calling bus_to_virt(). |
134 | */ | 134 | */ |
135 | if (sge->lkey == 0) { | 135 | if (sge->lkey == 0) { |
136 | struct ipath_pd *pd = to_ipd(qp->ibqp.pd); | ||
137 | |||
138 | if (pd->user) { | ||
139 | ret = 0; | ||
140 | goto bail; | ||
141 | } | ||
136 | isge->mr = NULL; | 142 | isge->mr = NULL; |
137 | isge->vaddr = (void *) sge->addr; | 143 | isge->vaddr = (void *) sge->addr; |
138 | isge->length = sge->length; | 144 | isge->length = sge->length; |
@@ -206,6 +212,12 @@ int ipath_rkey_ok(struct ipath_qp *qp, struct ipath_sge_state *ss, | |||
206 | * (see ipath_get_dma_mr and ipath_dma.c). | 212 | * (see ipath_get_dma_mr and ipath_dma.c). |
207 | */ | 213 | */ |
208 | if (rkey == 0) { | 214 | if (rkey == 0) { |
215 | struct ipath_pd *pd = to_ipd(qp->ibqp.pd); | ||
216 | |||
217 | if (pd->user) { | ||
218 | ret = 0; | ||
219 | goto bail; | ||
220 | } | ||
209 | sge->mr = NULL; | 221 | sge->mr = NULL; |
210 | sge->vaddr = (void *) vaddr; | 222 | sge->vaddr = (void *) vaddr; |
211 | sge->length = len; | 223 | sge->length = len; |