From owner-freebsd-usb@FreeBSD.ORG Thu Jun 13 20:23:27 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DEB28B94; Thu, 13 Jun 2013 20:23:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BAF5F1109; Thu, 13 Jun 2013 20:23:27 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 20DF3B984; Thu, 13 Jun 2013 16:23:27 -0400 (EDT) From: John Baldwin To: freebsd-amd64@freebsd.org Subject: Re: amd64/179376: xhci ehci irq storm Date: Thu, 13 Jun 2013 10:18:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201306110920.r5B9K1m4071258@freefall.freebsd.org> <51B7563D.20807@sviba.cz> <20130611174822.GR3047@kib.kiev.ua> In-Reply-To: <20130611174822.GR3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201306131018.30778.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 13 Jun 2013 16:23:27 -0400 (EDT) Cc: Konstantin Belousov , Michal Sviba , freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jun 2013 20:23:27 -0000 On Tuesday, June 11, 2013 1:48:22 pm Konstantin Belousov wrote: > --- a/sys/dev/usb/controller/xhci_pci.c > +++ b/sys/dev/usb/controller/xhci_pci.c > @@ -171,11 +170,22 @@ xhci_pci_attach(device_t self) > > usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); > > - rid = 0; > - sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, > - RF_SHAREABLE | RF_ACTIVE); > + sc->sc_irq_rid = 0; > + count = pci_msi_count(self); > + if (count >= 1) { > + if (count > 1) > + count = 1; You can just drop the if and always do the assignment here, yes? (Minor nit I know, and the original patch is fine for testing) -- John Baldwin