linux/drivers/misc/ocxl
Greg Kurz 2f07229f02 ocxl: Fix endiannes bug in read_afu_name()
The AFU Descriptor Template in the PCI config space has a Name Space
field which is a 24 Byte ASCII character string of descriptive name
space for the AFU. The OCXL driver read the string four characters at
a time with pci_read_config_dword().

This optimization is valid on a little-endian system since this is PCI,
but a big-endian system ends up with each subset of four characters in
reverse order.

This could be fixed by switching to read characters one by one. Another
option is to swap the bytes if we're big-endian.

Go for the latter with le32_to_cpu().

Cc: stable@vger.kernel.org      # v4.16
Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-12-21 14:46:50 +11:00
..
afu_irq.c ocxl/afu_irq: Don't include <asm/pnv-ocxl.h> 2018-12-20 22:21:20 +11:00
config.c ocxl: Fix endiannes bug in read_afu_name() 2018-12-21 14:46:50 +11:00
context.c ocxl: Change return type for fault handler 2018-07-02 23:54:26 +10:00
file.c ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait() 2018-06-05 21:33:57 +10:00
Kconfig ocxl: Add Makefile and Kconfig 2018-01-24 11:42:59 +11:00
link.c ocxl: Clarify error path in setup_xsl_irq() 2018-12-20 22:21:20 +11:00
main.c
Makefile ocxl: Add Makefile and Kconfig 2018-01-24 11:42:59 +11:00
ocxl_internal.h ocxl: Expose the thread_id needed for wait on POWER9 2018-06-03 20:40:32 +10:00
pasid.c
pci.c misc: ocxl: use put_device() instead of device_unregister() 2018-03-15 18:12:01 +01:00
sysfs.c ocxl: Change return type for fault handler 2018-07-02 23:54:26 +10:00
trace.c ocxl: Add trace points 2018-01-24 11:42:59 +11:00
trace.h ocxl: Add trace points 2018-01-24 11:42:59 +11:00