diff mbox

[4.2.y-ckt,stable] Patch "drm/radeon: disable runtime pm on PX laptops without dGPU power control" has been added to the 4.2.y-ckt tree

Message ID 1459381919-3097-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa March 30, 2016, 11:51 p.m. UTC
This is a note to let you know that I have just added a patch titled

    drm/radeon: disable runtime pm on PX laptops without dGPU power control

to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt7.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

---8<------------------------------------------------------------

From 33a743973da430e566f4ec0b88f078cafa5a19d9 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Wed, 2 Mar 2016 11:47:29 -0500
Subject: drm/radeon: disable runtime pm on PX laptops without dGPU power
 control
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

commit e64c952efb8e0c15ae82cec8e455ab4910690ef1 upstream.

Some PX laptops don't provide an ACPI method to control dGPU power.  On
those systems, the driver is responsible for handling the dGPU power
state.  Disable runtime PM on them until support for this is implemented.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 8 ++++----
 drivers/gpu/drm/radeon/radeon_device.c       | 8 +++++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

--
2.7.4

Comments

Michel Dänzer March 31, 2016, 1:21 a.m. UTC | #1
On 31.03.2016 08:51, Kamal Mostafa wrote:
> This is a note to let you know that I have just added a patch titled
> 
>     drm/radeon: disable runtime pm on PX laptops without dGPU power control
> 
> to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
> which can be found at:
> 
>     http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
> 
> This patch is scheduled to be released in version 4.2.8-ckt7.
> 
> If you, or anyone else, feels it should not be added to this tree, please 
> reply to this email.

A regression was bisected to this commit:

https://bugzilla.kernel.org/show_bug.cgi?id=115321

So it's probably better to hold off on backporting this commit (and
possibly the corresponding amdgpu commit as well).
Kamal Mostafa March 31, 2016, 3:42 p.m. UTC | #2
On Thu, Mar 31, 2016 at 10:21:48AM +0900, Michel Dänzer wrote:
> On 31.03.2016 08:51, Kamal Mostafa wrote:
> > This is a note to let you know that I have just added a patch titled
> > 
> >     drm/radeon: disable runtime pm on PX laptops without dGPU power control
> > 
> > to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
> > which can be found at:
> > 
> >     http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
> > 
> > This patch is scheduled to be released in version 4.2.8-ckt7.
> > 
> > If you, or anyone else, feels it should not be added to this tree, please 
> > reply to this email.
> 
> A regression was bisected to this commit:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=115321
> 
> So it's probably better to hold off on backporting this commit (and
> possibly the corresponding amdgpu commit as well).


Okay, dropped from the 4.2-stable queue:

e64c952 drm/radeon: disable runtime pm on PX laptops without dGPU power control
bedf2a6 drm/amdgpu: disable runtime pm on PX laptops without dGPU power control

Thanks for the heads-up, Michel!

 -Kamal
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index 8bc7d0b..1523cf9 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -62,6 +62,10 @@  bool radeon_has_atpx(void) {
 	return radeon_atpx_priv.atpx_detected;
 }

+bool radeon_has_atpx_dgpu_power_cntl(void) {
+	return radeon_atpx_priv.atpx.functions.power_cntl;
+}
+
 /**
  * radeon_atpx_call - call an ATPX method
  *
@@ -141,10 +145,6 @@  static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas
  */
 static int radeon_atpx_validate(struct radeon_atpx *atpx)
 {
-	/* make sure required functions are enabled */
-	/* dGPU power control is required */
-	atpx->functions.power_cntl = true;
-
 	if (atpx->functions.px_params) {
 		union acpi_object *info;
 		struct atpx_px_params output;
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index d8319da..94d3d3b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -103,6 +103,12 @@  static const char radeon_family_name[][16] = {
 	"LAST",
 };

+#if defined(CONFIG_VGA_SWITCHEROO)
+bool radeon_has_atpx_dgpu_power_cntl(void);
+#else
+static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
+#endif
+
 #define RADEON_PX_QUIRK_DISABLE_PX  (1 << 0)
 #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)

@@ -1433,7 +1439,7 @@  int radeon_device_init(struct radeon_device *rdev,
 	 * ignore it */
 	vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);

-	if (rdev->flags & RADEON_IS_PX)
+	if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
 		runtime = true;
 	vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
 	if (runtime)