summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2024-06-06 15:39:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-03 17:20:03 +0300
commit4e60131d0d36af65ab9c9144f4f163fe97ae36e8 (patch)
tree8de1c6a3478a1759743aa5d4bfb2126c041d96a6 /drivers/misc
parentbab2f5e8fd5d2f759db26b78d9db57412888f187 (diff)
downloadlinux-4e60131d0d36af65ab9c9144f4f163fe97ae36e8.tar.xz
hpet: Support 32-bit userspace
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>
Diffstat (limited to 'drivers/misc')
0 files changed, 0 insertions, 0 deletions