diff options
author | Josh Boyer <jwboyer@fedoraproject.org> | 2016-07-14 09:46:51 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@fedoraproject.org> | 2016-07-14 09:53:56 -0400 |
commit | 37cc0dbb68509333dd68e1f1a00d215667ac6c6a (patch) | |
tree | 27d9a85a7ad1bcd746e0165428b54d1e9cd6f276 /drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch | |
parent | aa9a2cd7f65ab55f0708348dd2273ae5bad22ddb (diff) | |
download | kernel-37cc0dbb68509333dd68e1f1a00d215667ac6c6a.tar.gz kernel-37cc0dbb68509333dd68e1f1a00d215667ac6c6a.tar.xz kernel-37cc0dbb68509333dd68e1f1a00d215667ac6c6a.zip |
Add 3 patches from Hans to fix various GPU issues
Diffstat (limited to 'drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch')
-rw-r--r-- | drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch b/drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch new file mode 100644 index 000000000..562d20eb5 --- /dev/null +++ b/drm-amdgpu-Disable-RPM-helpers-while-reprobing.patch @@ -0,0 +1,70 @@ +From patchwork Fri Jul 8 15:37:35 2016 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: drm/amdgpu: Disable RPM helpers while reprobing connectors on resume +From: cpaul@redhat.com +X-Patchwork-Id: 97837 +Message-Id: <1467992256-23832-1-git-send-email-cpaul@redhat.com> +To: amd-gfx@lists.freedesktop.org +Cc: Tom St Denis <tom.stdenis@amd.com>, Jammy Zhou <Jammy.Zhou@amd.com>, + open list <linux-kernel@vger.kernel.org>, stable@vger.kernel.org, + "open list:RADEON and AMDGPU DRM DRIVERS" + <dri-devel@lists.freedesktop.org>, + Alex Deucher <alexander.deucher@amd.com>, Lyude <cpaul@redhat.com>, + Flora Cui <Flora.Cui@amd.com>, + =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>, + Monk Liu <Monk.Liu@amd.com> +Date: Fri, 8 Jul 2016 11:37:35 -0400 + +Just about all of amdgpu's connector probing functions try to acquire +runtime PM refs. If we try to do this in the context of +amdgpu_resume_kms by calling drm_helper_hpd_irq_event(), we end up +deadlocking the system. + +Since we're guaranteed to be holding the spinlock for RPM in +amdgpu_resume_kms, and we already know the GPU is in working order, we +need to prevent the RPM helpers from trying to run during the initial +connector reprobe on resume. + +There's a couple of solutions I've explored for fixing this, but this +one by far seems to be the simplest and most reliable (plus I'm pretty +sure that's what disable_depth is there for anyway). + +Reproduction recipe: + - Get any laptop dual GPUs using PRIME + - Make sure runtime PM is enabled for amdgpu + - Boot the machine + - If the machine managed to boot without hanging, switch out of X to + another VT. This should definitely cause X to hang infinitely. + +Cc: stable@vger.kernel.org +Signed-off-by: Lyude <cpaul@redhat.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +index 6e92008..46c1fee 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -1841,7 +1841,19 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon) + } + + drm_kms_helper_poll_enable(dev); ++ ++ /* ++ * Most of the connector probing functions try to acquire runtime pm ++ * refs to ensure that the GPU is powered on when connector polling is ++ * performed. Since we're calling this from a runtime PM callback, ++ * trying to acquire rpm refs will cause us to deadlock. ++ * ++ * Since we're guaranteed to be holding the rpm lock, it's safe to ++ * temporarily disable the rpm helpers so this doesn't deadlock us. ++ */ ++ dev->dev->power.disable_depth++; + drm_helper_hpd_irq_event(dev); ++ dev->dev->power.disable_depth--; + + if (fbcon) { + amdgpu_fbdev_set_suspend(adev, 0); |