summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD6
-rw-r--r--amdgpu_shutdown.patch76
3 files changed, 84 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 70cc5f8c1d1..5da272afb56 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = linux-amd-znver2
pkgver = 5.11.v.0
- pkgrel = 2
+ pkgrel = 3
url = https://www.kernel.org/
arch = x86_64
license = GPL2
@@ -19,12 +19,14 @@ pkgbase = linux-amd-znver2
source = linux.install
source = 5013_enable-cpu-optimizations-for-gcc10.patch
source = amdgpu_hdmihotplug.patch
+ source = amdgpu_shutdown.patch
sha256sums = SKIP
sha256sums = 7ca08cf7d1cad0ae4d22fad50e32dc6226fd679bad5d89633ab92b7e7f82cf35
sha256sums = 60c6ba602443e94a9eba3aeee9d194027d69bffaa428c6d055348ebf03681b5c
sha256sums = d590e751ab4cf424b78fd0d57e53d187f07401a68c8b468d17a5f39a337dacf0
sha256sums = 126cd35b1153b69dd8d713f902d09ecc64ce8af2e4fa6f021219a65e62e13875
sha256sums = abbb23f55cd25941d5487084c627f601bfa0ca63e329d580cc5a472b4638aeaa
+ sha256sums = 33ccd96aa615ad9217032535ab9ad88cb885480d33f172beb466bc81020f88fb
pkgname = linux-amd-znver2
pkgdesc = Linux kernel aimed at the znver2 AMD Ryzen CPU based hardware
diff --git a/PKGBUILD b/PKGBUILD
index e8b4fbe91ec..e06402c7494 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgbase=linux-amd-znver2
_srcname=linux
gitver=v5.11
pkgver=5.11.v.0
-pkgrel=2
+pkgrel=3
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
@@ -22,6 +22,8 @@ source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#ta
'5013_enable-cpu-optimizations-for-gcc10.patch'
# AMDgpu HDMI hotplug patch
'amdgpu_hdmihotplug.patch'
+ # AMDgpu shutdown patch for renoir
+ 'amdgpu_shutdown.patch'
)
sha256sums=('SKIP'
#config.x86_64
@@ -34,6 +36,8 @@ sha256sums=('SKIP'
'126cd35b1153b69dd8d713f902d09ecc64ce8af2e4fa6f021219a65e62e13875'
#AMDgpu patch
'abbb23f55cd25941d5487084c627f601bfa0ca63e329d580cc5a472b4638aeaa'
+ #AMDgpu shutdown patch
+ '33ccd96aa615ad9217032535ab9ad88cb885480d33f172beb466bc81020f88fb'
)
_kernelname=${pkgbase#linux}
diff --git a/amdgpu_shutdown.patch b/amdgpu_shutdown.patch
new file mode 100644
index 00000000000..5008e1b2c29
--- /dev/null
+++ b/amdgpu_shutdown.patch
@@ -0,0 +1,76 @@
+From 7cf0e0150921b809cd69d2834789532e8409ffdf Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Thu, 18 Feb 2021 12:05:53 -0500
+Subject: [PATCH] drm/amdgpu: fix shutdown with s0ix
+
+For shutdown needs to be handled differently and s0ix. Add
+a new flag to shutdown and use it to adjust behavior appropriately.
+
+Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1499
+Fixes: 628c36d7b238e2 ("drm/amdgpu: update amdgpu device suspend/resume sequence for s0i3 support")
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: Prike Liang <Prike.Liang@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++--
+ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 ++
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index 2dd19e2e3e23..d4876e586d93 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -1005,6 +1005,7 @@ struct amdgpu_device {
+ /* s3/s4 mask */
+ bool in_suspend;
+ bool in_hibernate;
++ bool in_shutdown;
+
+ atomic_t in_gpu_reset;
+ enum pp_mp1_state mp1_state;
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 7052dc35d278..ecd0201050ac 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -2678,7 +2678,8 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
+ {
+ int i, r;
+
+- if (!amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) {
++ if (adev->in_shutdown ||
++ !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) {
+ amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
+ amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
+ }
+@@ -3741,7 +3742,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
+
+ amdgpu_fence_driver_suspend(adev);
+
+- if (!amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
++ if (adev->in_shutdown ||
++ !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
+ r = amdgpu_device_ip_suspend_phase2(adev);
+ else
+ amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+index 7715f62791b0..f3b91aa55466 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+@@ -1263,6 +1263,7 @@ amdgpu_pci_shutdown(struct pci_dev *pdev)
+ if (amdgpu_ras_intr_triggered())
+ return;
+
++ adev->in_shutdown = true;
+ /* if we are running in a VM, make sure the device
+ * torn down properly on reboot/shutdown.
+ * unfortunately we can't detect certain
+@@ -1272,6 +1273,7 @@ amdgpu_pci_shutdown(struct pci_dev *pdev)
+ adev->mp1_state = PP_MP1_STATE_UNLOAD;
+ amdgpu_device_ip_suspend(adev);
+ adev->mp1_state = PP_MP1_STATE_NONE;
++ adev->in_shutdown = false;
+ }
+
+ static int amdgpu_pmops_suspend(struct device *dev)
+--
+2.29.2