cxl/mbox: Use __le32 in get,set_lsa mailbox structures
[email protected]
maintainerPATCH 1/1 cxl/mbox: Use __le32 in get,set_lsa mailbox structures
From: Alison Schofield <[email protected]>
CXL specification defines these as little endian.
Fixes 60b8f17215de ("cxl/pmem: Translate NVDIMM label commands to CXL label commands")
Reported-by Dan Williams <[email protected]>
Signed-off-by Alison Schofield <[email protected]>
--- drivers/cxl/cxlmem.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cxl/cxlmem.h +4 -4
@@ -221,13 +221,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;
base-commit: 53989fad1286e652ea3655ae3367ba698da8d2ff
Signature · 1 line
2.31.1
Quoted 23 lines · On Tue, Jan 4, 2022 at 3:16 PM <[email protected]> wrote:
From: Alison Schofield <[email protected]>
CXL specification defines these as little endian.
Fixes 60b8f17215de ("cxl/pmem: Translate NVDIMM label commands to CXL label commands")Reported-by Dan Williams <[email protected]>Signed-off-by Alison Schofield <[email protected]>--- drivers/cxl/cxlmem.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/cxl/cxlmem.h +1
-2@@ -221,13 +221,13 @@ struct cxl_mbox_identify { } __packed;struct cxl_mbox_get_lsa { -u32 offset; -u32 length; +__le32 offset;
drivers/cxl/cxlmem.h struct cxl_mbox_identify { · line 232
Quoted 10 lines
drivers/cxl/cxlmem.h +3
-2+__le32 length; } __packed;struct cxl_mbox_set_lsa { -u32 offset; -u32 reserved; +__le32 offset; +__le32 reserved;u8 data[]; } __packed;
You'll also need to fixup up the users like this:
drivers/cxl/pmem.c +2 -2
@@ -108,8 +108,8 @@ static int cxl_pmem_get_config_data(struct cxl_mem *cxlm,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_mem_mbox_send_cmd(cxlm, CXL_MBOX_OP_GET_LSA, &get_lsa,
...etc