]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Aug 2022 12:56:48 +0000 (14:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Aug 2022 12:56:48 +0000 (14:56 +0200)
added patches:
drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch
drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch
parisc-fix-device-names-in-proc-iomem.patch

queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch [new file with mode: 0644]
queue-4.19/parisc-fix-device-names-in-proc-iomem.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch b/queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch
new file mode 100644 (file)
index 0000000..e1aa75e
--- /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
+@@ -883,6 +883,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-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch b/queue-4.19/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-4.19/parisc-fix-device-names-in-proc-iomem.patch b/queue-4.19/parisc-fix-device-names-in-proc-iomem.patch
new file mode 100644 (file)
index 0000000..06fd213
--- /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
+@@ -499,7 +499,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
+@@ -513,10 +512,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
index 06454f98eb9b024e15d38308f6e0783365b0423f..b4d18e89d46e0614412c713452556df3eba4566c 100644 (file)
@@ -18,3 +18,6 @@ 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
+drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch
+drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch