Commit 8a664875 authored by Alison Schofield's avatar Alison Schofield Committed by Dan Williams

cxl/mbox: Use __le32 in get,set_lsa mailbox structures

CXL specification defines these as little endian.

Fixes: 60b8f172 ("cxl/pmem: Translate NVDIMM label commands to CXL label commands")
Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarAlison Schofield <alison.schofield@intel.com>
Link: https://lore.kernel.org/r/20220225221456.1025635-1-alison.schofield@intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 8ae3cebc
......@@ -300,13 +300,13 @@ struct cxl_mbox_identify {
} __packed;
struct cxl_mbox_get_lsa {
u32 offset;
u32 length;
__le32 offset;
__le32 length;
} __packed;
struct cxl_mbox_set_lsa {
u32 offset;
u32 reserved;
__le32 offset;
__le32 reserved;
u8 data[];
} __packed;
......
......@@ -108,8 +108,8 @@ static int cxl_pmem_get_config_data(struct cxl_dev_state *cxlds,
return -EINVAL;
get_lsa = (struct cxl_mbox_get_lsa) {
.offset = cmd->in_offset,
.length = cmd->in_length,
.offset = cpu_to_le32(cmd->in_offset),
.length = cpu_to_le32(cmd->in_length),
};
rc = cxl_mbox_send_cmd(cxlds, CXL_MBOX_OP_GET_LSA, &get_lsa,
......@@ -139,7 +139,7 @@ static int cxl_pmem_set_config_data(struct cxl_dev_state *cxlds,
return -ENOMEM;
*set_lsa = (struct cxl_mbox_set_lsa) {
.offset = cmd->in_offset,
.offset = cpu_to_le32(cmd->in_offset),
};
memcpy(set_lsa->data, cmd->in_buf, cmd->in_length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment