From ea9ccd20ccbf7c1ef3ad5ff1498619512e4c4e94 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 Sep 2021 14:34:53 +0200 Subject: [PATCH] 5.10-stable patches added patches: drm-nouveau-nvkm-replace-enosys-with-enodev.patch --- ...veau-nvkm-replace-enosys-with-enodev.patch | 43 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 44 insertions(+) create mode 100644 queue-5.10/drm-nouveau-nvkm-replace-enosys-with-enodev.patch diff --git a/queue-5.10/drm-nouveau-nvkm-replace-enosys-with-enodev.patch b/queue-5.10/drm-nouveau-nvkm-replace-enosys-with-enodev.patch new file mode 100644 index 00000000000..49af5e74d83 --- /dev/null +++ b/queue-5.10/drm-nouveau-nvkm-replace-enosys-with-enodev.patch @@ -0,0 +1,43 @@ +From e8f71f89236ef82d449991bfbc237e3cb6ea584f Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Wed, 8 Sep 2021 12:08:17 -0700 +Subject: drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV + +From: Guenter Roeck + +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 +Cc: Ben Skeggs +Cc: David Airlie +Cc: Daniel Vetter +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + 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; + } + diff --git a/queue-5.10/series b/queue-5.10/series index 517deb85c3a..89f8ed04cd2 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -60,3 +60,4 @@ blk-throttle-fix-uaf-by-deleteing-timer-in-blk_throt.patch blk-mq-allow-4x-blk_max_request_count-at-blk_plug-fo.patch rtc-rx8010-select-regmap_i2c.patch sched-idle-make-the-idle-timer-expire-in-hard-interr.patch +drm-nouveau-nvkm-replace-enosys-with-enodev.patch -- 2.47.3