@@ -1609,10 +1609,13 @@ int ras_cxl_dram_event_handler(struct trace_seq *s,
if (trace_seq_printf(s, "CVME Count:%u ", ev.cvme_count) <= 0)
return -1;
- cxl_dram_sparing(&ev);
+ if (cxl_dram_sparing(&ev) < 0)
+ ev.repair_needed = true;
- if (!(ev.dpa_flags & CXL_DPA_NOT_REPAIRABLE))
- cxl_ppr(&ev.hdr, ev.dpa, ev.nibble_mask);
+ if (!(ev.dpa_flags & CXL_DPA_NOT_REPAIRABLE)) {
+ if (cxl_ppr(&ev.hdr, ev.dpa, ev.nibble_mask) < 0)
+ ev.repair_needed = true;
+ }
/* Insert data into the SGBD */
#ifdef HAVE_SQLITE3
@@ -993,6 +993,7 @@ static const struct db_fields cxl_dram_event_fields[] = {
{ .name = "sub_channel", .type = "INTEGER" },
{ .name = "cme_threshold_ev_flags", .type = "INTEGER" },
{ .name = "cvme_count", .type = "INTEGER" },
+ { .name = "repair_needed", .type = "INTEGER" },
};
static const struct db_table_descriptor cxl_dram_event_tab = {
@@ -1043,6 +1044,7 @@ int ras_store_cxl_dram_event(struct ras_events *ras, struct ras_cxl_dram_event *
sqlite3_bind_int(priv->stmt_cxl_dram_event, idx++,
ev->cme_threshold_ev_flags);
sqlite3_bind_int(priv->stmt_cxl_dram_event, idx++, ev->cvme_count);
+ sqlite3_bind_int(priv->stmt_cxl_dram_event, idx++, ev->repair_needed);
rc = sqlite3_step(priv->stmt_cxl_dram_event);
if (rc != SQLITE_OK && rc != SQLITE_DONE)
@@ -238,6 +238,7 @@ struct ras_cxl_dram_event {
uint8_t res_id[CXL_PLDM_RES_ID_LEN];
uint8_t cme_threshold_ev_flags;
uint32_t cvme_count;
+ bool repair_needed;
};
struct ras_cxl_memory_module_event {