He Zhe
e2cb94465d
hpet: Support 32-bit userspace
...
commit 4e60131d0d
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: 54066a57c5
("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-07-18 11:39:38 +02:00
..
2023-10-10 21:44:58 +02:00
2024-02-23 08:12:40 +01:00
2023-09-23 10:48:10 +02:00
2022-01-27 09:04:22 +01:00
2021-07-20 16:15:55 +02:00
2023-09-23 10:48:15 +02:00
2019-03-10 07:17:20 +01:00
2024-07-18 11:39:38 +02:00
2022-06-25 11:49:15 +02:00
2019-12-13 08:50:58 +01:00
2022-10-26 13:19:19 +02:00
2024-06-16 13:23:33 +02:00
2022-10-26 13:19:19 +02:00
2018-06-12 16:19:22 -07:00
2018-08-02 17:16:03 +02:00
2020-10-01 13:14:42 +02:00
2021-05-22 10:59:32 +02:00
2022-04-15 14:15:04 +02:00