diff mbox

[SRU,Trusty,Utopic,Vivid,1/1] drm/radeon: add a dpm quirk list

Message ID 1d1b2e9f8c3f7623ef542cfee424de0c95f3d71a.1420754721.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury Jan. 8, 2015, 10:28 p.m. UTC
From: Alex Deucher <alexander.deucher@amd.com>

BugLink: http://bugs.launchpad.net/bugs/1386534

Disable dpm on certain problematic boards rather than
disabling dpm for the entire chip family since most
boards work fine.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_pm.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Andy Whitcroft Jan. 9, 2015, 11:42 a.m. UTC | #1
On Thu, Jan 08, 2015 at 05:28:52PM -0500, Joseph Salisbury wrote:
> From: Alex Deucher <alexander.deucher@amd.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1386534
> 
> Disable dpm on certain problematic boards rather than
> disabling dpm for the entire chip family since most
> boards work fine.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> ---
>  drivers/gpu/drm/radeon/radeon_pm.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index 50d6ff9..4d48e00 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1287,8 +1287,39 @@ dpm_failed:
>  	return ret;
>  }
>  
> +struct radeon_dpm_quirk {
> +	u32 chip_vendor;
> +	u32 chip_device;
> +	u32 subsys_vendor;
> +	u32 subsys_device;
> +};
> +
> +/* cards with dpm stability problems */
> +static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
> +	/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
> +	{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
> +	/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
> +	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
> +	{ 0, 0, 0, 0 },
> +};
> +
>  int radeon_pm_init(struct radeon_device *rdev)
>  {
> +	struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
> +	bool disable_dpm = false;
> +
> +	/* Apply dpm quirks */
> +	while (p && p->chip_device != 0) {
> +		if (rdev->pdev->vendor == p->chip_vendor &&
> +		    rdev->pdev->device == p->chip_device &&
> +		    rdev->pdev->subsystem_vendor == p->subsys_vendor &&
> +		    rdev->pdev->subsystem_device == p->subsys_device) {
> +			disable_dpm = true;
> +			break;
> +		}
> +		++p;
> +	}
> +
>  	/* enable dpm on rv6xx+ */
>  	switch (rdev->family) {
>  	case CHIP_RV610:
> @@ -1344,6 +1375,8 @@ int radeon_pm_init(struct radeon_device *rdev)
>  			 (!(rdev->flags & RADEON_IS_IGP)) &&
>  			 (!rdev->smc_fw))
>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
> +		else if (disable_dpm && (radeon_dpm == -1))
> +			rdev->pm.pm_method = PM_METHOD_PROFILE;
>  		else if (radeon_dpm == 0)
>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
>  		else
> -- 

This patch looks ok per-see, though I would rather see this upstream at
least in linus' tree if we can.

-apw
Joseph Salisbury Jan. 9, 2015, 4:05 p.m. UTC | #2
On 01/09/2015 06:42 AM, Andy Whitcroft wrote:
> On Thu, Jan 08, 2015 at 05:28:52PM -0500, Joseph Salisbury wrote:
>> From: Alex Deucher <alexander.deucher@amd.com>
>>
>> BugLink: http://bugs.launchpad.net/bugs/1386534
>>
>> Disable dpm on certain problematic boards rather than
>> disabling dpm for the entire chip family since most
>> boards work fine.
>>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
>> ---
>>  drivers/gpu/drm/radeon/radeon_pm.c | 33 +++++++++++++++++++++++++++++++++
>>  1 file changed, 33 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
>> index 50d6ff9..4d48e00 100644
>> --- a/drivers/gpu/drm/radeon/radeon_pm.c
>> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
>> @@ -1287,8 +1287,39 @@ dpm_failed:
>>  	return ret;
>>  }
>>  
>> +struct radeon_dpm_quirk {
>> +	u32 chip_vendor;
>> +	u32 chip_device;
>> +	u32 subsys_vendor;
>> +	u32 subsys_device;
>> +};
>> +
>> +/* cards with dpm stability problems */
>> +static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
>> +	/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
>> +	{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
>> +	/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
>> +	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
>> +	{ 0, 0, 0, 0 },
>> +};
>> +
>>  int radeon_pm_init(struct radeon_device *rdev)
>>  {
>> +	struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
>> +	bool disable_dpm = false;
>> +
>> +	/* Apply dpm quirks */
>> +	while (p && p->chip_device != 0) {
>> +		if (rdev->pdev->vendor == p->chip_vendor &&
>> +		    rdev->pdev->device == p->chip_device &&
>> +		    rdev->pdev->subsystem_vendor == p->subsys_vendor &&
>> +		    rdev->pdev->subsystem_device == p->subsys_device) {
>> +			disable_dpm = true;
>> +			break;
>> +		}
>> +		++p;
>> +	}
>> +
>>  	/* enable dpm on rv6xx+ */
>>  	switch (rdev->family) {
>>  	case CHIP_RV610:
>> @@ -1344,6 +1375,8 @@ int radeon_pm_init(struct radeon_device *rdev)
>>  			 (!(rdev->flags & RADEON_IS_IGP)) &&
>>  			 (!rdev->smc_fw))
>>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
>> +		else if (disable_dpm && (radeon_dpm == -1))
>> +			rdev->pm.pm_method = PM_METHOD_PROFILE;
>>  		else if (radeon_dpm == 0)
>>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
>>  		else
>> -- 
> This patch looks ok per-see, though I would rather see this upstream at
> least in linus' tree if we can.
>
> -apw

The patch author also sent it for inclusion in mainline and cc'd stable.
Andy Whitcroft Jan. 16, 2015, 12:24 p.m. UTC | #3
On Fri, Jan 09, 2015 at 11:05:07AM -0500, Joseph Salisbury wrote:
> On 01/09/2015 06:42 AM, Andy Whitcroft wrote:
> > On Thu, Jan 08, 2015 at 05:28:52PM -0500, Joseph Salisbury wrote:
> >> From: Alex Deucher <alexander.deucher@amd.com>
> >>
> >> BugLink: http://bugs.launchpad.net/bugs/1386534
> >>
> >> Disable dpm on certain problematic boards rather than
> >> disabling dpm for the entire chip family since most
> >> boards work fine.
> >>
> >> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> >> Cc: stable@vger.kernel.org
> >> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> >> ---
> >>  drivers/gpu/drm/radeon/radeon_pm.c | 33 +++++++++++++++++++++++++++++++++
> >>  1 file changed, 33 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> >> index 50d6ff9..4d48e00 100644
> >> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> >> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> >> @@ -1287,8 +1287,39 @@ dpm_failed:
> >>  	return ret;
> >>  }
> >>  
> >> +struct radeon_dpm_quirk {
> >> +	u32 chip_vendor;
> >> +	u32 chip_device;
> >> +	u32 subsys_vendor;
> >> +	u32 subsys_device;
> >> +};
> >> +
> >> +/* cards with dpm stability problems */
> >> +static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
> >> +	/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
> >> +	{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
> >> +	/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
> >> +	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
> >> +	{ 0, 0, 0, 0 },
> >> +};
> >> +
> >>  int radeon_pm_init(struct radeon_device *rdev)
> >>  {
> >> +	struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
> >> +	bool disable_dpm = false;
> >> +
> >> +	/* Apply dpm quirks */
> >> +	while (p && p->chip_device != 0) {
> >> +		if (rdev->pdev->vendor == p->chip_vendor &&
> >> +		    rdev->pdev->device == p->chip_device &&
> >> +		    rdev->pdev->subsystem_vendor == p->subsys_vendor &&
> >> +		    rdev->pdev->subsystem_device == p->subsys_device) {
> >> +			disable_dpm = true;
> >> +			break;
> >> +		}
> >> +		++p;
> >> +	}
> >> +
> >>  	/* enable dpm on rv6xx+ */
> >>  	switch (rdev->family) {
> >>  	case CHIP_RV610:
> >> @@ -1344,6 +1375,8 @@ int radeon_pm_init(struct radeon_device *rdev)
> >>  			 (!(rdev->flags & RADEON_IS_IGP)) &&
> >>  			 (!rdev->smc_fw))
> >>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
> >> +		else if (disable_dpm && (radeon_dpm == -1))
> >> +			rdev->pm.pm_method = PM_METHOD_PROFILE;
> >>  		else if (radeon_dpm == 0)
> >>  			rdev->pm.pm_method = PM_METHOD_PROFILE;
> >>  		else
> >> -- 
> > This patch looks ok per-see, though I would rather see this upstream at
> > least in linus' tree if we can.
> >
> > -apw
> 
> The patch author also sent it for inclusion in mainline and cc'd stable.   

I see the pull request for this on LKML, and it is marked for stable.  I
believe though not yet merged to linus' tree that the sha1s are very
likley stable, so I have marked the bug up so it will close out when it
does hit linus and stable.

-apw
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 50d6ff9..4d48e00 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1287,8 +1287,39 @@  dpm_failed:
 	return ret;
 }
 
