[v2] ocxl: Fix endiannes bug in read_afu_name()

Michael Ellerman patch-notifications at ellerman.id.au
Mon Dec 24 00:28:01 AEDT 2018


On Tue, 2018-12-11 at 17:58:21 UTC, Greg Kurz wrote:
> 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 at vger.kernel.org      # v4.16
> Signed-off-by: Greg Kurz <groug at kaod.org>
> Acked-by: Frederic Barrat <fbarrat at linux.ibm.com>
> Acked-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2f07229f02d4c55affccd11a61af4f

cheers


More information about the Linuxppc-dev mailing list