Re: [PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held

2007-01-25 Thread Christoph Hellwig
On Wed, Jan 24, 2007 at 12:10:36AM +0100, Hoang-Nam Nguyen wrote:
> Here is a patch for ehca_cq.c that fixes improper use of yield
> with spinlock held.

Btw, please don't forget to replace the yield call with a proper
condition for 2.6.21.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held

2007-01-25 Thread Christoph Hellwig
On Wed, Jan 24, 2007 at 12:10:36AM +0100, Hoang-Nam Nguyen wrote:
 Here is a patch for ehca_cq.c that fixes improper use of yield
 with spinlock held.

Btw, please don't forget to replace the yield call with a proper
condition for 2.6.21.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held

2007-01-23 Thread Hoang-Nam Nguyen
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 <[EMAIL PROTECTED]>
---


 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.c2007-01-19 
19:40:32.0 +0100
+++ infiniband_work/drivers/infiniband/hw/ehca/ehca_cq.c2007-01-20 
00:15:34.0 +0100
@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq)
unsigned long flags;
 
spin_lock_irqsave(_cq_idr_lock, flags);
-   while (my_cq->nr_callbacks)
+   while (my_cq->nr_callbacks) {
+   spin_unlock_irqrestore(_cq_idr_lock, flags);
yield();
+   spin_lock_irqsave(_cq_idr_lock, flags);
+   }
 
idr_remove(_cq_idr, my_cq->token);
spin_unlock_irqrestore(_cq_idr_lock, flags);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.21 1/4] ehca: fix improper use of yield with spinlock held

2007-01-23 Thread Hoang-Nam Nguyen
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 [EMAIL PROTECTED]
---


 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.c2007-01-19 
19:40:32.0 +0100
+++ infiniband_work/drivers/infiniband/hw/ehca/ehca_cq.c2007-01-20 
00:15:34.0 +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);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/