LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held
@ 2007-01-23 23:10 Hoang-Nam Nguyen
  2007-01-26  2:50 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Hoang-Nam Nguyen @ 2007-01-23 23:10 UTC (permalink / raw)
  To: Roland Dreier, hch, linux-kernel, linuxppc-dev, openib-general,
	openfabrics-ewg
  Cc: raisch

Here is a patch for ehca_cq.c that fixes improper use of yield
with spinlock held.
Thanks
Nam


Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
---


 ehca_cq.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


diff -Nurp infiniband_orig/drivers/infiniband/hw/ehca/ehca_cq.c infiniband_work/drivers/infiniband/hw/ehca/ehca_cq.c
--- infiniband_orig/drivers/infiniband/hw/ehca/ehca_cq.c	2007-01-19 19:40:32.000000000 +0100
+++ infiniband_work/drivers/infiniband/hw/ehca/ehca_cq.c	2007-01-20 00:15:34.000000000 +0100
@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq)
 	unsigned long flags;
 
 	spin_lock_irqsave(&ehca_cq_idr_lock, flags);
-	while (my_cq->nr_callbacks)
+	while (my_cq->nr_callbacks) {
+		spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
 		yield();
+		spin_lock_irqsave(&ehca_cq_idr_lock, flags);
+	}
 
 	idr_remove(&ehca_cq_idr, my_cq->token);
 	spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);

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

end of thread, other threads:[~2007-01-26  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 23:10 [PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held Hoang-Nam Nguyen
2007-01-26  2:50 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).