kernel_samsung_a53x/drivers/char
He Zhe e0edce12c0 hpet: Support 32-bit userspace
commit 4e60131d0d36af65ab9c9144f4f163fe97ae36e8 upstream.

hpet_compat_ioctl and read file operations failed to handle parameters from
32-bit userspace and thus samples/timers/hpet_example.c fails as below.

root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: HPET_IRQFREQ failed

This patch fixes cmd and arg handling in hpet_compat_ioctl and adds compat
handling for 32-bit userspace in hpet_read.

hpet_example now shows that it works for both 64-bit and 32-bit.

root@intel-x86-64:~# ./hpet_example-32.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: info.hi_flags 0x0
hpet_poll: expired time = 0xf4298
hpet_poll: revents = 0x1
hpet_poll: data 0x1
hpet_poll: expired time = 0xf4235
hpet_poll: revents = 0x1
hpet_poll: data 0x1
root@intel-x86-64:~# ./hpet_example-64.out poll /dev/hpet 1 2
-hpet: executing poll
hpet_poll: info.hi_flags 0x0
hpet_poll: expired time = 0xf42a1
hpet_poll: revents = 0x1
hpet_poll: data 0x1
hpet_poll: expired time = 0xf4232
hpet_poll: revents = 0x1
hpet_poll: data 0x1

Cc: stable@vger.kernel.org
Signed-off-by: He Zhe <zhe.he@windriver.com>
Fixes: 54066a57c584 ("hpet: kill BKL, add compat_ioctl")
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240606123908.738733-1-zhe.he@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:45 +01:00
..
agp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hw_random hwrng: core - Fix page fault dead lock on mmap-ed hwrng 2024-11-18 12:12:55 +01:00
ipmi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mwave Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pcmcia Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tpm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xilinx_hwicap Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xillybus Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
apm-emulation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
applicom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
applicom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bsr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ds1620.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsp56k.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dtlk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hangcheck-timer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hpet.c hpet: Support 32-bit userspace 2024-11-19 14:19:45 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
misc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mspec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nsc_gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvram.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nwbutton.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nwbutton.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nwflash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pc8736x_gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
powernv-op-panel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ppdev.c ppdev: Add an error check in register_device 2024-11-19 12:27:04 +01:00
ps3flash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
random.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
raw.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scx200_gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sonypi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tb0219.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlclk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
toshiba.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ttyprintk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uv_mmtimer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virtio_console.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00