All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] ib/ehca: rework destroy_eq()
@ 2009-11-20  9:32 Alexander Schmidt
  2009-11-23 19:34   ` Roland Dreier
  2009-12-09 18:11   ` Roland Dreier
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Schmidt @ 2009-11-20  9:32 UTC (permalink / raw)
  To: Roland Dreier, Linux RDMA
  Cc: lkml, Stefan Roscher, Joachim Fenkes, Christoph Raisch, Hoang-Nam Nguyen

The ibmebus_free_irq() function, which might sleep, was called with
interrupts disabled. To ship around this, make sure that no interrupts
are running by killing the interrupt tasklet. Also lock the shca_list_lock to
protect against the poll_eqs_timer running concurrently.

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
---
Hi Roland,

seems like I used your old mail address and I forgot to add the linux-rdma
list.

Please apply this for your "next" tree, thanks.

 drivers/infiniband/hw/ehca/ehca_classes.h |    1 +
 drivers/infiniband/hw/ehca/ehca_eq.c      |    9 ++++++---
 drivers/infiniband/hw/ehca/ehca_main.c    |    2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

--- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_eq.c
+++ linux-2.6/drivers/infiniband/hw/ehca/ehca_eq.c
@@ -169,12 +169,15 @@ int ehca_destroy_eq(struct ehca_shca *sh
 	unsigned long flags;
 	u64 h_ret;

-	spin_lock_irqsave(&eq->spinlock, flags);
 	ibmebus_free_irq(eq->ist, (void *)shca);

-	h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq);
+	spin_lock_irqsave(&shca_list_lock, flags);
+	eq->is_initialized = 0;
+	spin_unlock_irqrestore(&shca_list_lock, flags);
+
+	tasklet_kill(&eq->interrupt_task);

-	spin_unlock_irqrestore(&eq->spinlock, flags);
+	h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq);

 	if (h_ret != H_SUCCESS) {
 		ehca_err(&shca->ib_device, "Can't free EQ resources.");
--- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_classes.h
+++ linux-2.6/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -375,6 +375,7 @@ extern rwlock_t ehca_qp_idr_lock;
 extern rwlock_t ehca_cq_idr_lock;
 extern struct idr ehca_qp_idr;
 extern struct idr ehca_cq_idr;
+extern spinlock_t shca_list_lock;

 extern int ehca_static_rate;
 extern int ehca_port_act_time;
--- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_main.c
+++ linux-2.6/drivers/infiniband/hw/ehca/ehca_main.c
@@ -123,7 +123,7 @@ DEFINE_IDR(ehca_qp_idr);
 DEFINE_IDR(ehca_cq_idr);

 static LIST_HEAD(shca_list); /* list of all registered ehcas */
-static DEFINE_SPINLOCK(shca_list_lock);
+DEFINE_SPINLOCK(shca_list_lock);

 static struct timer_list poll_eqs_timer;

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

* Re: [PATCH resend] ib/ehca: rework destroy_eq()
  2009-11-20  9:32 [PATCH resend] ib/ehca: rework destroy_eq() Alexander Schmidt
@ 2009-11-23 19:34   ` Roland Dreier
  2009-12-09 18:11   ` Roland Dreier
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2009-11-23 19:34 UTC (permalink / raw)
  To: Alexander Schmidt
  Cc: Linux RDMA, lkml, Stefan Roscher, Joachim Fenkes,
	Christoph Raisch, Hoang-Nam Nguyen


 > seems like I used your old mail address and I forgot to add the linux-rdma
 > list.

Yes... it didn't go onto patchwork so I missed it.  Will review and
apply, 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] 5+ messages in thread

* Re: [PATCH resend] ib/ehca: rework destroy_eq()
@ 2009-11-23 19:34   ` Roland Dreier
  0 siblings, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2009-11-23 19:34 UTC (permalink / raw)
  To: Alexander Schmidt
  Cc: Linux RDMA, lkml, Stefan Roscher, Joachim Fenkes,
	Christoph Raisch, Hoang-Nam Nguyen


 > seems like I used your old mail address and I forgot to add the linux-rdma
 > list.

Yes... it didn't go onto patchwork so I missed it.  Will review and
apply, thanks.

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

* Re: [PATCH resend] ib/ehca: rework destroy_eq()
  2009-11-20  9:32 [PATCH resend] ib/ehca: rework destroy_eq() Alexander Schmidt
@ 2009-12-09 18:11   ` Roland Dreier
  2009-12-09 18:11   ` Roland Dreier
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2009-12-09 18:11 UTC (permalink / raw)
  To: Alexander Schmidt
  Cc: Linux RDMA, lkml, Stefan Roscher, Joachim Fenkes,
	Christoph Raisch, Hoang-Nam Nguyen

thanks, applied
--
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] 5+ messages in thread

* Re: [PATCH resend] ib/ehca: rework destroy_eq()
@ 2009-12-09 18:11   ` Roland Dreier
  0 siblings, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2009-12-09 18:11 UTC (permalink / raw)
  To: Alexander Schmidt
  Cc: Linux RDMA, lkml, Stefan Roscher, Joachim Fenkes,
	Christoph Raisch, Hoang-Nam Nguyen

thanks, applied

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

end of thread, other threads:[~2009-12-09 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-20  9:32 [PATCH resend] ib/ehca: rework destroy_eq() Alexander Schmidt
2009-11-23 19:34 ` Roland Dreier
2009-11-23 19:34   ` Roland Dreier
2009-12-09 18:11 ` Roland Dreier
2009-12-09 18:11   ` 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.