Skip to content

Commit

Permalink
drm/radeon: always program the MC on startup
Browse files Browse the repository at this point in the history
For r6xx+ asics.  This mirrors the behavior of pre-r6xx
asics.  We need to program the MC even if something
else in startup() fails.  Failure to do so results in
an unusable GPU.

Based on a fix from: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Alex Deucher committed Aug 7, 2013
1 parent 1518dd8 commit 6fab3fe
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -5954,6 +5954,8 @@ static int cik_startup(struct radeon_device *rdev)
struct radeon_ring *ring;
int r;

cik_mc_program(rdev);

if (rdev->flags & RADEON_IS_IGP) {
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw ||
!rdev->mec_fw || !rdev->sdma_fw || !rdev->rlc_fw) {
Expand Down Expand Up @@ -5985,7 +5987,6 @@ static int cik_startup(struct radeon_device *rdev)
if (r)
return r;

cik_mc_program(rdev);
r = cik_pcie_gart_enable(rdev);
if (r)
return r;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5106,6 +5106,8 @@ static int evergreen_startup(struct radeon_device *rdev)
/* enable aspm */
evergreen_program_aspm(rdev);

evergreen_mc_program(rdev);

if (ASIC_IS_DCE5(rdev)) {
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw || !rdev->mc_fw) {
r = ni_init_microcode(rdev);
Expand Down Expand Up @@ -5133,7 +5135,6 @@ static int evergreen_startup(struct radeon_device *rdev)
if (r)
return r;

evergreen_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) {
evergreen_agp_enable(rdev);
} else {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,8 @@ static int cayman_startup(struct radeon_device *rdev)
/* enable aspm */
evergreen_program_aspm(rdev);

evergreen_mc_program(rdev);

if (rdev->flags & RADEON_IS_IGP) {
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = ni_init_microcode(rdev);
Expand Down Expand Up @@ -2107,7 +2109,6 @@ static int cayman_startup(struct radeon_device *rdev)
if (r)
return r;

evergreen_mc_program(rdev);
r = cayman_pcie_gart_enable(rdev);
if (r)
return r;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,8 @@ static int r600_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */
r600_pcie_gen2_enable(rdev);

r600_mc_program(rdev);

if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = r600_init_microcode(rdev);
if (r) {
Expand All @@ -3342,7 +3344,6 @@ static int r600_startup(struct radeon_device *rdev)
if (r)
return r;

r600_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) {
r600_agp_enable(rdev);
} else {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/rv770.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,8 @@ static int rv770_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */
rv770_pcie_gen2_enable(rdev);

rv770_mc_program(rdev);

if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = r600_init_microcode(rdev);
if (r) {
Expand All @@ -1841,7 +1843,6 @@ static int rv770_startup(struct radeon_device *rdev)
if (r)
return r;

rv770_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) {
rv770_agp_enable(rdev);
} else {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -6418,6 +6418,8 @@ static int si_startup(struct radeon_device *rdev)
/* enable aspm */
si_program_aspm(rdev);

si_mc_program(rdev);

if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw ||
!rdev->rlc_fw || !rdev->mc_fw) {
r = si_init_microcode(rdev);
Expand All @@ -6437,7 +6439,6 @@ static int si_startup(struct radeon_device *rdev)
if (r)
return r;

si_mc_program(rdev);
r = si_pcie_gart_enable(rdev);
if (r)
return r;
Expand Down

0 comments on commit 6fab3fe

Please sign in to comment.