Commit 309fabaf authored by Alex Deucher's avatar Alex Deucher Committed by Greg Kroah-Hartman

drm/radeon: always program the MC on startup

commit 6fab3feb upstream.

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: default avatarAlex Deucher <alexander.deucher@amd.com>
[wml: Backported to 3.4:
- adjust context
- drop changes to cik.c]
Signed-off-by: default avatarWeng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9d3e8ed
...@@ -3219,6 +3219,8 @@ static int evergreen_startup(struct radeon_device *rdev) ...@@ -3219,6 +3219,8 @@ static int evergreen_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */ /* enable pcie gen2 link */
evergreen_pcie_gen2_enable(rdev); evergreen_pcie_gen2_enable(rdev);
evergreen_mc_program(rdev);
if (ASIC_IS_DCE5(rdev)) { if (ASIC_IS_DCE5(rdev)) {
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw || !rdev->mc_fw) { if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw || !rdev->mc_fw) {
r = ni_init_microcode(rdev); r = ni_init_microcode(rdev);
...@@ -3246,7 +3248,6 @@ static int evergreen_startup(struct radeon_device *rdev) ...@@ -3246,7 +3248,6 @@ static int evergreen_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
evergreen_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) { if (rdev->flags & RADEON_IS_AGP) {
evergreen_agp_enable(rdev); evergreen_agp_enable(rdev);
} else { } else {
......
...@@ -1552,6 +1552,8 @@ static int cayman_startup(struct radeon_device *rdev) ...@@ -1552,6 +1552,8 @@ static int cayman_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */ /* enable pcie gen2 link */
evergreen_pcie_gen2_enable(rdev); evergreen_pcie_gen2_enable(rdev);
evergreen_mc_program(rdev);
if (rdev->flags & RADEON_IS_IGP) { if (rdev->flags & RADEON_IS_IGP) {
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = ni_init_microcode(rdev); r = ni_init_microcode(rdev);
...@@ -1580,7 +1582,6 @@ static int cayman_startup(struct radeon_device *rdev) ...@@ -1580,7 +1582,6 @@ static int cayman_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
evergreen_mc_program(rdev);
r = cayman_pcie_gart_enable(rdev); r = cayman_pcie_gart_enable(rdev);
if (r) if (r)
return r; return r;
......
...@@ -2431,6 +2431,8 @@ int r600_startup(struct radeon_device *rdev) ...@@ -2431,6 +2431,8 @@ int r600_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */ /* enable pcie gen2 link */
r600_pcie_gen2_enable(rdev); r600_pcie_gen2_enable(rdev);
r600_mc_program(rdev);
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = r600_init_microcode(rdev); r = r600_init_microcode(rdev);
if (r) { if (r) {
...@@ -2443,7 +2445,6 @@ int r600_startup(struct radeon_device *rdev) ...@@ -2443,7 +2445,6 @@ int r600_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
r600_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) { if (rdev->flags & RADEON_IS_AGP) {
r600_agp_enable(rdev); r600_agp_enable(rdev);
} else { } else {
......
...@@ -1058,6 +1058,8 @@ static int rv770_startup(struct radeon_device *rdev) ...@@ -1058,6 +1058,8 @@ static int rv770_startup(struct radeon_device *rdev)
/* enable pcie gen2 link */ /* enable pcie gen2 link */
rv770_pcie_gen2_enable(rdev); rv770_pcie_gen2_enable(rdev);
rv770_mc_program(rdev);
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) {
r = r600_init_microcode(rdev); r = r600_init_microcode(rdev);
if (r) { if (r) {
...@@ -1070,7 +1072,6 @@ static int rv770_startup(struct radeon_device *rdev) ...@@ -1070,7 +1072,6 @@ static int rv770_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
rv770_mc_program(rdev);
if (rdev->flags & RADEON_IS_AGP) { if (rdev->flags & RADEON_IS_AGP) {
rv770_agp_enable(rdev); rv770_agp_enable(rdev);
} else { } else {
......
...@@ -3834,6 +3834,8 @@ static int si_startup(struct radeon_device *rdev) ...@@ -3834,6 +3834,8 @@ static int si_startup(struct radeon_device *rdev)
struct radeon_ring *ring; struct radeon_ring *ring;
int r; int r;
si_mc_program(rdev);
if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw || if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw ||
!rdev->rlc_fw || !rdev->mc_fw) { !rdev->rlc_fw || !rdev->mc_fw) {
r = si_init_microcode(rdev); r = si_init_microcode(rdev);
...@@ -3853,7 +3855,6 @@ static int si_startup(struct radeon_device *rdev) ...@@ -3853,7 +3855,6 @@ static int si_startup(struct radeon_device *rdev)
if (r) if (r)
return r; return r;
si_mc_program(rdev);
r = si_pcie_gart_enable(rdev); r = si_pcie_gart_enable(rdev);
if (r) if (r)
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment