pps: Compatibility hack should be X86-specific
authorPhil Elwell <phil@raspberrypi.com>
Mon, 22 May 2023 13:22:55 +0000 (14:22 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:36 +0000 (11:33 +0000)
commitef42b1b0d9dec994ece32e1e099527262d613a05
tree71104e80d4b3d41fbcdf44bde0e9819a9d919f53
parent88d10ca281d2ad37c81d2505e90f3f43440e49eb
pps: Compatibility hack should be X86-specific

As of [1], using PPS_FETCH on a 64-bit ARM kernel with a 32-bit userland
is broken, returning a timeout. This is because the requested 4-byte
alignment for struct pps_ktime_compat (illegal on arm64) results in the
timeout flags field being uninitialised.

Make the hack specific to X86_64 builds with CONFIG_COMPAT defined.

[1] commit c2a49fe8eeef ("pps: fix padding issue with PPS_FETCH for
    ioctl_compat")

See: https://github.com/raspberrypi/linux/issues/5430
Fixes: c2a49fe8eeef ("pps: fix padding issue with PPS_FETCH for ioctl_compat")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/pps/pps.c