From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 15:34:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAF1D944; Sat, 7 Jun 2014 15:34:57 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14D942730; Sat, 7 Jun 2014 15:34:56 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id r20so2358506wiv.1 for ; Sat, 07 Jun 2014 08:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mTcwkeYutQVmxHqgLz0f9oZq7Plmc+CRicZcTxUU76Y=; b=PHjPm2mpLDGFJ7PUOC614GkfhbIuCZDxytLYTeFD0jACVxaMu80Dg6aTJOrVD/X0sO +9H7xuGmZgx4b3IxPVPuWPQWMjdztCfsxHSoXVbxOqdvrZkTZ4yICTJ0fPfMKnhFHq8z MJ/E3B7YoYOob5AW4s0vPSLXg/O5YpSrMW6YoVaK+B0KM8yJNUrsuCgO1t247hfusx+1 4IWpgldfPGUhF8HruavvYHyUaH0K0YaDt7PO89AYTJRERtrriOwhEMZ3nto2cQaXiYvT ChORHiFoKH2Glm8YdfrmoVswq69md7jrpSXsOduQqMsZnTHRIzN2f8hkMoHJtz9RhUC9 l+XQ== X-Received: by 10.14.204.73 with SMTP id g49mr2328017eeo.2.1402155295133; Sat, 07 Jun 2014 08:34:55 -0700 (PDT) Received: from localhost (93-77-155-216-ptr.volia-lviv.com. [93.77.155.216]) by mx.google.com with ESMTPSA id x3sm31095207een.17.2014.06.07.08.34.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jun 2014 08:34:54 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 7 Jun 2014 15:34:51 +0000 From: Mikolaj Golub To: Hans Petter Selasky Subject: Re: svn commit: r266394 - in head/sys/dev/usb: . controller Message-ID: <20140607153448.GA1566@gmail.com> References: <201405180913.s4I9DT3x044147@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405180913.s4I9DT3x044147@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:34:58 -0000 Hi, On Sun, May 18, 2014 at 09:13:29AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Sun May 18 09:13:29 2014 > New Revision: 266394 > URL: http://svnweb.freebsd.org/changeset/base/266394 > > Log: > - Add softc pointer argument to FIFO functions as an optimisation. > - Implement support for interrupt filters in the DWC OTG driver, to > reduce the amount of CPU task switching when only feeding the FIFOs. > - Add common spinlock to the USB bus structure. I observe panic on WITNESS enabled kernel: lock (xhci0) spin mutex does not match earlier (sleep mutex) lock. in _mtx_init() usb_bus_mem_alloc_all xchi_init xhci_pci_attach device_attach > > Modified: head/sys/dev/usb/controller/usb_controller.c > ============================================================================== > --- head/sys/dev/usb/controller/usb_controller.c Sun May 18 04:33:24 2014 (r266393) > +++ head/sys/dev/usb/controller/usb_controller.c Sun May 18 09:13:29 2014 (r266394) > @@ -901,6 +901,9 @@ usb_bus_mem_alloc_all(struct usb_bus *bu > mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), > NULL, MTX_DEF | MTX_RECURSE); > > + mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), > + NULL, MTX_SPIN | MTX_RECURSE); > + I think because sleep mutex bus_mtx and spin mutex bus_spin_lock are initilized with the same name here. The pacth below fixes the issue for me. Not sure about its correctnes, did not find quickly a good example in the source. Index: sys/dev/usb/controller/usb_controller.c =================================================================== --- sys/dev/usb/controller/usb_controller.c (revision 267176) +++ sys/dev/usb/controller/usb_controller.c (working copy) @@ -898,10 +898,10 @@ bus->alloc_failed = 0; mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), - NULL, MTX_DEF | MTX_RECURSE); + "bus_mtx", MTX_DEF | MTX_RECURSE); mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), - NULL, MTX_SPIN | MTX_RECURSE); + "bus_spin_lock", MTX_SPIN | MTX_RECURSE); usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); -- Mikolaj Golub