* [PATCH 1/1] Net: qla3xxx, remove sleeping in atomic
@ 2009-06-19 15:13 Jiri Slaby
2009-06-20 8:21 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-06-19 15:13 UTC (permalink / raw)
To: linux-driver; +Cc: davem, netdev, linux-kernel, Jiri Slaby
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] Net: qla3xxx, remove sleeping in atomic
2009-06-19 15:13 [PATCH 1/1] Net: qla3xxx, remove sleeping in atomic Jiri Slaby
@ 2009-06-20 8:21 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-06-20 8:21 UTC (permalink / raw)
To: jirislaby; +Cc: linux-driver, netdev, linux-kernel
From: Jiri Slaby <jirislaby@gmail.com>
Date: Fri, 19 Jun 2009 17:13:32 +0200
> 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>
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!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-20 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19 15:13 [PATCH 1/1] Net: qla3xxx, remove sleeping in atomic Jiri Slaby
2009-06-20 8:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®