Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2017 17:01:51 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
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
Message-ID:  <201711101701.vAAH1pZK093932@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711101701.vAAH1pZK093932>