From owner-svn-src-head@freebsd.org Fri Nov 10 17:01:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA59E721DF; Fri, 10 Nov 2017 17:01:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 69AF17AD86; Fri, 10 Nov 2017 17:01:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAAH1pNk093936; Fri, 10 Nov 2017 17:01:51 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAH1pZK093932; Fri, 10 Nov 2017 17:01:51 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201711101701.vAAH1pZK093932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 10 Nov 2017 17:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325667 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 325667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 10 Nov 2017 17:01:52 -0000 Author: scottl Date: Fri Nov 10 17:01:51 2017 New Revision: 325667 URL: https://svnweb.freebsd.org/changeset/base/325667 Log: Refactoring the interrupt setup code introduced a bug where the drivers would attempt to re-allocate interrupts during a chip reset without first de-allocating them. Doing that right is going to be tricky, so just band-aid it for now so that a re-init doesn't guarantee a failure due to resource re-use. Reported by: gallatin Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Fri Nov 10 15:28:17 2017 (r325666) +++ head/sys/dev/mpr/mpr.c Fri Nov 10 17:01:51 2017 (r325667) @@ -677,7 +677,11 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at return (error); } - if ((error = mpr_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mpr_pci_setup_interrupts(sc)) != 0) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Failed to setup interrupts\n"); mpr_free(sc); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Nov 10 15:28:17 2017 (r325666) +++ head/sys/dev/mps/mps.c Fri Nov 10 17:01:51 2017 (r325667) @@ -665,7 +665,11 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at return (error); } - if ((error = mps_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mps_pci_setup_interrupts(sc)) != 0) { mps_dprint(sc, MPS_INIT|MPS_FAULT, "Failed to setup " "interrupts\n"); mps_free(sc);