android_kernel_xiaomi_sm7250/drivers/misc/ocxl
Greg Kurz 6665481e1c ocxl: Fix endiannes bug in read_afu_name()
commit 2f07229f02d4c55affccd11a61af4fd4b94dc436 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-09 17:38:43 +01:00
..
afu_irq.c
config.c ocxl: Fix endiannes bug in read_afu_name() 2019-01-09 17:38:43 +01: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
link.c ocxl: Fix endiannes bug in ocxl_link_update_pe() 2019-01-09 17:38:43 +01:00
main.c
Makefile
ocxl_internal.h
pasid.c
pci.c
sysfs.c ocxl: Change return type for fault handler 2018-07-02 23:54:26 +10:00
trace.c
trace.h