Skip to contentSkip to conversation

cxl: Add Support for Get Timestamp

PATCH In review Davidlohr Bueso 3 participants 4 messages Aug 29, 2023 – Sep 28, 2023 CXL

lore
Share & tools
lore

Davidlohr Bueso

author maintainer
#0 lore raw

PATCH 1/1 cxl: Add Support for Get Timestamp

Add the call to the UAPI such that userspace may corelate the timestamps from the device log with system wall time, if, for example there's any sort of inaccuracy or skew in the device.

---
 drivers/cxl/core/mbox.c      | 1 +
 drivers/cxl/cxlmem.h         | 1 +
 include/uapi/linux/cxl_mem.h | 1 +
 3 files changed, 3 insertions(+)
drivers/cxl/core/mbox.c +1 -0
index ca60bb8114f2..2444faac1e4c 100644
@@ -63,6 +63,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
 	CXL_CMD(GET_SHUTDOWN_STATE, 0, 0x1, 0),
 	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
 	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +1 -0
index 706f8a6d1ef4..ec6dfcc7bb99 100644
@@ -500,6 +500,7 @@ enum cxl_opcode {
 	CXL_MBOX_OP_GET_FW_INFO		= 0x0200,
 	CXL_MBOX_OP_TRANSFER_FW		= 0x0201,
 	CXL_MBOX_OP_ACTIVATE_FW		= 0x0202,
+	CXL_MBOX_OP_GET_TIMESTAMP	= 0x0300,
 	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
 	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
 	CXL_MBOX_OP_GET_LOG		= 0x0401,
include/uapi/linux/cxl_mem.h +1 -0
index 14bc6e742148..42066f4eb890 100644
@@ -46,6 +46,7 @@
 	___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"),         \
 	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
 	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
+	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
 	___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Tue, 29 Aug 2023 08:20:14 -0700 Davidlohr Bueso <[email protected]> wrote:

Add the call to the UAPI such that userspace may corelate the timestamps from the device log with system wall time, if, for example there's any sort of inaccuracy or skew in the device.

Seems sensible to me.

Quoted 42 lines
---
 drivers/cxl/core/mbox.c      | 1 +
 drivers/cxl/cxlmem.h         | 1 +
 include/uapi/linux/cxl_mem.h | 1 +
 3 files changed, 3 insertions(+)
drivers/cxl/core/mbox.c +1 -0
index ca60bb8114f2..2444faac1e4c 100644
@@ -63,6 +63,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
 	CXL_CMD(GET_SHUTDOWN_STATE, 0, 0x1, 0),
 	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
 	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +1 -0
index 706f8a6d1ef4..ec6dfcc7bb99 100644
@@ -500,6 +500,7 @@ enum cxl_opcode {
 	CXL_MBOX_OP_GET_FW_INFO		= 0x0200,
 	CXL_MBOX_OP_TRANSFER_FW		= 0x0201,
 	CXL_MBOX_OP_ACTIVATE_FW		= 0x0202,
+	CXL_MBOX_OP_GET_TIMESTAMP	= 0x0300,
 	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
 	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
 	CXL_MBOX_OP_GET_LOG		= 0x0401,
include/uapi/linux/cxl_mem.h +1 -0
index 14bc6e742148..42066f4eb890 100644
@@ -46,6 +46,7 @@
 	___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"),         \
 	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
 	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
+	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
 	___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Davidlohr Bueso
Quoted 5 lines · Davidlohr Bueso

Add the call to the UAPI such that userspace may corelate the timestamps from the device log with system wall time, if, for example there's any sort of inaccuracy or skew in the device.

Quoted 42 lines
---
  drivers/cxl/core/mbox.c      | 1 +
  drivers/cxl/cxlmem.h         | 1 +
  include/uapi/linux/cxl_mem.h | 1 +
  3 files changed, 3 insertions(+)
drivers/cxl/core/mbox.c +1 -0
index ca60bb8114f2..2444faac1e4c 100644
@@ -63,6 +63,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
  	CXL_CMD(GET_SHUTDOWN_STATE, 0, 0x1, 0),
  	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
  	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
  };
 
  /*
drivers/cxl/cxlmem.h +1 -0
index 706f8a6d1ef4..ec6dfcc7bb99 100644
@@ -500,6 +500,7 @@ enum cxl_opcode {
  	CXL_MBOX_OP_GET_FW_INFO		= 0x0200,
  	CXL_MBOX_OP_TRANSFER_FW		= 0x0201,
  	CXL_MBOX_OP_ACTIVATE_FW		= 0x0202,
+	CXL_MBOX_OP_GET_TIMESTAMP	= 0x0300,
  	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
  	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
  	CXL_MBOX_OP_GET_LOG		= 0x0401,
include/uapi/linux/cxl_mem.h +1 -0
index 14bc6e742148..42066f4eb890 100644
@@ -46,6 +46,7 @@
  	___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"),         \
  	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
  	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
+	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
  	___C(MAX, "invalid / last command")
 
  #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
author maintainer
#3 lore raw
In reply to Davidlohr Bueso

ping? Unless any objections, can this be picked up?

Quoted 5 lines · Davidlohr Bueso

Add the call to the UAPI such that userspace may corelate the timestamps from the device log with system wall time, if, for example there's any sort of inaccuracy or skew in the device.

3B>---

Quoted 44 lines
drivers/cxl/core/mbox.c      | 1 +
drivers/cxl/cxlmem.h         | 1 +
include/uapi/linux/cxl_mem.h | 1 +
3 files changed, 3 insertions(+)
drivers/cxl/core/mbox.c +1 -0
index ca60bb8114f2..2444faac1e4c 100644
@@ -63,6 +63,7 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
 	CXL_CMD(GET_SHUTDOWN_STATE, 0, 0x1, 0),
 	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
 	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +1 -0
index 706f8a6d1ef4..ec6dfcc7bb99 100644
@@ -500,6 +500,7 @@ enum cxl_opcode {
 	CXL_MBOX_OP_GET_FW_INFO		= 0x0200,
 	CXL_MBOX_OP_TRANSFER_FW		= 0x0201,
 	CXL_MBOX_OP_ACTIVATE_FW		= 0x0202,
+	CXL_MBOX_OP_GET_TIMESTAMP	= 0x0300,
 	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
 	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
 	CXL_MBOX_OP_GET_LOG		= 0x0401,
include/uapi/linux/cxl_mem.h +1 -1
index 14bc6e742148..42066f4eb890 100644
@@ -46,6 +46,7 @@
 	___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"),         \
 	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
 	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
+	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
 	___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
--

2.41.0