]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 12:33:43 +0000 (14:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 12:33:43 +0000 (14:33 +0200)
added patches:
drm-nouveau-nvkm-replace-enosys-with-enodev.patch

queue-4.9/drm-nouveau-nvkm-replace-enosys-with-enodev.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/drm-nouveau-nvkm-replace-enosys-with-enodev.patch b/queue-4.9/drm-nouveau-nvkm-replace-enosys-with-enodev.patch
new file mode 100644 (file)
index 0000000..49af5e7
--- /dev/null
@@ -0,0 +1,43 @@
+From e8f71f89236ef82d449991bfbc237e3cb6ea584f Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Wed, 8 Sep 2021 12:08:17 -0700
+Subject: drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+commit e8f71f89236ef82d449991bfbc237e3cb6ea584f upstream.
+
+nvkm test builds fail with the following error.
+
+  drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info':
+  drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5'
+
+The code builds on most architectures, but fails on parisc where ENOSYS
+is defined as 251.
+
+Replace the error code with -ENODEV (-19).  The actual error code does
+not really matter and is not passed to userspace - it just has to be
+negative.
+
+Fixes: 7238eca4cf18 ("drm/nouveau: expose pstate selection per-power source in sysfs")
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Cc: Ben Skeggs <bskeggs@redhat.com>
+Cc: David Airlie <airlied@linux.ie>
+Cc: Daniel Vetter <daniel@ffwll.ch>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
+@@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvk
+               args->v0.count = 0;
+               args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
+               args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
+-              args->v0.pwrsrc = -ENOSYS;
++              args->v0.pwrsrc = -ENODEV;
+               args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
+       }
index f17743e3688a531476715049f4fa2a1679d85e6a..cbe171a3170f901b1e817be9e6011e55145b9aa0 100644 (file)
@@ -22,3 +22,4 @@ nilfs2-fix-memory-leak-in-nilfs_sysfs_delete_-name-_.patch
 nilfs2-fix-memory-leak-in-nilfs_sysfs_create_snapsho.patch
 nilfs2-fix-memory-leak-in-nilfs_sysfs_delete_snapsho.patch
 blk-throttle-fix-uaf-by-deleteing-timer-in-blk_throt.patch
+drm-nouveau-nvkm-replace-enosys-with-enodev.patch