Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mrsas/mrsas.c
Show First 20 Lines • Show All 1,176 Lines • ▼ Show 20 Lines | bus_release_resource(sc->mrsas_dev, | ||||
SYS_RES_MEMORY, sc->reg_res_id, sc->reg_res); | SYS_RES_MEMORY, sc->reg_res_id, sc->reg_res); | ||||
} | } | ||||
if (sc->sysctl_tree != NULL) | if (sc->sysctl_tree != NULL) | ||||
sysctl_ctx_free(&sc->sysctl_ctx); | sysctl_ctx_free(&sc->sysctl_ctx); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | |||||
mrsas_shutdown(device_t dev) | |||||
{ | |||||
struct mrsas_softc *sc; | |||||
int i; | |||||
sc = device_get_softc(dev); | |||||
sc->remove_in_progress = 1; | |||||
if (panicstr == NULL) { | |||||
if (sc->ocr_thread_active) | |||||
wakeup(&sc->ocr_chan); | |||||
i = 0; | |||||
while (sc->reset_in_progress && panicstr) { | |||||
imp: is there an upper bound here? And why only for panicstr != NULL? I get it's only while we're… | |||||
avgAuthorUnsubmitted Done Inline ActionsI copied this code verbatim from mrsas_detach, so there is no upper limit in both places. And it's actually the other way around, we do this only when we are not panic-ing. This code wakes another thread and waits for it to clear a flag. But the other thread, of course, cannot run if we are in panic. avg: I copied this code verbatim from mrsas_detach, so there is no upper limit in both places.
And… | |||||
impUnsubmitted Not Done Inline ActionsI'm glad to see you got rid of the panicstr here, that's what I was really commenting about. imp: I'm glad to see you got rid of the panicstr here, that's what I was really commenting about. | |||||
avgAuthorUnsubmitted Done Inline ActionsI was so sure that I removed it that I just didn't see it. avg: I was so sure that I removed it that I just didn't see it. | |||||
i++; | |||||
if ((i % MRSAS_RESET_NOTICE_INTERVAL) == 0) { | |||||
Not Done Inline ActionsThis can be done with pps_ratecheck() instead. scottl: This can be done with pps_ratecheck() instead. | |||||
mrsas_dprint(sc, MRSAS_INFO, | |||||
"[%2d]waiting for OCR to be finished " | |||||
"from %s\n", i, __func__); | |||||
} | |||||
pause("mr_shutdown", hz); | |||||
} | |||||
} | |||||
mrsas_flush_cache(sc); | |||||
mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); | |||||
Not Done Inline ActionsThis isn't incorrect, but I'm not comfortable with mesas_shutdown_ctlr() having an unbounded timeout. scottl: This isn't incorrect, but I'm not comfortable with `mesas_shutdown_ctlr()` having an unbounded… | |||||
mrsas_disable_intr(sc); | |||||
return (0); | |||||
} | |||||
/* | /* | ||||
* mrsas_free_mem: Frees allocated memory | * mrsas_free_mem: Frees allocated memory | ||||
* input: Adapter instance soft state | * input: Adapter instance soft state | ||||
* | * | ||||
* This function is called from mrsas_detach() to free previously allocated | * This function is called from mrsas_detach() to free previously allocated | ||||
* memory. | * memory. | ||||
*/ | */ | ||||
void | void | ||||
▲ Show 20 Lines • Show All 3,830 Lines • ▼ Show 20 Lines | mrsas_complete_aen(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) | ||||
return; | return; | ||||
} | } | ||||
static device_method_t mrsas_methods[] = { | static device_method_t mrsas_methods[] = { | ||||
DEVMETHOD(device_probe, mrsas_probe), | DEVMETHOD(device_probe, mrsas_probe), | ||||
DEVMETHOD(device_attach, mrsas_attach), | DEVMETHOD(device_attach, mrsas_attach), | ||||
DEVMETHOD(device_detach, mrsas_detach), | DEVMETHOD(device_detach, mrsas_detach), | ||||
DEVMETHOD(device_shutdown, mrsas_shutdown), | |||||
DEVMETHOD(device_suspend, mrsas_suspend), | DEVMETHOD(device_suspend, mrsas_suspend), | ||||
DEVMETHOD(device_resume, mrsas_resume), | DEVMETHOD(device_resume, mrsas_resume), | ||||
DEVMETHOD(bus_print_child, bus_generic_print_child), | DEVMETHOD(bus_print_child, bus_generic_print_child), | ||||
DEVMETHOD(bus_driver_added, bus_generic_driver_added), | DEVMETHOD(bus_driver_added, bus_generic_driver_added), | ||||
{0, 0} | {0, 0} | ||||
}; | }; | ||||
static driver_t mrsas_driver = { | static driver_t mrsas_driver = { | ||||
Show All 9 Lines |
is there an upper bound here? And why only for panicstr != NULL? I get it's only while we're panicing, but why do we have to do this when we panic and not otherwise.