From a4bb51a4a28746c5f59dbf8c193b133c7bfa69af Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sun, 10 Sep 2017 07:10:40 +0000 Subject: [PATCH] Fix intrhook release in MPR and MPS for EARLY_AP_STARTUP. Reported by: Limelight Sponsored by: Netflix --- sys/dev/mpr/mpr.c | 5 +++++ sys/dev/mpr/mpr_sas.c | 6 ------ sys/dev/mps/mps.c | 5 +++++ sys/dev/mps/mps_sas.c | 5 ----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 0d83b4a2becd..b34630d955ba 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -1816,6 +1816,11 @@ mpr_startup(void *arg) mpr_mapping_initialize(sc); mprsas_startup(sc); mpr_unlock(sc); + + mpr_dprint(sc, MPR_INIT, "disestablish config intrhook\n"); + config_intrhook_disestablish(&sc->mpr_ich); + sc->mpr_ich.ich_arg = NULL; + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); } diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index 8b4d2915c411..c646eb1743d2 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -3829,12 +3829,6 @@ mprsas_portenable_complete(struct mpr_softc *sc, struct mpr_command *cm) mpr_dprint(sc, MPR_FAULT, "Portenable failed\n"); mpr_free_command(sc, cm); - if (sc->mpr_ich.ich_arg != NULL) { - mpr_dprint(sc, MPR_XINFO, "disestablish config intrhook\n"); - config_intrhook_disestablish(&sc->mpr_ich); - sc->mpr_ich.ich_arg = NULL; - } - /* * Done waiting for port enable to complete. Decrement the refcount. * If refcount is 0, discovery is complete and a rescan of the bus can diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 233eb0ddc232..7715a8bf0a4d 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -1673,6 +1673,11 @@ mps_startup(void *arg) mps_mapping_initialize(sc); mpssas_startup(sc); mps_unlock(sc); + + mps_dprint(sc, MPS_INIT, "disestablish config intrhook\n"); + config_intrhook_disestablish(&sc->mps_ich); + sc->mps_ich.ich_arg = NULL; + mps_dprint(sc, MPS_INIT, "%s exit\n", __func__); } diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index a1fe74348f45..6446b0ffba07 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -3557,11 +3557,6 @@ mpssas_portenable_complete(struct mps_softc *sc, struct mps_command *cm) mps_dprint(sc, MPS_FAULT, "Portenable failed\n"); mps_free_command(sc, cm); - if (sc->mps_ich.ich_arg != NULL) { - mps_dprint(sc, MPS_XINFO, "disestablish config intrhook\n"); - config_intrhook_disestablish(&sc->mps_ich); - sc->mps_ich.ich_arg = NULL; - } /* * Get WarpDrive info after discovery is complete but before the scan