Skip to contentSkip to conversation

radeon important ppc fix

PATCH Jerome Glisse 2 participants 2 messages May 29, 2013 – May 30, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

Can you please apply attached patch, it needs the following commit that is available in Linus git :
d82fb31abc46620b7c22758c75707069f2763646

Cheers,
Jerome

Quoted 1 line

From af30cf3e368733d69529c76a8db1df51ebdb42b5 Mon Sep 17 00:00:00 2001

From: Kleber Sacilotto de Souza <[email protected]>
Date: Fri, 3 May 2013 19:43:13 -0300
Subject: [PATCH] radeon: use max_bus_speed to activate gen2 speeds

radeon currently uses a drm function to get the speed capabilities for the bus, drm_pcie_get_speed_cap_mask. However, this is a non-standard method of performing this detection and this patch changes it to use the max_bus_speed attribute.

From: Lucas Kannebley Tavares <[email protected]>

---
 drivers/gpu/drm/radeon/evergreen.c | 10 +++-------
 drivers/gpu/drm/radeon/r600.c      |  9 ++-------
 drivers/gpu/drm/radeon/rv770.c     |  9 ++-------
 3 files changed, 7 insertions(+), 21 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +3 -7
index 8f9e2d3..8546e3b 100644
@@ -4999,8 +4999,7 @@ void evergreen_fini(struct radeon_device *rdev)
 
 void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
 {
-	u32 link_width_cntl, speed_cntl, mask;
-	int ret;
+	u32 link_width_cntl, speed_cntl;
 
 	if (radeon_pcie_gen2 == 0)
 		return;
@@ -5015,11 +5014,8 @@ void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
 	if (ASIC_IS_X2(rdev))
 		return;
 
-	ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask);
-	if (ret != 0)
-		return;
-
-	if (!(mask & DRM_PCIE_SPEED_50))
+	if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
+		(rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
 		return;
 
 	speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
drivers/gpu/drm/radeon/r600.c +2 -7
index 1a08008..b45e648 100644
@@ -4631,8 +4631,6 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
 {
 	u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp;
 	u16 link_cntl2;
-	u32 mask;
-	int ret;
 
 	if (radeon_pcie_gen2 == 0)
 		return;
@@ -4651,11 +4649,8 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
 	if (rdev->family <= CHIP_R600)
 		return;
 
-	ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask);
-	if (ret != 0)
-		return;
-
-	if (!(mask & DRM_PCIE_SPEED_50))
+	if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
+		(rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
 		return;
 
 	speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
drivers/gpu/drm/radeon/rv770.c +2 -7
index 83f612a..a6af4aa 100644
@@ -2113,8 +2113,6 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev)
 {
 	u32 link_width_cntl, lanes, speed_cntl, tmp;
 	u16 link_cntl2;
-	u32 mask;
-	int ret;
 
 	if (radeon_pcie_gen2 == 0)
 		return;
@@ -2129,11 +2127,8 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev)
 	if (ASIC_IS_X2(rdev))
 		return;
 
-	ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask);
-	if (ret != 0)
-		return;
-
-	if (!(mask & DRM_PCIE_SPEED_50))
+	if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
+		(rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
 		return;
 
 	DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n");
Signature · 1 line
1.7.11.7

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 5 lines · Jerome Glisse

Hi Dave,

Can you please apply attached patch, it needs the following commit that is available in Linus git :
d82fb31abc46620b7c22758c75707069f2763646

This patch is in the pull request I sent out today:
http://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-fixes-3.10&id=7e0e41963740525af702bb23edede8ae9afc4ac0

Alex

Quoted 9 lines

Cheers,
Jerome

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel