Net: qla3xxx, remove sleeping in atomic
Subsystems (2)
PATCH 1/1 Net: qla3xxx, remove sleeping in atomic
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 <[email protected]>
--- drivers/net/qla3xxx.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/qla3xxx.c +2 -0
@@ -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);
Signature · 2 lines
1.6.3.2 caught by stanse
From: Jiri Slaby <[email protected]>
Date: Fri, 19 Jun 2009 17:13:32 +0200
Quoted 10 lines
Hi, we've found this sleep-inside-spinlock.
The fix below totally untested, please review carefully.
--
We cannot sleep in
ql_reset_workunder spinlock, unlock before sleep, relock after.Signed-off-by Jiri Slaby <[email protected]>
This looks good. The spinlock is just required to be held around the register accesses. It's going to drop the lock as soon as the bits settle post-reset anyways and then the driver goes off and modifies other state outside of the lock.
Applied, thanks!