From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934372AbXGWXN5 (ORCPT ); Mon, 23 Jul 2007 19:13:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933261AbXGWXN1 (ORCPT ); Mon, 23 Jul 2007 19:13:27 -0400 Received: from mx1.suse.de ([195.135.220.2]:40391 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932432AbXGWXNY (ORCPT ); Mon, 23 Jul 2007 19:13:24 -0400 Date: Mon, 23 Jul 2007 15:57:25 -0700 From: Greg KH To: Alan Stern , Oliver Neukum Cc: Jeremy Fitzhardinge , Kevin Lloyd , Linux Kernel Mailing List , USB development list 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 Message-ID: <20070723225725.GA25741@suse.de> References: <46A50CB5.5020006@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-06) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.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: [] usb_serial_put+0x13/0x2c [usbserial] > > [] show_trace_log_lvl+0x1a/0x2f > > [] show_trace+0x12/0x14 > > [] dump_stack+0x16/0x18 > > [] __might_sleep+0xea/0xf1 > > [] usb_kill_urb+0x1a/0xc7 > > [] sierra_shutdown+0x5d/0x9c [sierra] > > [] destroy_serial+0x45/0x10a [usbserial] > > [] kref_put+0x63/0x71 > > [] usb_serial_put+0x1f/0x2c [usbserial] > > [] usb_serial_disconnect+0x79/0xa6 [usbserial] > > [] usb_unbind_interface+0x47/0x98 > > [] __device_release_driver+0x74/0x90 > > [] device_release_driver+0x30/0x47 > > [] bus_remove_device+0x73/0x82 > > [] device_del+0x208/0x27e > > [] usb_disable_device+0x5f/0xbc > > [] usb_disconnect+0x95/0x12f > > [] hub_thread+0x377/0xa57 > > [] kthread+0x3b/0x64 > > [] 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