Message ID | 1245424412-15106-1-git-send-email-jirislaby@gmail.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
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! -- 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
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);
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(-)