Skip to content

Commit 53ab867

Browse files
shijujose4weiny2
authored andcommitted
cxl/events: Fix Trace DRAM Event Record
CXL spec rev 3.0 section 8.2.9.2.1.2 defines the DRAM Event Record. Fix decode memory event type field of DRAM Event Record. For e.g. if value is 0x1 it will be reported as an Invalid Address (General Media Event Record - Memory Event Type) instead of Scrub Media ECC Error (DRAM Event Record - Memory Event Type) and so on. Fixes: 2d6c1e6 ("cxl/mem: Trace DRAM Event Record") Signed-off-by: Shiju Jose <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Ira Weiny <[email protected]>
1 parent cce3cd6 commit 53ab867

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

drivers/cxl/core/trace.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ TRACE_EVENT(cxl_generic_event,
279279
#define CXL_GMER_MEM_EVT_TYPE_ECC_ERROR 0x00
280280
#define CXL_GMER_MEM_EVT_TYPE_INV_ADDR 0x01
281281
#define CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x02
282-
#define show_mem_event_type(type) __print_symbolic(type, \
282+
#define show_gmer_mem_event_type(type) __print_symbolic(type, \
283283
{ CXL_GMER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \
284284
{ CXL_GMER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \
285285
{ CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \
@@ -373,7 +373,7 @@ TRACE_EVENT(cxl_general_media,
373373
"hpa=%llx region=%s region_uuid=%pUb",
374374
__entry->dpa, show_dpa_flags(__entry->dpa_flags),
375375
show_event_desc_flags(__entry->descriptor),
376-
show_mem_event_type(__entry->type),
376+
show_gmer_mem_event_type(__entry->type),
377377
show_trans_type(__entry->transaction_type),
378378
__entry->channel, __entry->rank, __entry->device,
379379
__print_hex(__entry->comp_id, CXL_EVENT_GEN_MED_COMP_ID_SIZE),
@@ -391,6 +391,17 @@ TRACE_EVENT(cxl_general_media,
391391
* DRAM Event Record defines many fields the same as the General Media Event
392392
* Record. Reuse those definitions as appropriate.
393393
*/
394+
#define CXL_DER_MEM_EVT_TYPE_ECC_ERROR 0x00
395+
#define CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR 0x01
396+
#define CXL_DER_MEM_EVT_TYPE_INV_ADDR 0x02
397+
#define CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x03
398+
#define show_dram_mem_event_type(type) __print_symbolic(type, \
399+
{ CXL_DER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \
400+
{ CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR, "Scrub Media ECC Error" }, \
401+
{ CXL_DER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \
402+
{ CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \
403+
)
404+
394405
#define CXL_DER_VALID_CHANNEL BIT(0)
395406
#define CXL_DER_VALID_RANK BIT(1)
396407
#define CXL_DER_VALID_NIBBLE BIT(2)
@@ -477,7 +488,7 @@ TRACE_EVENT(cxl_dram,
477488
"hpa=%llx region=%s region_uuid=%pUb",
478489
__entry->dpa, show_dpa_flags(__entry->dpa_flags),
479490
show_event_desc_flags(__entry->descriptor),
480-
show_mem_event_type(__entry->type),
491+
show_dram_mem_event_type(__entry->type),
481492
show_trans_type(__entry->transaction_type),
482493
__entry->channel, __entry->rank, __entry->nibble_mask,
483494
__entry->bank_group, __entry->bank,

0 commit comments

Comments
 (0)