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

cxl/mbox: Add Clear Log mailbox command

Adding UAPI support for CXL r3.1 8.2.9.5.4
Clear Log command.

This proposed patch will be useful for clearing and populating
the Vendor debug log in certain scenarios, allowing for the
aggregation of results over time.

Signed-off-by: Srinivasulu Thanneeru <sthanneeru.opensrc@micron.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240313071218.729-3-sthanneeru.opensrc@micron.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Srinivasulu Thanneeru and committed by
Dave Jiang
206f9fa9 940325ad

+12
+10
drivers/cxl/core/mbox.c
··· 57 57 CXL_CMD(GET_HEALTH_INFO, 0, 0x12, 0), 58 58 CXL_CMD(GET_LOG, 0x18, CXL_VARIABLE_PAYLOAD, CXL_CMD_FLAG_FORCE_ENABLE), 59 59 CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0), 60 + CXL_CMD(CLEAR_LOG, 0x10, 0, 0), 60 61 CXL_CMD(GET_SUP_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0), 61 62 CXL_CMD(SET_PARTITION_INFO, 0x0a, 0, 0), 62 63 CXL_CMD(SET_LSA, CXL_VARIABLE_PAYLOAD, 0, 0), ··· 333 332 if (pi->flags & CXL_SET_PARTITION_IMMEDIATE_FLAG) 334 333 return false; 335 334 break; 335 + } 336 + case CXL_MBOX_OP_CLEAR_LOG: { 337 + const uuid_t *uuid = (uuid_t *)payload_in; 338 + 339 + /* 340 + * Restrict the ‘Clear log’ action to only apply to 341 + * Vendor debug logs. 342 + */ 343 + return uuid_equal(uuid, &DEFINE_CXL_VENDOR_DEBUG_UUID); 336 344 } 337 345 default: 338 346 break;
+1
drivers/cxl/cxlmem.h
··· 528 528 CXL_MBOX_OP_GET_SUPPORTED_LOGS = 0x0400, 529 529 CXL_MBOX_OP_GET_LOG = 0x0401, 530 530 CXL_MBOX_OP_GET_LOG_CAPS = 0x0402, 531 + CXL_MBOX_OP_CLEAR_LOG = 0x0403, 531 532 CXL_MBOX_OP_GET_SUP_LOG_SUBLIST = 0x0405, 532 533 CXL_MBOX_OP_IDENTIFY = 0x4000, 533 534 CXL_MBOX_OP_GET_PARTITION_INFO = 0x4100,
+1
include/uapi/linux/cxl_mem.h
··· 48 48 ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), \ 49 49 ___C(GET_TIMESTAMP, "Get Timestamp"), \ 50 50 ___C(GET_LOG_CAPS, "Get Log Capabilities"), \ 51 + ___C(CLEAR_LOG, "Clear Log"), \ 51 52 ___C(GET_SUP_LOG_SUBLIST, "Get Supported Logs Sub-List"), \ 52 53 ___C(MAX, "invalid / last command") 53 54