]> git.baikalelectronics.ru Git - kernel.git/commit
ocxl: Fix endiannes bug in ocxl_link_update_pe()
authorGreg Kurz <groug@kaod.org>
Sun, 16 Dec 2018 21:28:50 +0000 (22:28 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 20 Dec 2018 11:21:20 +0000 (22:21 +1100)
commitbc18e3ab35ecb79af14b306a9610a9ec11bad699
tree64b53bf8fc9666ec3d5ee454dd91f6c88e1a501b
parent4bf4145e63ad33d7fdf110a7089d60d4be9b0a33
ocxl: Fix endiannes bug in ocxl_link_update_pe()

All fields in the PE are big-endian. Use cpu_to_be32() like everywhere
else something is written to the PE. Otherwise a wrong TID will be used
by the NPU. If this TID happens to point to an existing thread sharing
the same mm, it could be woken up by error. This is highly improbable
though. The likely outcome of this is the NPU not finding the target
thread and forcing the AFU into sending an interrupt, which userspace
is supposed to handle anyway.

Fixes: d70baa9a89bc ("ocxl: Expose the thread_id needed for wait on POWER9")
Cc: stable@vger.kernel.org # v4.18
Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/ocxl/link.c