All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/qib: fix sparse RCU warnings in qib_keys.c
@ 2012-07-06 18:29 Mike Marciniszyn
       [not found] ` <20120706182944.20779.28432.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Marciniszyn @ 2012-07-06 18:29 UTC (permalink / raw)
  To: roland-BHEL68pLQRGGvPXPguhicg
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, wfg-VuQAYsv1563Yd54FQh9/CA

Commit e12deda1 ("IB/qib: RCU locking for MR validation") introduced
new sparse warnings in qib_keys.c.

This patch resolved those issues.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/qib/qib_keys.c  |    4 +++-
 drivers/infiniband/hw/qib/qib_verbs.h |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c
index 970165b..e9486c7 100644
--- a/drivers/infiniband/hw/qib/qib_keys.c
+++ b/drivers/infiniband/hw/qib/qib_keys.c
@@ -349,7 +349,9 @@ int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *wr)
 	if (pd->user || rkey == 0)
 		goto bail;
 
-	mr = rkt->table[(rkey >> (32 - ib_qib_lkey_table_size))];
+	mr = rcu_dereference_protected(
+		rkt->table[(rkey >> (32 - ib_qib_lkey_table_size))],
+		lockdep_is_held(&rkt->lock));
 	if (unlikely(mr == NULL || qp->ibqp.pd != mr->pd))
 		goto bail;
 
diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h
index cffeabb..319368e 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.h
+++ b/drivers/infiniband/hw/qib/qib_verbs.h
@@ -650,7 +650,7 @@ struct qib_lkey_table {
 	u32 next;               /* next unused index (speeds search) */
 	u32 gen;                /* generation count */
 	u32 max;                /* size of the table */
-	struct qib_mregion **table;
+	struct qib_mregion __rcu **table;
 };
 
 struct qib_opcode_stats {
@@ -733,7 +733,7 @@ struct qib_ibdev {
 	struct list_head pending_mmaps;
 	spinlock_t mmap_offset_lock; /* protect mmap_offset */
 	u32 mmap_offset;
-	struct qib_mregion *dma_mr;
+	struct qib_mregion __rcu *dma_mr;
 
 	/* QP numbers are shared by all IB ports */
 	struct qib_qpn_table qpn_table;


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/qib: fix sparse RCU warnings in qib_keys.c
       [not found] ` <20120706182944.20779.28432.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
@ 2012-07-07  0:33   ` Fengguang Wu
  2012-07-10 17:03   ` Roland Dreier
  1 sibling, 0 replies; 3+ messages in thread
From: Fengguang Wu @ 2012-07-07  0:33 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: roland-BHEL68pLQRGGvPXPguhicg, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Dan Carpenter

On Fri, Jul 06, 2012 at 02:29:45PM -0400, Mike Marciniszyn wrote:
> Commit e12deda1 ("IB/qib: RCU locking for MR validation") introduced
> new sparse warnings in qib_keys.c.
> 
> This patch resolved those issues.

It's better than my initial version, thanks!

Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

> Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/qib/qib_keys.c  |    4 +++-
>  drivers/infiniband/hw/qib/qib_verbs.h |    4 ++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/qib: fix sparse RCU warnings in qib_keys.c
       [not found] ` <20120706182944.20779.28432.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
  2012-07-07  0:33   ` Fengguang Wu
@ 2012-07-10 17:03   ` Roland Dreier
  1 sibling, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2012-07-10 17:03 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, wfg-VuQAYsv1563Yd54FQh9/CA

applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-10 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 18:29 [PATCH] IB/qib: fix sparse RCU warnings in qib_keys.c Mike Marciniszyn
     [not found] ` <20120706182944.20779.28432.stgit-hIFRcJ1SNwcXGO8/Qfapyjg/wwJxntczYPYVAmT7z5s@public.gmane.org>
2012-07-07  0:33   ` Fengguang Wu
2012-07-10 17:03   ` Roland Dreier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.