[RFC PATCH 4/4] cxl/mbox: Add Populate Log support

Ravis OpenSrc
2024-10-16T04:32:43Z

Adding UAPI support for
CXL r3.1 8.2.9.5.5 Populate Log.

Signed-off-by: Ravi Shankar <ravis.opensrc@micron.com>
---
drivers/cxl/core/mbox.c      | 1 +
drivers/cxl/cxlmem.h         | 1 +
include/uapi/linux/cxl_mem.h | 1 +
3 files changed, 3 insertions(+)

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 8c0144913b9e..48c2fc8b4bcd 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -59,6 +59,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
CXL_CMD(GET_SUP_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
+       CXL_CMD(POPULATE_LOG, 0x10, 0, 0),
CXL_CMD(SET_PARTITION_INFO, 0x0a, 0, 0),
CXL_CMD(SET_LSA, CXL_VARIABLE_PAYLOAD, 0, 0),
CXL_CMD(GET_ALERT_CONFIG, 0, 0x10, 0),
diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
index 808fb8712145..6320d8cd3ca3 100644
--- a/drivers/cxl/cxlmem.h
+++ b/drivers/cxl/cxlmem.h
@@ -530,6 +530,7 @@ enum cxl_opcode {
CXL_MBOX_OP_GET_LOG             = 0x0401,
CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+       CXL_MBOX_OP_POPULATE_LOG        = 0x0404,
CXL_MBOX_OP_GET_SUP_LOG_SUBLIST = 0x0405,
CXL_MBOX_OP_IDENTIFY            = 0x4000,
CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
diff --git a/include/uapi/linux/cxl_mem.h b/include/uapi/linux/cxl_mem.h
index c6c0fe27495d..040ca37046ed 100644
--- a/include/uapi/linux/cxl_mem.h
+++ b/include/uapi/linux/cxl_mem.h
@@ -50,6 +50,7 @@
___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
___C(CLEAR_LOG, "Clear Log"),                                     \
___C(GET_SUP_LOG_SUBLIST, "Get Supported Logs Sub-List"),         \
+       ___C(POPULATE_LOG, "Populate Log"),       \
___C(MAX, "invalid / last command")

#define ___C(a, b) CXL_MEM_COMMAND_ID_##a
--
2.43.0