]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Aug 2022 12:56:56 +0000 (14:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Aug 2022 12:56:56 +0000 (14:56 +0200)
added patches:
drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch
drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch
drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch
parisc-fix-device-names-in-proc-iomem.patch
parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch

queue-5.4/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch [new file with mode: 0644]
queue-5.4/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch [new file with mode: 0644]
queue-5.4/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch [new file with mode: 0644]
queue-5.4/parisc-fix-device-names-in-proc-iomem.patch [new file with mode: 0644]
queue-5.4/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch b/queue-5.4/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch
new file mode 100644 (file)
index 0000000..8dcb6fb
--- /dev/null
@@ -0,0 +1,49 @@
+From f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 Mon Sep 17 00:00:00 2001
+From: Leo Li <sunpeng.li@amd.com>
+Date: Tue, 12 Jul 2022 12:30:29 -0400
+Subject: drm/amdgpu: Check BO's requested pinning domains against its preferred_domains
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Leo Li <sunpeng.li@amd.com>
+
+commit f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 upstream.
+
+When pinning a buffer, we should check to see if there are any
+additional restrictions imposed by bo->preferred_domains. This will
+prevent the BO from being moved to an invalid domain when pinning.
+
+For example, this can happen if the user requests to create a BO in GTT
+domain for display scanout. amdgpu_dm will allow pinning to either VRAM
+or GTT domains, since DCN can scanout from either or. However, in
+amdgpu_bo_pin_restricted(), pinning to VRAM is preferred if there is
+adequate carveout. This can lead to pinning to VRAM despite the user
+requesting GTT placement for the BO.
+
+v2: Allow the kernel to override the domain, which can happen when
+    exporting a BO to a V4L camera (for example).
+
+Signed-off-by: Leo Li <sunpeng.li@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+@@ -892,6 +892,10 @@ int amdgpu_bo_pin_restricted(struct amdg
+       if (WARN_ON_ONCE(min_offset > max_offset))
+               return -EINVAL;
++      /* Check domain to be pinned to against preferred domains */
++      if (bo->preferred_domains & domain)
++              domain = bo->preferred_domains & domain;
++
+       /* A shared bo cannot be migrated to VRAM */
+       if (bo->prime_shared_count) {
+               if (domain & AMDGPU_GEM_DOMAIN_GTT)
diff --git a/queue-5.4/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch b/queue-5.4/drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch
new file mode 100644 (file)
index 0000000..ea717a0
--- /dev/null
@@ -0,0 +1,50 @@
+From 2939deac1fa220bc82b89235f146df1d9b52e876 Mon Sep 17 00:00:00 2001
+From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
+Date: Thu, 30 Jun 2022 23:04:04 +0300
+Subject: drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
+
+commit 2939deac1fa220bc82b89235f146df1d9b52e876 upstream.
+
+Use ww_acquire_fini() in the error code paths. Otherwise lockdep
+thinks that lock is held when lock's memory is freed after the
+drm_gem_lock_reservations() error. The ww_acquire_context needs to be
+annotated as "released", which fixes the noisy "WARNING: held lock freed!"
+splat of VirtIO-GPU driver with CONFIG_DEBUG_MUTEXES=y and enabled lockdep.
+
+Cc: stable@vger.kernel.org
+Fixes: 7edc3e3b975b5 ("drm: Add helpers for locking an array of BO reservations.")
+Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220630200405.1883897-2-dmitry.osipenko@collabora.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/drm_gem.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/drm_gem.c
++++ b/drivers/gpu/drm/drm_gem.c
+@@ -1292,7 +1292,7 @@ retry:
+               ret = dma_resv_lock_slow_interruptible(obj->resv,
+                                                                acquire_ctx);
+               if (ret) {
+-                      ww_acquire_done(acquire_ctx);
++                      ww_acquire_fini(acquire_ctx);
+                       return ret;
+               }
+       }
+@@ -1317,7 +1317,7 @@ retry:
+                               goto retry;
+                       }
+-                      ww_acquire_done(acquire_ctx);
++                      ww_acquire_fini(acquire_ctx);
+                       return ret;
+               }
+       }
diff --git a/queue-5.4/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch b/queue-5.4/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch
new file mode 100644 (file)
index 0000000..a3edec8
--- /dev/null
@@ -0,0 +1,35 @@
+From c441d28945fb113220d48d6c86ebc0b090a2b677 Mon Sep 17 00:00:00 2001
+From: Timur Tabi <ttabi@nvidia.com>
+Date: Wed, 11 May 2022 11:37:16 -0500
+Subject: drm/nouveau: fix another off-by-one in nvbios_addr
+
+From: Timur Tabi <ttabi@nvidia.com>
+
+commit c441d28945fb113220d48d6c86ebc0b090a2b677 upstream.
+
+This check determines whether a given address is part of
+image 0 or image 1.  Image 1 starts at offset image0_size,
+so that address should be included.
+
+Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image")
+Cc: <stable@vger.kernel.org> # v4.8+
+Signed-off-by: Timur Tabi <ttabi@nvidia.com>
+Reviewed-by: Karol Herbst <kherbst@redhat.com>
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
+@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32
+ {
+       u32 p = *addr;
+-      if (*addr > bios->image0_size && bios->imaged_addr) {
++      if (*addr >= bios->image0_size && bios->imaged_addr) {
+               *addr -= bios->image0_size;
+               *addr += bios->imaged_addr;
+       }
diff --git a/queue-5.4/parisc-fix-device-names-in-proc-iomem.patch b/queue-5.4/parisc-fix-device-names-in-proc-iomem.patch
new file mode 100644 (file)
index 0000000..66197ef
--- /dev/null
@@ -0,0 +1,45 @@
+From cab56b51ec0e69128909cef4650e1907248d821b Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 18 Jul 2022 17:06:47 +0200
+Subject: parisc: Fix device names in /proc/iomem
+
+From: Helge Deller <deller@gmx.de>
+
+commit cab56b51ec0e69128909cef4650e1907248d821b upstream.
+
+Fix the output of /proc/iomem to show the real hardware device name
+including the pa_pathname, e.g. "Merlin 160 Core Centronics [8:16:0]".
+Up to now only the pa_pathname ("[8:16.0]") was shown.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Cc: <stable@vger.kernel.org> # v4.9+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/drivers.c |    9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/arch/parisc/kernel/drivers.c
++++ b/arch/parisc/kernel/drivers.c
+@@ -520,7 +520,6 @@ alloc_pa_dev(unsigned long hpa, struct h
+       dev->id.hversion_rev = iodc_data[1] & 0x0f;
+       dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) |
+                       (iodc_data[5] << 8) | iodc_data[6];
+-      dev->hpa.name = parisc_pathname(dev);
+       dev->hpa.start = hpa;
+       /* This is awkward.  The STI spec says that gfx devices may occupy
+        * 32MB or 64MB.  Unfortunately, we don't know how to tell whether
+@@ -534,10 +533,10 @@ alloc_pa_dev(unsigned long hpa, struct h
+               dev->hpa.end = hpa + 0xfff;
+       }
+       dev->hpa.flags = IORESOURCE_MEM;
+-      name = parisc_hardware_description(&dev->id);
+-      if (name) {
+-              strlcpy(dev->name, name, sizeof(dev->name));
+-      }
++      dev->hpa.name = dev->name;
++      name = parisc_hardware_description(&dev->id) ? : "unknown";
++      snprintf(dev->name, sizeof(dev->name), "%s [%s]",
++              name, parisc_pathname(dev));
+       /* Silently fail things like mouse ports which are subsumed within
+        * the keyboard controller
diff --git a/queue-5.4/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch b/queue-5.4/parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch
new file mode 100644 (file)
index 0000000..81785be
--- /dev/null
@@ -0,0 +1,36 @@
+From 6431e92fc827bdd2d28f79150d90415ba9ce0d21 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 1 Aug 2022 17:36:15 +0200
+Subject: parisc: io_pgetevents_time64() needs compat syscall in 32-bit compat mode
+
+From: Helge Deller <deller@gmx.de>
+
+commit 6431e92fc827bdd2d28f79150d90415ba9ce0d21 upstream.
+
+For all syscalls in 32-bit compat mode on 64-bit kernels the upper
+32-bits of the 64-bit registers are zeroed out, so a negative 32-bit
+signed value will show up as positive 64-bit signed value.
+
+This behaviour breaks the io_pgetevents_time64() syscall which expects
+signed 64-bit values for the "min_nr" and "nr" parameters.
+Fix this by switching to the compat_sys_io_pgetevents_time64() syscall,
+which uses "compat_long_t" types for those parameters.
+
+Cc: <stable@vger.kernel.org> # v5.1+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/parisc/kernel/syscalls/syscall.tbl |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/parisc/kernel/syscalls/syscall.tbl
++++ b/arch/parisc/kernel/syscalls/syscall.tbl
+@@ -413,7 +413,7 @@
+ 412   32      utimensat_time64                sys_utimensat                   sys_utimensat
+ 413   32      pselect6_time64                 sys_pselect6                    compat_sys_pselect6_time64
+ 414   32      ppoll_time64                    sys_ppoll                       compat_sys_ppoll_time64
+-416   32      io_pgetevents_time64            sys_io_pgetevents               sys_io_pgetevents
++416   32      io_pgetevents_time64            sys_io_pgetevents               compat_sys_io_pgetevents_time64
+ 417   32      recvmmsg_time64                 sys_recvmmsg                    compat_sys_recvmmsg_time64
+ 418   32      mq_timedsend_time64             sys_mq_timedsend                sys_mq_timedsend
+ 419   32      mq_timedreceive_time64          sys_mq_timedreceive             sys_mq_timedreceive
index 25655045e2015493880a8bda5df8c224219cc7ec..ae2608ac9229f2bd87f35fe6b84e6a5e7679a7b7 100644 (file)
@@ -26,3 +26,8 @@ thermal-sysfs-fix-cooling_device_stats_setup-error-code-path.patch
 fbcon-fix-boundary-checks-for-fbcon-vc-n1-n2-parameters.patch
 usbnet-fix-linkwatch-use-after-free-on-disconnect.patch
 ovl-drop-warn_on-dentry-is-null-in-ovl_encode_fh.patch
+parisc-fix-device-names-in-proc-iomem.patch
+parisc-io_pgetevents_time64-needs-compat-syscall-in-32-bit-compat-mode.patch
+drm-gem-properly-annotate-ww-context-on-drm_gem_lock_reservations-error.patch
+drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch
+drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch