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
This commit is contained in:
Scott Long 2017-11-10 17:01:51 +00:00
parent 72130735d8
commit 1069541760
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325667
2 changed files with 10 additions and 2 deletions

View File

@ -677,7 +677,11 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t attaching)
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);

View File

@ -665,7 +665,11 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching)
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);