Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_ctrlr.c
Show First 20 Lines • Show All 1,129 Lines • ▼ Show 20 Lines | nvme_ctrlr_start_config_hook(void *arg) | ||||
* cc.en==0. This is because we don't really know what status the | * cc.en==0. This is because we don't really know what status the | ||||
* controller was left in when boot handed off to OS. Linux doesn't do | * controller was left in when boot handed off to OS. Linux doesn't do | ||||
* this, however. If we adopt that policy, see also nvme_ctrlr_resume(). | * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). | ||||
*/ | */ | ||||
if (nvme_ctrlr_hw_reset(ctrlr) != 0) { | if (nvme_ctrlr_hw_reset(ctrlr) != 0) { | ||||
fail: | fail: | ||||
nvme_ctrlr_fail(ctrlr); | nvme_ctrlr_fail(ctrlr); | ||||
config_intrhook_disestablish(&ctrlr->config_hook); | config_intrhook_disestablish(&ctrlr->config_hook); | ||||
ctrlr->config_hook.ich_arg = NULL; | |||||
return; | return; | ||||
} | } | ||||
if (nvme_ctrlr_hw_reset(ctrlr) != 0) | if (nvme_ctrlr_hw_reset(ctrlr) != 0) | ||||
goto fail; | goto fail; | ||||
nvme_qpair_reset(&ctrlr->adminq); | nvme_qpair_reset(&ctrlr->adminq); | ||||
nvme_admin_qpair_enable(&ctrlr->adminq); | nvme_admin_qpair_enable(&ctrlr->adminq); | ||||
if (nvme_ctrlr_identify(ctrlr) == 0 && | if (nvme_ctrlr_identify(ctrlr) == 0 && | ||||
nvme_ctrlr_set_num_qpairs(ctrlr) == 0 && | nvme_ctrlr_set_num_qpairs(ctrlr) == 0 && | ||||
nvme_ctrlr_construct_io_qpairs(ctrlr) == 0) | nvme_ctrlr_construct_io_qpairs(ctrlr) == 0) | ||||
nvme_ctrlr_start(ctrlr, false); | nvme_ctrlr_start(ctrlr, false); | ||||
else | else | ||||
goto fail; | goto fail; | ||||
nvme_sysctl_initialize_ctrlr(ctrlr); | nvme_sysctl_initialize_ctrlr(ctrlr); | ||||
config_intrhook_disestablish(&ctrlr->config_hook); | config_intrhook_disestablish(&ctrlr->config_hook); | ||||
ctrlr->config_hook.ich_arg = NULL; | |||||
ctrlr->is_initialized = 1; | ctrlr->is_initialized = 1; | ||||
nvme_notify_new_controller(ctrlr); | nvme_notify_new_controller(ctrlr); | ||||
} | } | ||||
static void | static void | ||||
nvme_ctrlr_reset_task(void *arg, int pending) | nvme_ctrlr_reset_task(void *arg, int pending) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 517 Lines • Show Last 20 Lines |