From 8e20f0d10438f9060a309fe6754f42ac8065a9f5 Mon Sep 17 00:00:00 2001 From: amitabhd Date: Thu, 19 Dec 2024 05:27:48 +0000 Subject: [PATCH] host1x_emu: Fix Host1x_EMU devnode permission Set R/W permission for group and others. Bug 5019709 Change-Id: Ia007623c891a10669ba92ab4de1d50a1d4f7ce9f Signed-off-by: amitabhd Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3271151 Reviewed-by: svcacv Reviewed-by: Leslin Varghese Reviewed-by: Raghavendra Vishnu Kumar GVS: buildbot_gerritrpt --- drivers/gpu/host1x-emu/ioctl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/host1x-emu/ioctl.c b/drivers/gpu/host1x-emu/ioctl.c index 599d1693..a9551278 100644 --- a/drivers/gpu/host1x-emu/ioctl.c +++ b/drivers/gpu/host1x-emu/ioctl.c @@ -307,6 +307,16 @@ static const struct file_operations host1x_ctrlops = { #endif }; +#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG) /* Linux v6.2 */ +static char *host1x_emu_devnode(const struct device *dev, umode_t *mode) +#else +static char *host1x_emu_devnode(struct device *dev, umode_t *mode) +#endif +{ + *mode = 0666; + return NULL; +} + int host1x_user_init(struct host1x *host) { int err; @@ -328,6 +338,7 @@ int host1x_user_init(struct host1x *host) dev_err(host->dev, "failed to reserve chrdev region\n"); goto fail; } + host->host1x_class->devnode = host1x_emu_devnode; host->major = MAJOR(devno); host->next_minor += 1;