Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme: fix async event trace event

Mixing AER Event Type and Event Info has masking clashes. Just print the
event type, but also include the event info of the AER result in the
trace.

Fixes: 09bd1ff4b15143b ("nvme-core: add async event trace helper")
Reported-by: Nate Thornton <nate.thornton@samsung.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Keith Busch and committed by
Christoph Hellwig
6622b76f cf806e3a

+7 -13
+1 -4
drivers/nvme/host/core.c
··· 4808 4808 u32 aer_notice_type = nvme_aer_subtype(result); 4809 4809 bool requeue = true; 4810 4810 4811 - trace_nvme_async_event(ctrl, aer_notice_type); 4812 - 4813 4811 switch (aer_notice_type) { 4814 4812 case NVME_AER_NOTICE_NS_CHANGED: 4815 4813 set_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events); ··· 4843 4845 4844 4846 static void nvme_handle_aer_persistent_error(struct nvme_ctrl *ctrl) 4845 4847 { 4846 - trace_nvme_async_event(ctrl, NVME_AER_ERROR); 4847 4848 dev_warn(ctrl->device, "resetting controller due to AER\n"); 4848 4849 nvme_reset_ctrl(ctrl); 4849 4850 } ··· 4858 4861 if (le16_to_cpu(status) >> 1 != NVME_SC_SUCCESS) 4859 4862 return; 4860 4863 4864 + trace_nvme_async_event(ctrl, result); 4861 4865 switch (aer_type) { 4862 4866 case NVME_AER_NOTICE: 4863 4867 requeue = nvme_handle_aen_notice(ctrl, result); ··· 4876 4878 case NVME_AER_SMART: 4877 4879 case NVME_AER_CSS: 4878 4880 case NVME_AER_VS: 4879 - trace_nvme_async_event(ctrl, aer_type); 4880 4881 ctrl->aen_result = result; 4881 4882 break; 4882 4883 default:
+6 -9
drivers/nvme/host/trace.h
··· 127 127 ), 128 128 TP_printk("nvme%d: NVME_AEN=%#08x [%s]", 129 129 __entry->ctrl_id, __entry->result, 130 - __print_symbolic(__entry->result, 131 - aer_name(NVME_AER_NOTICE_NS_CHANGED), 132 - aer_name(NVME_AER_NOTICE_ANA), 133 - aer_name(NVME_AER_NOTICE_FW_ACT_STARTING), 134 - aer_name(NVME_AER_NOTICE_DISC_CHANGED), 135 - aer_name(NVME_AER_ERROR), 136 - aer_name(NVME_AER_SMART), 137 - aer_name(NVME_AER_CSS), 138 - aer_name(NVME_AER_VS)) 130 + __print_symbolic(__entry->result & 0x7, 131 + aer_name(NVME_AER_ERROR), 132 + aer_name(NVME_AER_SMART), 133 + aer_name(NVME_AER_NOTICE), 134 + aer_name(NVME_AER_CSS), 135 + aer_name(NVME_AER_VS)) 139 136 ) 140 137 ); 141 138