lkml.org 
[lkml]   [2009]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] Net: qla3xxx, remove sleeping in atomic
Date
Hi, we've found this sleep-inside-spinlock.

The fix below totally untested, please review carefully.

--

We cannot sleep in ql_reset_work under spinlock, unlock before sleep,
relock after.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/net/qla3xxx.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 8a823ec..bbc6d4d 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3837,7 +3837,9 @@ static void ql_reset_work(struct work_struct *work)
16) | ISP_CONTROL_RI));
}

+ spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
ssleep(1);
+ spin_lock_irqsave(&qdev->hw_lock, hw_flags);
} while (--max_wait_time);
spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);

--
1.6.3.2
caught by stanse

\
 
 \ /
  Last update: 2009-06-19 17:17    [W:0.046 / U:1.056 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site