From owner-freebsd-current@FreeBSD.ORG Thu Oct 23 14:32:56 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD20C255 for ; Thu, 23 Oct 2014 14:32:56 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 908E5E74 for ; Thu, 23 Oct 2014 14:32:56 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6BF121FE023; Thu, 23 Oct 2014 16:32:54 +0200 (CEST) Message-ID: <5449119B.8090401@selasky.org> Date: Thu, 23 Oct 2014 16:32:59 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Fabian Keil , FreeBSD Current Subject: Re: Panic after USB deadlock followed by kldunload umass.ko References: <03fafb9a.529c7f26@fabiankeil.de> In-Reply-To: <03fafb9a.529c7f26@fabiankeil.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2014 14:32:56 -0000 On 10/23/14 16:28, Fabian Keil wrote: > A few days ago a couple of usbconfig processed did not exit: > > fk@r500 ~ $sudo procstat -kk $(pgrep usbconfig) > PID TID COMM TDNAME KSTACK > 1624 100781 usbconfig - mi_switch+0xe1 sleepq_wait+0x3a _sx_xlock_hard+0x522 _sx_xlock+0x5d usbd_enum_lock+0x3a usb_ref_device+0x157 usb_open+0xbf devfs_open+0x122 VOP_OPEN_APV+0xa1 vn_open_vnode+0x234 vn_open_cred+0x351 kern_openat+0x26f amd64_syscall+0x3fb Xfast_syscall+0xfb > 1617 100779 usbconfig - mi_switch+0xe1 sleepq_wait+0x3a _sx_xlock_hard+0x522 _sx_xlock+0x5d usbd_enum_lock+0x3a usb_ref_device+0x157 usb_open+0xbf devfs_open+0x122 VOP_OPEN_APV+0xa1 vn_open_vnode+0x234 vn_open_cred+0x351 kern_openat+0x26f amd64_syscall+0x3fb Xfast_syscall+0xfb > 1615 100777 usbconfig - mi_switch+0xe1 sleepq_wait+0x3a _sx_xlock_hard+0x522 _sx_xlock+0x5d usbd_enum_lock+0x3a usb_ref_device+0x157 usb_open+0xbf devfs_open+0x122 VOP_OPEN_APV+0xa1 vn_open_vnode+0x234 vn_open_cred+0x351 kern_openat+0x26f amd64_syscall+0x3fb Xfast_syscall+0xfb > 1601 100774 usbconfig - mi_switch+0xe1 sleepq_timedwait+0x3a _sleep+0x294 pause_sbt+0xd0 usb_pause_mtx+0x85 usb_ioctl+0x3e7 devfs_ioctl_f+0x13b kern_ioctl+0x3cd sys_ioctl+0x13c amd64_syscall+0x3fb Xfast_syscall+0xfb > > kldunload umass.ko lead to a panic, dumping didn't work. > > Screenshots are available at: > http://www.fabiankeil.de/bilder/freebsd/kernel-panic-r273434-usb/ > > I've seen locked-up usbconfig processes in the past, > usually after executing a shell function that does: > > | usbconfig_output="$(sudo usbconfig -d ${device} add_quirk UQ_MSC_NO_INQUIRY)" > | [... error handling snipped ] > | usbconfig_output="$(sudo usbconfig -d ${device} reset)" > > Sometimes the second command seems to mess up the USB system. > > Fabian > Hi, USB detach is synchronous. If for example umass fails to detach, due to reference counts not reaching zero, that might be the root cause. Try to get a backtrace from the "usb_process()" processes using kgdb, and you'll see right away what is going on. Thank you! --HPS