From: Greg Kroah-Hartman Date: Mon, 5 Dec 2016 14:47:43 +0000 (+0100) Subject: 4.8-stable patches X-Git-Tag: v4.8.13~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca06de7cc373fad54f046bb15378c27cef1e427d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: drm-amdgpu-fix-check-for-port-pm-availability.patch drm-amdgpu-fix-power-state-when-port-pm-is-unavailable.patch drm-radeon-fix-check-for-port-pm-availability.patch drm-radeon-fix-power-state-when-port-pm-is-unavailable-v2.patch --- diff --git a/queue-4.8/drm-amdgpu-fix-check-for-port-pm-availability.patch b/queue-4.8/drm-amdgpu-fix-check-for-port-pm-availability.patch new file mode 100644 index 00000000000..1219c3880e7 --- /dev/null +++ b/queue-4.8/drm-amdgpu-fix-check-for-port-pm-availability.patch @@ -0,0 +1,77 @@ +From 7ac33e47d5769632010e537964c7e45498f8dc26 Mon Sep 17 00:00:00 2001 +From: Peter Wu +Date: Sat, 26 Nov 2016 15:05:01 +0100 +Subject: drm/amdgpu: fix check for port PM availability + +From: Peter Wu + +commit 7ac33e47d5769632010e537964c7e45498f8dc26 upstream. + +The ATPX method does not always exist on the dGPU, it may be located at +the iGPU. The parent device of the iGPU is the root port for which +bridge_d3 is false. This accidentally enables the legacy PM method which +conflicts with port PM and prevented the dGPU from powering on. + +Fixes: 1db4496f167b ("drm/amdgpu: fix power state when port pm is unavailable") + +Reported-and-tested-by: Mike Lothian +Signed-off-by: Peter Wu +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +@@ -476,7 +476,6 @@ static int amdgpu_atpx_power_state(enum + */ + static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) + { +- struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + acpi_handle dhandle, atpx_handle; + acpi_status status; + +@@ -491,7 +490,6 @@ static bool amdgpu_atpx_pci_probe_handle + } + amdgpu_atpx_priv.dhandle = dhandle; + amdgpu_atpx_priv.atpx.handle = atpx_handle; +- amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; + return true; + } + +@@ -553,17 +551,25 @@ static bool amdgpu_atpx_detect(void) + struct pci_dev *pdev = NULL; + bool has_atpx = false; + int vga_count = 0; ++ bool d3_supported = false; ++ struct pci_dev *parent_pdev; + + while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { + vga_count++; + + has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true); ++ ++ parent_pdev = pci_upstream_bridge(pdev); ++ d3_supported |= parent_pdev && parent_pdev->bridge_d3; + } + + while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { + vga_count++; + + has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true); ++ ++ parent_pdev = pci_upstream_bridge(pdev); ++ d3_supported |= parent_pdev && parent_pdev->bridge_d3; + } + + if (has_atpx && vga_count == 2) { +@@ -571,6 +577,7 @@ static bool amdgpu_atpx_detect(void) + printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n", + acpi_method_name); + amdgpu_atpx_priv.atpx_detected = true; ++ amdgpu_atpx_priv.bridge_pm_usable = d3_supported; + amdgpu_atpx_init(); + return true; + } diff --git a/queue-4.8/drm-amdgpu-fix-power-state-when-port-pm-is-unavailable.patch b/queue-4.8/drm-amdgpu-fix-power-state-when-port-pm-is-unavailable.patch new file mode 100644 index 00000000000..5c0564082f0 --- /dev/null +++ b/queue-4.8/drm-amdgpu-fix-power-state-when-port-pm-is-unavailable.patch @@ -0,0 +1,73 @@ +From 1db4496f167bcc7c6541d449355ade2e7d339d52 Mon Sep 17 00:00:00 2001 +From: Peter Wu +Date: Wed, 23 Nov 2016 02:22:24 +0100 +Subject: drm/amdgpu: fix power state when port pm is unavailable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Peter Wu + +commit 1db4496f167bcc7c6541d449355ade2e7d339d52 upstream. + +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 +Signed-off-by: Peter Wu +Signed-off-by: Alex Deucher +Acked-by: Christian König +Reviewed-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +@@ -33,6 +33,7 @@ struct amdgpu_atpx { + + static struct amdgpu_atpx_priv { + bool atpx_detected; ++ bool bridge_pm_usable; + /* handle for device - and atpx */ + acpi_handle dhandle; + acpi_handle other_handle; +@@ -200,7 +201,11 @@ static int amdgpu_atpx_validate(struct a + atpx->is_hybrid = false; + if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { + printk("ATPX Hybrid Graphics\n"); +- atpx->functions.power_cntl = false; ++ /* ++ * Disable legacy PM methods only when pcie port PM is usable, ++ * otherwise the device might fail to power off or power on. ++ */ ++ atpx->functions.power_cntl = !amdgpu_atpx_priv.bridge_pm_usable; + atpx->is_hybrid = true; + } + +@@ -471,6 +476,7 @@ static int amdgpu_atpx_power_state(enum + */ + static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) + { ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + acpi_handle dhandle, atpx_handle; + acpi_status status; + +@@ -485,6 +491,7 @@ static bool amdgpu_atpx_pci_probe_handle + } + amdgpu_atpx_priv.dhandle = dhandle; + amdgpu_atpx_priv.atpx.handle = atpx_handle; ++ amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; + return true; + } + diff --git a/queue-4.8/drm-radeon-fix-check-for-port-pm-availability.patch b/queue-4.8/drm-radeon-fix-check-for-port-pm-availability.patch new file mode 100644 index 00000000000..c24ac44216f --- /dev/null +++ b/queue-4.8/drm-radeon-fix-check-for-port-pm-availability.patch @@ -0,0 +1,80 @@ +From bcfdd5d5105087e6f33dfeb08a1ca6b2c0287b61 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 28 Nov 2016 17:23:40 -0500 +Subject: drm/radeon: fix check for port PM availability + +From: Alex Deucher + +commit bcfdd5d5105087e6f33dfeb08a1ca6b2c0287b61 upstream. + +The ATPX method does not always exist on the dGPU, it may be located at +the iGPU. The parent device of the iGPU is the root port for which +bridge_d3 is false. This accidentally enables the legacy PM method which +conflicts with port PM and prevented the dGPU from powering on. + +Ported from amdgpu commit: +drm/amdgpu: fix check for port PM availability +from Peter Wu. + +Fixes: d3ac31f3b4bf9fad (drm/radeon: fix power state when port pm is unavailable (v2)) +Signed-off-by: Alex Deucher +Cc: Peter Wu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_atpx_handler.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c ++++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c +@@ -474,7 +474,6 @@ static int radeon_atpx_power_state(enum + */ + static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) + { +- struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + acpi_handle dhandle, atpx_handle; + acpi_status status; + +@@ -488,7 +487,6 @@ static bool radeon_atpx_pci_probe_handle + + radeon_atpx_priv.dhandle = dhandle; + radeon_atpx_priv.atpx.handle = atpx_handle; +- radeon_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; + return true; + } + +@@ -550,11 +548,16 @@ static bool radeon_atpx_detect(void) + struct pci_dev *pdev = NULL; + bool has_atpx = false; + int vga_count = 0; ++ bool d3_supported = false; ++ struct pci_dev *parent_pdev; + + while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { + vga_count++; + + has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); ++ ++ parent_pdev = pci_upstream_bridge(pdev); ++ d3_supported |= parent_pdev && parent_pdev->bridge_d3; + } + + /* some newer PX laptops mark the dGPU as a non-VGA display device */ +@@ -562,6 +565,9 @@ static bool radeon_atpx_detect(void) + vga_count++; + + has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); ++ ++ parent_pdev = pci_upstream_bridge(pdev); ++ d3_supported |= parent_pdev && parent_pdev->bridge_d3; + } + + if (has_atpx && vga_count == 2) { +@@ -569,6 +575,7 @@ static bool radeon_atpx_detect(void) + printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n", + acpi_method_name); + radeon_atpx_priv.atpx_detected = true; ++ radeon_atpx_priv.bridge_pm_usable = d3_supported; + radeon_atpx_init(); + return true; + } diff --git a/queue-4.8/drm-radeon-fix-power-state-when-port-pm-is-unavailable-v2.patch b/queue-4.8/drm-radeon-fix-power-state-when-port-pm-is-unavailable-v2.patch new file mode 100644 index 00000000000..9f2de752853 --- /dev/null +++ b/queue-4.8/drm-radeon-fix-power-state-when-port-pm-is-unavailable-v2.patch @@ -0,0 +1,70 @@ +From d3ac31f3b4bf9fade93d69770cb9c34912e017be Mon Sep 17 00:00:00 2001 +From: Peter Wu +Date: Wed, 23 Nov 2016 02:22:25 +0100 +Subject: drm/radeon: fix power state when port pm is unavailable (v2) + +From: Peter Wu + +commit d3ac31f3b4bf9fade93d69770cb9c34912e017be upstream. + +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. + +v2: agd: fix typo + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98505 +Signed-off-by: Peter Wu +Signed-off-by: Alex Deucher +Reviewed-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_atpx_handler.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c ++++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c +@@ -33,6 +33,7 @@ struct radeon_atpx { + + static struct radeon_atpx_priv { + bool atpx_detected; ++ bool bridge_pm_usable; + /* handle for device - and atpx */ + acpi_handle dhandle; + struct radeon_atpx atpx; +@@ -198,7 +199,11 @@ static int radeon_atpx_validate(struct r + atpx->is_hybrid = false; + if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { + printk("ATPX Hybrid Graphics\n"); +- atpx->functions.power_cntl = false; ++ /* ++ * Disable legacy PM methods only when pcie port PM is usable, ++ * otherwise the device might fail to power off or power on. ++ */ ++ atpx->functions.power_cntl = !radeon_atpx_priv.bridge_pm_usable; + atpx->is_hybrid = true; + } + +@@ -469,6 +474,7 @@ static int radeon_atpx_power_state(enum + */ + static bool radeon_atpx_pci_probe_handle(struct pci_dev *pdev) + { ++ struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); + acpi_handle dhandle, atpx_handle; + acpi_status status; + +@@ -482,6 +488,7 @@ static bool radeon_atpx_pci_probe_handle + + radeon_atpx_priv.dhandle = dhandle; + radeon_atpx_priv.atpx.handle = atpx_handle; ++ radeon_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; + return true; + } + diff --git a/queue-4.8/series b/queue-4.8/series index 09a46d959ad..f206a903945 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -19,3 +19,7 @@ mwifiex-printk-overflow-with-32-byte-ssids.patch kvm-arm-arm64-vgic-don-t-notify-eoi-for-non-spis.patch drm-i915-don-t-touch-null-sg-on-i915_gem_object_get_pages_gtt-error.patch drm-i915-drop-the-struct_mutex-when-wedged-or-trying-to-reset.patch +drm-amdgpu-fix-power-state-when-port-pm-is-unavailable.patch +drm-radeon-fix-power-state-when-port-pm-is-unavailable-v2.patch +drm-amdgpu-fix-check-for-port-pm-availability.patch +drm-radeon-fix-check-for-port-pm-availability.patch