Skip to content

Commit 6622b76

Browse files
keithbuschChristoph Hellwig
authored andcommitted
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: 09bd1ff ("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>
1 parent cf806e3 commit 6622b76

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4808,8 +4808,6 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
48084808
u32 aer_notice_type = nvme_aer_subtype(result);
48094809
bool requeue = true;
48104810

4811-
trace_nvme_async_event(ctrl, aer_notice_type);
4812-
48134811
switch (aer_notice_type) {
48144812
case NVME_AER_NOTICE_NS_CHANGED:
48154813
set_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events);
@@ -4845,7 +4843,6 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
48454843

48464844
static void nvme_handle_aer_persistent_error(struct nvme_ctrl *ctrl)
48474845
{
4848-
trace_nvme_async_event(ctrl, NVME_AER_ERROR);
48494846
dev_warn(ctrl->device, "resetting controller due to AER\n");
48504847
nvme_reset_ctrl(ctrl);
48514848
}
@@ -4861,6 +4858,7 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
48614858
if (le16_to_cpu(status) >> 1 != NVME_SC_SUCCESS)
48624859
return;
48634860

4861+
trace_nvme_async_event(ctrl, result);
48644862
switch (aer_type) {
48654863
case NVME_AER_NOTICE:
48664864
requeue = nvme_handle_aen_notice(ctrl, result);
@@ -4878,7 +4876,6 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
48784876
case NVME_AER_SMART:
48794877
case NVME_AER_CSS:
48804878
case NVME_AER_VS:
4881-
trace_nvme_async_event(ctrl, aer_type);
48824879
ctrl->aen_result = result;
48834880
break;
48844881
default:

drivers/nvme/host/trace.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ TRACE_EVENT(nvme_async_event,
127127
),
128128
TP_printk("nvme%d: NVME_AEN=%#08x [%s]",
129129
__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))
139136
)
140137
);
141138

0 commit comments

Comments
 (0)