]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 09:59:29 +0000 (10:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 09:59:29 +0000 (10:59 +0100)
added patches:
drm-amdgpu-display-only-set-vblank_disable_immediate-when-psr-is-not-enabled.patch
drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch
of-base-improve-argument-length-mismatch-error.patch
revert-drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-process.patch

queue-5.16/drm-amdgpu-display-only-set-vblank_disable_immediate-when-psr-is-not-enabled.patch [new file with mode: 0644]
queue-5.16/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch [new file with mode: 0644]
queue-5.16/of-base-improve-argument-length-mismatch-error.patch [new file with mode: 0644]
queue-5.16/revert-drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-process.patch [new file with mode: 0644]
queue-5.16/series

diff --git a/queue-5.16/drm-amdgpu-display-only-set-vblank_disable_immediate-when-psr-is-not-enabled.patch b/queue-5.16/drm-amdgpu-display-only-set-vblank_disable_immediate-when-psr-is-not-enabled.patch
new file mode 100644 (file)
index 0000000..db71b81
--- /dev/null
@@ -0,0 +1,60 @@
+From 70897848730470cc477d5d89e6222c0f6a9ac173 Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Tue, 30 Nov 2021 09:32:33 -0500
+Subject: drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled
+
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+
+commit 70897848730470cc477d5d89e6222c0f6a9ac173 upstream.
+
+[Why]
+PSR currently relies on the kernel's delayed vblank on/off mechanism
+as an implicit bufferring mechanism to prevent excessive entry/exit.
+
+Without this delay the user experience is impacted since it can take
+a few frames to enter/exit.
+
+[How]
+Only allow vblank disable immediate for DC when psr is not supported.
+
+Leave a TODO indicating that this support should be extended in the
+future to delay independent of the vblank interrupt.
+
+Fixes: 92020e81ddbeac ("drm/amdgpu/display: set vblank_disable_immediate for DC")
+
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1598,9 +1598,6 @@ static int amdgpu_dm_init(struct amdgpu_
+       adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size;
+       adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size;
+-      /* Disable vblank IRQs aggressively for power-saving */
+-      adev_to_drm(adev)->vblank_disable_immediate = true;
+-
+       if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) {
+               DRM_ERROR(
+               "amdgpu: failed to initialize sw for display support.\n");
+@@ -4285,6 +4282,14 @@ static int amdgpu_dm_initialize_drm_devi
+       }
++      /*
++       * Disable vblank IRQs aggressively for power-saving.
++       *
++       * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
++       * is also supported.
++       */
++      adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
++
+       /* Software is initialized. Now we can register interrupt handlers. */
+       switch (adev->asic_type) {
+ #if defined(CONFIG_DRM_AMD_DC_SI)
diff --git a/queue-5.16/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch b/queue-5.16/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch
new file mode 100644 (file)
index 0000000..01161ea
--- /dev/null
@@ -0,0 +1,89 @@
+From 4722f463896cc0ef1a6f1c3cb2e171e949831249 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Mon, 17 Jan 2022 10:31:26 +0100
+Subject: drm/radeon: fix error handling in radeon_driver_open_kms
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Christian König <christian.koenig@amd.com>
+
+commit 4722f463896cc0ef1a6f1c3cb2e171e949831249 upstream.
+
+The return value was never initialized so the cleanup code executed when
+it isn't even necessary.
+
+Just add proper error handling.
+
+Fixes: ab50cb9df889 ("drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()")
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Tested-by: Jan Stancek <jstancek@redhat.com>
+Tested-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/radeon/radeon_kms.c |   22 ++++++++++++----------
+ 1 file changed, 12 insertions(+), 10 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_kms.c
++++ b/drivers/gpu/drm/radeon/radeon_kms.c
+@@ -666,18 +666,18 @@ int radeon_driver_open_kms(struct drm_de
+               fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
+               if (unlikely(!fpriv)) {
+                       r = -ENOMEM;
+-                      goto out_suspend;
++                      goto err_suspend;
+               }
+               if (rdev->accel_working) {
+                       vm = &fpriv->vm;
+                       r = radeon_vm_init(rdev, vm);
+                       if (r)
+-                              goto out_fpriv;
++                              goto err_fpriv;
+                       r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+                       if (r)
+-                              goto out_vm_fini;
++                              goto err_vm_fini;
+                       /* map the ib pool buffer read only into
+                        * virtual address space */
+@@ -685,7 +685,7 @@ int radeon_driver_open_kms(struct drm_de
+                                                       rdev->ring_tmp_bo.bo);
+                       if (!vm->ib_bo_va) {
+                               r = -ENOMEM;
+-                              goto out_vm_fini;
++                              goto err_vm_fini;
+                       }
+                       r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va,
+@@ -693,19 +693,21 @@ int radeon_driver_open_kms(struct drm_de
+                                                 RADEON_VM_PAGE_READABLE |
+                                                 RADEON_VM_PAGE_SNOOPED);
+                       if (r)
+-                              goto out_vm_fini;
++                              goto err_vm_fini;
+               }
+               file_priv->driver_priv = fpriv;
+       }
+-      if (!r)
+-              goto out_suspend;
++      pm_runtime_mark_last_busy(dev->dev);
++      pm_runtime_put_autosuspend(dev->dev);
++      return 0;
+-out_vm_fini:
++err_vm_fini:
+       radeon_vm_fini(rdev, vm);
+-out_fpriv:
++err_fpriv:
+       kfree(fpriv);
+-out_suspend:
++
++err_suspend:
+       pm_runtime_mark_last_busy(dev->dev);
+       pm_runtime_put_autosuspend(dev->dev);
+       return r;
diff --git a/queue-5.16/of-base-improve-argument-length-mismatch-error.patch b/queue-5.16/of-base-improve-argument-length-mismatch-error.patch
new file mode 100644 (file)
index 0000000..4688748
--- /dev/null
@@ -0,0 +1,55 @@
+From 5d05b811b5acb92fc581a7b328b36646c86f5ab9 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Thu, 30 Dec 2021 18:31:53 +0200
+Subject: of: base: Improve argument length mismatch error
+
+From: Baruch Siach <baruch@tkos.co.il>
+
+commit 5d05b811b5acb92fc581a7b328b36646c86f5ab9 upstream.
+
+The cells_name field of of_phandle_iterator might be NULL. Use the
+phandle name instead. With this change instead of:
+
+  OF: /soc/pinctrl@1000000: (null) = 3 found 2
+
+We get:
+
+  OF: /soc/pinctrl@1000000: phandle pinctrl@1000000 needs 3, found 2
+
+Which is a more helpful messages making DT debugging easier.
+
+In this particular example the phandle name looks like duplicate of the
+same node name. But note that the first node is the parent node
+(it->parent), while the second is the phandle target (it->node). They
+happen to be the same in the case that triggered this improvement. See
+commit 72cb4c48a46a ("arm64: dts: qcom: ipq6018: Fix gpio-ranges
+property").
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/f6a68e0088a552ea9dfd4d8e3b5b586d92594738.1640881913.git.baruch@tkos.co.il
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/of/base.c |   11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+--- a/drivers/of/base.c
++++ b/drivers/of/base.c
+@@ -1349,9 +1349,14 @@ int of_phandle_iterator_next(struct of_p
+                * property data length
+                */
+               if (it->cur + count > it->list_end) {
+-                      pr_err("%pOF: %s = %d found %td\n",
+-                             it->parent, it->cells_name,
+-                             count, it->list_end - it->cur);
++                      if (it->cells_name)
++                              pr_err("%pOF: %s = %d found %td\n",
++                                      it->parent, it->cells_name,
++                                      count, it->list_end - it->cur);
++                      else
++                              pr_err("%pOF: phandle %s needs %d, found %td\n",
++                                      it->parent, of_node_full_name(it->node),
++                                      count, it->list_end - it->cur);
+                       goto err;
+               }
+       }
diff --git a/queue-5.16/revert-drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-process.patch b/queue-5.16/revert-drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-process.patch
new file mode 100644 (file)
index 0000000..04de88a
--- /dev/null
@@ -0,0 +1,31 @@
+From 8b5da5a458c95ad49571a6a6285800bf13409616 Mon Sep 17 00:00:00 2001
+From: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
+Date: Mon, 10 Jan 2022 12:14:10 -0500
+Subject: Revert "drm/amdgpu: Don't inherit GEM object VMAs in child process"
+
+From: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
+
+commit 8b5da5a458c95ad49571a6a6285800bf13409616 upstream.
+
+This reverts commit fbcdbfde87509d523132b59f661a355c731139d0.
+
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c |    3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+@@ -264,9 +264,6 @@ static int amdgpu_gem_object_mmap(struct
+           !(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
+               vma->vm_flags &= ~VM_MAYWRITE;
+-      if (bo->kfd_bo)
+-              vma->vm_flags |= VM_DONTCOPY;
+-
+       return drm_gem_ttm_mmap(obj, vma);
+ }
index 85cfcdd94d9044dd069fd5105b50a779e754bf9a..98f05df29c4f80994a8c11febcfa721a15f2e10b 100644 (file)
@@ -899,3 +899,7 @@ ext4-destroy-ext4_fc_dentry_cachep-kmemcache-on-module-removal.patch
 ext4-fix-null-ptr-deref-in-__ext4_journal_ensure_credits.patch
 ext4-fix-an-use-after-free-issue-about-data-journal-writeback-mode.patch
 ext4-don-t-use-the-orphan-list-when-migrating-an-inode.patch
+revert-drm-amdgpu-don-t-inherit-gem-object-vmas-in-child-process.patch
+drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch
+drm-amdgpu-display-only-set-vblank_disable_immediate-when-psr-is-not-enabled.patch
+of-base-improve-argument-length-mismatch-error.patch