@@ -795,6 +795,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
enabled++;
}
+ cmd->info.effects = le16_to_cpu(cel_entry[i].effect);
+
dev_dbg(dev, "Opcode 0x%04x %s\n", opcode,
enabled ? "enabled" : "unsupported by driver");
}
@@ -74,8 +74,8 @@ struct fwctl_info {
* struct fwctl_command_info - Hardware command information returned from a query.
* @id: Driver ID number for the command
* @opcode: Hardware command opcode
- * @set_effects: Effects to the OS and hardware when command is executed.
- * Provided by the device.
+ * @effects: Effects to the OS and hardware when command is executed.
+ * Provided by the device.
* @size_in: Expected input size, or ~0U if variable length.
* @size_out: Expected output size, or ~0U if variable length.
*
@@ -118,6 +118,7 @@ static const __u8 cxl_deprecated_commands[]
* the label-storage-area can not be written while the kernel is
* actively managing that space.
*
+ * @effects: Command effects reported by the device.
* @size_in: Expected input size, or ~0 if variable length.
* @size_out: Expected output size, or ~0 if variable length.
*
@@ -136,11 +137,11 @@ static const __u8 cxl_deprecated_commands[]
struct cxl_command_info {
__u32 id;
- __u32 flags;
+ __u16 flags;
#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(1, 0)
#define CXL_MEM_COMMAND_FLAG_ENABLED BIT(0)
#define CXL_MEM_COMMAND_FLAG_EXCLUSIVE BIT(1)
-
+ __u16 effects;
__u32 size_in;
__u32 size_out;
};
Store the command effects via what device provided via the CEL in the 'struct cxl_command_info' structure. Steal the upper 16 bits to store the effects value in order to keep user API compatibility. Signed-off-by: Dave Jiang <dave.jiang@intel.com> --- drivers/cxl/core/mbox.c | 2 ++ include/uapi/fwctl/fwctl.h | 4 ++-- include/uapi/linux/cxl_mem.h | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-)