All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>, Oliver Neukum <oneukum@suse.de>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Kevin Lloyd <linux@sierrawireless.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	USB development list <linux-usb-devel@lists.sourceforge.net>
Subject: Re: [linux-usb-devel] 2.6.22+: BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0
Date: Mon, 23 Jul 2007 15:57:25 -0700	[thread overview]
Message-ID: <20070723225725.GA25741@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0707231649200.2702-100000@iolanthe.rowland.org>

On Mon, Jul 23, 2007 at 04:50:50PM -0400, Alan Stern wrote:
> On Mon, 23 Jul 2007, Jeremy Fitzhardinge wrote:
> 
> > I get this when suspending.  The kernel is 2.6.22+recent git (just before -rc1).
> > 
> > usb 2-1: USB disconnect, address 3
> > BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524
> > in_atomic():1, irqs_disabled():0
> > 1 lock held by khubd/207:
> >  #0:  (&table_lock){--..}, at: [<f89fba38>] usb_serial_put+0x13/0x2c [usbserial]
> >  [<c0109162>] show_trace_log_lvl+0x1a/0x2f
> >  [<c0109bf8>] show_trace+0x12/0x14
> >  [<c0109c10>] dump_stack+0x16/0x18
> >  [<c01247b7>] __might_sleep+0xea/0xf1
> >  [<c02cd7a2>] usb_kill_urb+0x1a/0xc7
> >  [<f89e7203>] sierra_shutdown+0x5d/0x9c [sierra]
> >  [<f89fbb5a>] destroy_serial+0x45/0x10a [usbserial]
> >  [<c0219a2f>] kref_put+0x63/0x71
> >  [<f89fba44>] usb_serial_put+0x1f/0x2c [usbserial]
> >  [<f89fbf00>] usb_serial_disconnect+0x79/0xa6 [usbserial]
> >  [<c02d06df>] usb_unbind_interface+0x47/0x98
> >  [<c02925f2>] __device_release_driver+0x74/0x90
> >  [<c02929e0>] device_release_driver+0x30/0x47
> >  [<c0291f81>] bus_remove_device+0x73/0x82
> >  [<c0290650>] device_del+0x208/0x27e
> >  [<c02cdf2a>] usb_disable_device+0x5f/0xbc
> >  [<c02ca497>] usb_disconnect+0x95/0x12f
> >  [<c02caba8>] hub_thread+0x377/0xa57
> >  [<c013cb7f>] kthread+0x3b/0x64
> >  [<c0108d27>] kernel_thread_helper+0x7/0x10
> >  =======================
> > sierra3 ttyUSB0: Sierra USB modem (3 port) converter now disconnected from ttyUSB0
> > sierra3 ttyUSB1: Sierra USB modem (3 port) converter now disconnected from ttyUSB1
> > sierra3 ttyUSB2: Sierra USB modem (3 port) converter now disconnected from ttyUSB2
> > sierra 2-1:1.0: device disconnected
> 
> Clearly there's a bug in 
> drivers/usb/serial/usb-serial.c:usb_serial_put().  It shouldn't call 
> kref_put() while holding a spinlock.

Oliver, didn't you make this change to the usb_serial_put() function?

Do we need to audit the shutdown() callbacks in the serial drivers so
that they can not sleep?  Or just change the spinlock to a mutex?

thanks,

greg k-h

  reply	other threads:[~2007-07-23 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 20:16 2.6.22+: BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524,in_atomic():1, irqs_disabled():0 Jeremy Fitzhardinge
2007-07-23 20:50 ` [linux-usb-devel] 2.6.22+: BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0 Alan Stern
2007-07-23 22:57   ` Greg KH [this message]
2007-07-24  8:06   ` Oliver Neukum
2007-07-24 13:13   ` Oliver Neukum
2007-07-30 19:13     ` patch usb-fix-bug-sleeping-function-called-from-invalid-context-at-home-jeremy-hg-xen-paravirt-linux-drivers-usb-core-urb.c-524-in_atomic-1-irqs_disabled-0.patch added to gregkh-2.6 tree gregkh

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=20070723225725.GA25741@suse.de \
    --to=gregkh@suse.de \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=linux@sierrawireless.com \
    --cc=oneukum@suse.de \
    --cc=stern@rowland.harvard.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.