+struct radeon_dpm_quirk {
+	u32 chip_vendor;
+	u32 chip_device;
+	u32 subsys_vendor;
+	u32 subsys_device;
+};
+
+/* cards with dpm stability problems */
+static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
+	/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
+	{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
+	/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
+	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
+	{ 0, 0, 0, 0 },
+};
+
 int radeon_pm_init(struct radeon_device *rdev)
 {
+	struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
+	bool disable_dpm = false;
+
+	/* Apply dpm quirks */
+	while (p && p->chip_device != 0) {
+		if (rdev->pdev->vendor == p->chip_vendor &&
+		    rdev->pdev->device == p->chip_device &&
+		    rdev->pdev->subsystem_vendor == p->subsys_vendor &&
+		    rdev->pdev->subsystem_device == p->subsys_device) {
+			disable_dpm = true;
+			break;
+		}
+		++p;
+	}
+
 	/* enable dpm on rv6xx+ */
 	switch (rdev->family) {
 	case CHIP_RV610:
@@ -1344,6 +1375,8 @@  int radeon_pm_init(struct radeon_device *rdev)
 			 (!(rdev->flags & RADEON_IS_IGP)) &&
 			 (!rdev->smc_fw))
 			rdev->pm.pm_method = PM_METHOD_PROFILE;
+		else if (disable_dpm && (radeon_dpm == -1))
+			rdev->pm.pm_method = PM_METHOD_PROFILE;
 		else if (radeon_dpm == 0)
 			rdev->pm.pm_method = PM_METHOD_PROFILE;
 		else