aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-11-22 20:22:24 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-11-23 13:57:14 -0500
commit1db4496f167bcc7c6541d449355ade2e7d339d52 (patch)
tree0711f9a6e480b89ec14f90faef021ff9eee70efb /drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
parentda7800a88c5a3b798f763d6f9f343e9a49860c4f (diff)
drm/amdgpu: fix power state when port pm is unavailable
When PCIe port PM is not enabled (system BIOS is pre-2015 or the pcie_port_pm=off parameter is set), legacy ATPX PM should still be marked as supported. Otherwise the GPU can fail to power on after runtime suspend. This affected a Dell Inspiron 5548. Ideally the BIOS date in the PCI core is lowered to 2013 (the first year where hybrid graphics platforms using power resources was introduced), but that seems more risky at this point and would not solve the pcie_port_pm=off issue. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98505 Reported-and-tested-by: Nayan Deshmukh <nayan26deshmukh@gmail.com> Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: <stable@vger.kernel.org> # 4.8+ Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index dae35a96a694..02ca5dd978f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -34,6 +34,7 @@ struct amdgpu_atpx {
34 34
35static struct amdgpu_atpx_priv { 35static struct amdgpu_atpx_priv {
36 bool atpx_detected; 36 bool atpx_detected;
37 bool bridge_pm_usable;
37 /* handle for device - and atpx */ 38 /* handle for device - and atpx */
38 acpi_handle dhandle; 39 acpi_handle dhandle;
39 acpi_handle other_handle; 40 acpi_handle other_handle;
@@ -205,7 +206,11 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx)
205 atpx->is_hybrid = false; 206 atpx->is_hybrid = false;
206 if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { 207 if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) {
207 printk("ATPX Hybrid Graphics\n"); 208 printk("ATPX Hybrid Graphics\n");
208 atpx->functions.power_cntl = false; 209 /*
210 * Disable legacy PM methods only when pcie port PM is usable,
211 * otherwise the device might fail to power off or power on.
212 */
213 atpx->functions.power_cntl = !amdgpu_atpx_priv.bridge_pm_usable;
209 atpx->is_hybrid = true; 214 atpx->is_hybrid = true;
210 } 215 }
211 216
@@ -480,6 +485,7 @@ static int amdgpu_atpx_power_state(enum vga_switcheroo_client_id id,
480 */ 485 */
481static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) 486static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev)
482{ 487{
488 struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
483 acpi_handle dhandle, atpx_handle; 489 acpi_handle dhandle, atpx_handle;
484 acpi_status status; 490 acpi_status status;
485 491
@@ -494,6 +500,7 @@ static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev)
494 } 500 }
495 amdgpu_atpx_priv.dhandle = dhandle; 501 amdgpu_atpx_priv.dhandle = dhandle;
496 amdgpu_atpx_priv.atpx.handle = atpx_handle; 502 amdgpu_atpx_priv.atpx.handle = atpx_handle;
503 amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3;
497 return true; 504 return true;
498} 505}
499 506