From: Greg Kroah-Hartman Date: Tue, 20 May 2025 11:35:15 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v5.15.184~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d929e95c9910bc32b604066a5cf21906484262d;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: drm-amdgpu-fix-pm-notifier-handling.patch phy-tegra-xusb-remove-a-stray-unlock.patch --- diff --git a/queue-6.6/drm-amdgpu-fix-pm-notifier-handling.patch b/queue-6.6/drm-amdgpu-fix-pm-notifier-handling.patch new file mode 100644 index 0000000000..ff40623cbe --- /dev/null +++ b/queue-6.6/drm-amdgpu-fix-pm-notifier-handling.patch @@ -0,0 +1,94 @@ +From 4aaffc85751da5722e858e4333e8cf0aa4b6c78f Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 1 May 2025 13:46:46 -0400 +Subject: drm/amdgpu: fix pm notifier handling + +From: Alex Deucher + +commit 4aaffc85751da5722e858e4333e8cf0aa4b6c78f upstream. + +Set the s3/s0ix and s4 flags in the pm notifier so that we can skip +the resource evictions properly in pm prepare based on whether +we are suspending or hibernating. Drop the eviction as processes +are not frozen at this time, we we can end up getting stuck trying +to evict VRAM while applications continue to submit work which +causes the buffers to get pulled back into VRAM. + +v2: Move suspend flags out of pm notifier (Mario) + +Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4178 +Fixes: 2965e6355dcd ("drm/amd: Add Suspend/Hibernate notification callback support") +Cc: Mario Limonciello +Reviewed-by: Mario Limonciello +Signed-off-by: Alex Deucher +(cherry picked from commit 06f2dcc241e7e5c681f81fbc46cacdf4bfd7d6d7) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 +++++------------- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +--------- + 2 files changed, 6 insertions(+), 22 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -4125,28 +4125,20 @@ static int amdgpu_device_evict_resources + * @data: data + * + * This function is called when the system is about to suspend or hibernate. +- * It is used to evict resources from the device before the system goes to +- * sleep while there is still access to swap. ++ * It is used to set the appropriate flags so that eviction can be optimized ++ * in the pm prepare callback. + */ + static int amdgpu_device_pm_notifier(struct notifier_block *nb, unsigned long mode, + void *data) + { + struct amdgpu_device *adev = container_of(nb, struct amdgpu_device, pm_nb); +- int r; + + switch (mode) { + case PM_HIBERNATION_PREPARE: + adev->in_s4 = true; +- fallthrough; +- case PM_SUSPEND_PREPARE: +- r = amdgpu_device_evict_resources(adev); +- /* +- * This is considered non-fatal at this time because +- * amdgpu_device_prepare() will also fatally evict resources. +- * See https://gitlab.freedesktop.org/drm/amd/-/issues/3781 +- */ +- if (r) +- drm_warn(adev_to_drm(adev), "Failed to evict resources, freeze active processes if problems occur: %d\n", r); ++ break; ++ case PM_POST_HIBERNATION: ++ adev->in_s4 = false; + break; + } + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -2475,13 +2475,8 @@ static int amdgpu_pmops_freeze(struct de + static int amdgpu_pmops_thaw(struct device *dev) + { + struct drm_device *drm_dev = dev_get_drvdata(dev); +- struct amdgpu_device *adev = drm_to_adev(drm_dev); +- int r; + +- r = amdgpu_device_resume(drm_dev, true); +- adev->in_s4 = false; +- +- return r; ++ return amdgpu_device_resume(drm_dev, true); + } + + static int amdgpu_pmops_poweroff(struct device *dev) +@@ -2494,9 +2489,6 @@ static int amdgpu_pmops_poweroff(struct + static int amdgpu_pmops_restore(struct device *dev) + { + struct drm_device *drm_dev = dev_get_drvdata(dev); +- struct amdgpu_device *adev = drm_to_adev(drm_dev); +- +- adev->in_s4 = false; + + return amdgpu_device_resume(drm_dev, true); + } diff --git a/queue-6.6/phy-tegra-xusb-remove-a-stray-unlock.patch b/queue-6.6/phy-tegra-xusb-remove-a-stray-unlock.patch new file mode 100644 index 0000000000..dd92c26b50 --- /dev/null +++ b/queue-6.6/phy-tegra-xusb-remove-a-stray-unlock.patch @@ -0,0 +1,35 @@ +From 83c178470e0bf690d34c8c08440f2421b82e881c Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 23 Apr 2025 16:08:23 +0300 +Subject: phy: tegra: xusb: remove a stray unlock + +From: Dan Carpenter + +commit 83c178470e0bf690d34c8c08440f2421b82e881c upstream. + +We used to take a lock in tegra186_utmi_bias_pad_power_on() but now we +have moved the lock into the caller. Unfortunately, when we moved the +lock this unlock was left behind and it results in a double unlock. +Delete it now. + +Fixes: b47158fb4295 ("phy: tegra: xusb: Use a bitmask for UTMI pad power state tracking") +Signed-off-by: Dan Carpenter +Reviewed-by: Jon Hunter +Link: https://lore.kernel.org/r/aAjmR6To4EnvRl4G@stanley.mountain +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/phy/tegra/xusb-tegra186.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/phy/tegra/xusb-tegra186.c ++++ b/drivers/phy/tegra/xusb-tegra186.c +@@ -656,8 +656,6 @@ static void tegra186_utmi_bias_pad_power + } else { + clk_disable_unprepare(priv->usb2_trk_clk); + } +- +- mutex_unlock(&padctl->lock); + } + + static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl) diff --git a/queue-6.6/series b/queue-6.6/series index 0b721d581b..5178ffeb45 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -113,3 +113,5 @@ memblock-accept-allocated-memory-before-use-in-memblock_double_array.patch hwpoison-memory_hotplug-lock-folio-before-unmap-hwpoisoned-folio.patch sctp-add-mutual-exclusion-in-proc_sctp_do_udp_port.patch btrfs-don-t-bug_on-when-0-reference-count-at-btrfs_lookup_extent_info.patch +phy-tegra-xusb-remove-a-stray-unlock.patch +drm-amdgpu-fix-pm-notifier-handling.patch