Patchwork [4/5] qlge: Fix schedule while atomic issue.

login
register
mail settings
Submitter Ron Mercer
Date Jan. 9, 2009, 9:31 p.m.
Message ID <1231536713-24538-4-git-send-email-ron.mercer@qlogic.com>
Download mbox | patch
Permalink /patch/17608/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ron Mercer - Jan. 9, 2009, 9:31 p.m.
There is no need to sleep while waiting for the hardware
semaphore to become available.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
 drivers/net/qlge/qlge_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
David Miller - Jan. 10, 2009, 7:11 a.m.
Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index e5a6238..e289423 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -126,12 +126,12 @@  static int ql_sem_trylock(struct ql_adapter *qdev, u32 sem_mask)
 
 int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask)
 {
-	unsigned int seconds = 3;
+	unsigned int wait_count = 30;
 	do {
 		if (!ql_sem_trylock(qdev, sem_mask))
 			return 0;
-		ssleep(1);
-	} while (--seconds);
+		udelay(100);
+	} while (--wait_count);
 	return -ETIMEDOUT;
 }