linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: <balbi@ti.com>, Vivek Gautam <gautam.vivek@samsung.com>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: sleeping while atomic in dwc3_gadget_start
Date: Mon, 1 Jul 2013 15:16:59 +0300	[thread overview]
Message-ID: <20130701121659.GE28300@arwen.pp.htv.fi> (raw)
In-Reply-To: <51CE4038.5000905@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]

On Fri, Jun 28, 2013 at 07:02:32PM -0700, Stephen Boyd wrote:
> On 06/28/13 03:58, Felipe Balbi wrote:
> > Hi,
> >
> > On Thu, Jun 27, 2013 at 09:57:52AM -0700, Stephen Boyd wrote:
> >> On 06/26/13 23:58, Felipe Balbi wrote:
> >>> On Wed, Jun 26, 2013 at 02:52:56PM -0700, Stephen Boyd wrote:
> >>>> Hi,
> >>>>
> >>>> I'm getting the folllowing BUG message on bootup with 3.10-rc5
> >>>>
> >>>> BUG: sleeping function called from invalid context at mm/slub.c:926
> >>>> in_atomic(): 1, irqs_disabled(): 128, pid: 1, name: swapper/0
> >>>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc5-gee3e35b-09316-ge78f3b35 #643
> >>>> [<c0014220>] (unwind_backtrace+0x0/0x120) from [<c001212c>] (show_stack+0x10/0x14)
> >>>> [<c001212c>] (show_stack+0x10/0x14) from [<c0143750>] (kmem_cache_alloc_trace+0x3c/0x210)
> >>>> [<c0143750>] (kmem_cache_alloc_trace+0x3c/0x210) from [<c00e0c60>] (request_threaded_irq+0x88/0x11c)
> >>>> [<c00e0c60>] (request_threaded_irq+0x88/0x11c) from [<c03bf53c>] (dwc3_gadget_start+0x198/0x200)
> >>>> [<c03bf53c>] (dwc3_gadget_start+0x198/0x200) from [<c03f7a5c>] (udc_bind_to_driver+0x70/0xd8)
> >>>> [<c03f7a5c>] (udc_bind_to_driver+0x70/0xd8) from [<c03f7b50>] (usb_gadget_probe_driver+0x8c/0xb8)
> >>>>
> >>>> and I suspect this problem was introduced in commit 8698e2acf
> >>>> (usb: dwc3: gadget: introduce and use enable/disable irq
> >>>> methods). Is there a fix for this problem? Can we just move the
> >>>> irq request outside the spinlock?
> >>> nice :-)
> >>>
> >>> how about this ?
> >> If start fails do you call stop? I believe the answer is no, so we'll
> >> need to free_irq() somewhere along the error path. Or we can request it
> >> after the spin_unlock()?
> > good point here's v2:
> 
> Ok looks good to me. I hope that platform_get_irq() doesn't fail,
> otherwise we're in for a nasty surprise. Maybe we should add a check in
> request_irq() for that case.

I don't think we would ever fall into that situation. And if we do, our
data (struct resource or DT) is f-ed up anyway :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2013-07-01 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 21:52 sleeping while atomic in dwc3_gadget_start Stephen Boyd
2013-06-27  6:58 ` Felipe Balbi
2013-06-27 16:57   ` Stephen Boyd
2013-06-28 10:58     ` Felipe Balbi
2013-06-29  2:02       ` Stephen Boyd
2013-07-01 12:16         ` Felipe Balbi [this message]

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=20130701121659.GE28300@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=gautam.vivek@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    /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;
as well as URLs for NNTP newsgroup(s).