Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_ctrlr.c
Show First 20 Lines • Show All 676 Lines • ▼ Show 20 Lines | nvme_ctrlr_devctl_log(ctrlr, "critical", | ||||
"unknown critical warning(s): state = 0x%02x", state); | "unknown critical warning(s): state = 0x%02x", state); | ||||
} | } | ||||
static void | static void | ||||
nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) | nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) | ||||
{ | { | ||||
struct nvme_async_event_request *aer = arg; | struct nvme_async_event_request *aer = arg; | ||||
struct nvme_health_information_page *health_info; | struct nvme_health_information_page *health_info; | ||||
struct nvme_ns_list *nsl; | |||||
struct nvme_error_information_entry *err; | struct nvme_error_information_entry *err; | ||||
int i; | int i; | ||||
/* | /* | ||||
* If the log page fetch for some reason completed with an error, | * If the log page fetch for some reason completed with an error, | ||||
* don't pass log page data to the consumers. In practice, this case | * don't pass log page data to the consumers. In practice, this case | ||||
* should never happen. | * should never happen. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (aer->log_page_id == NVME_LOG_HEALTH_INFORMATION) { | ||||
* clear the associated bits in the async event | * clear the associated bits in the async event | ||||
* config so that we do not receive repeated | * config so that we do not receive repeated | ||||
* notifications for the same event. | * notifications for the same event. | ||||
*/ | */ | ||||
aer->ctrlr->async_event_config &= | aer->ctrlr->async_event_config &= | ||||
~health_info->critical_warning; | ~health_info->critical_warning; | ||||
nvme_ctrlr_cmd_set_async_event_config(aer->ctrlr, | nvme_ctrlr_cmd_set_async_event_config(aer->ctrlr, | ||||
aer->ctrlr->async_event_config, NULL, NULL); | aer->ctrlr->async_event_config, NULL, NULL); | ||||
} else if (aer->log_page_id == NVME_LOG_CHANGED_NAMESPACE && | |||||
!nvme_use_nvd) { | |||||
nsl = (struct nvme_ns_list *)aer->log_page_buffer; | |||||
for (i = 0; i < nitems(nsl->ns) && nsl->ns[i] != 0; i++) { | |||||
if (nsl->ns[i] > NVME_MAX_NAMESPACES) | |||||
break; | |||||
nvme_notify_ns(aer->ctrlr, nsl->ns[i]); | |||||
} | |||||
imp: I think this is wrong on many levels.
| |||||
Done Inline Actionssince notify_ns will query the namespace, that will cause kernel panic. here we post a query request to queue. other thread will query and construct_ns and call notify_ns after that. wanpengqian_gmail.com: since notify_ns will query the namespace, that will cause kernel panic. here we post a query… | |||||
} | } | ||||
/* | /* | ||||
* Pass the cpl data from the original async event completion, | * Pass the cpl data from the original async event completion, | ||||
* not the log page fetch. | * not the log page fetch. | ||||
*/ | */ | ||||
nvme_notify_async_consumers(aer->ctrlr, &aer->cpl, | nvme_notify_async_consumers(aer->ctrlr, &aer->cpl, | ||||
aer->log_page_id, aer->log_page_buffer, aer->log_page_size); | aer->log_page_id, aer->log_page_buffer, aer->log_page_size); | ||||
▲ Show 20 Lines • Show All 951 Lines • Show Last 20 Lines |
I think this is wrong on many levels.