From: Greg KH <gregkh@suse.de>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: wfp5p@virginia.edu, linux-kernel@vger.kernel.org
Subject: Re: Staging: serqt_usb2: kmalloc(GFP_NOIO) with spinlock held in qt_break() and qt_tiocmset()
Date: Fri, 5 Aug 2011 08:17:47 -0700 [thread overview]
Message-ID: <20110805151747.GB18527@suse.de> (raw)
In-Reply-To: <4E3BFF9E.9060504@ispras.ru>
On Fri, Aug 05, 2011 at 06:35:10PM +0400, Alexey Khoroshilov wrote:
> qt_break() calls usb_control_msg() with spinlock held,
Ick, not good, that will sleep.
> while usb_control_msg() calls kmalloc(GFP_NOIO) and indirectly usb_alloc_urb(GFP_NOIO).
You forgot the obvious call to wait_for_completion_timeout() in the
usb_control_msg() callchain that shows that a spinlock is not a good
thing to be using here :)
> The same is true for qt_tiocmget() and qt_tiocmset().
>
> Is replacing spinlock with mutex an appropriate solution to fix the issue?
Yes, it sounds like it.
patches gladly accepted.
thanks,
greg k-h
next prev parent reply other threads:[~2011-08-05 15:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-05 14:35 Alexey Khoroshilov
2011-08-05 15:17 ` Greg KH [this message]
2011-08-09 6:23 ` [PATCH] Staging: serqt_usb2: fix sleeping with spinlock held Alexey Khoroshilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110805151747.GB18527@suse.de \
--to=gregkh@suse.de \
--cc=khoroshilov@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®