From owner-freebsd-stable@FreeBSD.ORG Thu Aug 18 21:27:27 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E07E21065674; Thu, 18 Aug 2011 21:27:27 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 31E8B8FC16; Thu, 18 Aug 2011 21:27:26 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=yfIOS+81wnQIz0UwZPDdWOvE/jQxEvyI9Z1xC25I9wc= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=EPV5yV1zpIAA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=oOb7PSFi1HuzztIfN6YA:9 a=XpotWNjDgNPmgIl742UA:7 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 168437914; Thu, 18 Aug 2011 23:27:25 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Thu, 18 Aug 2011 23:24:58 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4E4D460A.2080100@FreeBSD.org> In-Reply-To: <4E4D460A.2080100@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108182324.58276.hselasky@c2i.net> Cc: freebsd-stable@freebsd.org, Eugene Grosbein , Andrew Boyer , Vishal.Shah@netapp.com, Jeremiah Lott , Steven Hartland Subject: Re: USB/coredump hangs in 8 and 9 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2011 21:27:28 -0000 On Thursday 18 August 2011 19:04:10 Andriy Gapon wrote: > If you can help Hans to figure out what you is wrong with USB subsystem in > this respect that would help us all. Hi, usb_busdma.c: /* we use "mtx_owned()" instead of this function */ usb_busdma.c: owned = mtx_owned(uptag->mtx); usb_compat_linux.c: do_unlock = mtx_owned(&Giant) ? 0 : 1; usb_compat_linux.c: do_unlock = mtx_owned(&Giant) ? 0 : 1; usb_compat_linux.c: do_unlock = mtx_owned(&Giant) ? 0 : 1; usb_hub.c: if (mtx_owned(&bus->bus_mtx)) { usb_transfer.c: if (!mtx_owned(info->xfer_mtx)) { usb_transfer.c: if (mtx_owned(xfer->xroot->xfer_mtx)) { usb_transfer.c: while (mtx_owned(&xroot->udev->bus->bus_mtx)) { usb_transfer.c: while (mtx_owned(xroot->xfer_mtx)) { One fix you will need to do, if mtx_owned is not giving correct value is: static void usbd_callback_wrapper(struct usb_xfer_queue *pq) { struct usb_xfer *xfer = pq->curr; struct usb_xfer_root *info = xfer->xroot; USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED); if (!mtx_owned(info->xfer_mtx)) { The above "if" should be anded with && !paniced && !dumping ... or maybe the new not scheduling variable is good for this purpose? /* * Cases that end up here: * #if USB_HAVE_BUSDMA if (mtx_owned(xfer->xroot->xfer_mtx)) { struct usb_xfer_queue *pq; This case is more like a BUS-DMA error case, and is not so important to execute. --HPS