drm/amd/powerplay: Fix CZ SMU firmware load check (v3)

Submitted by Tom St Denis on Aug. 26, 2016, 3:04 p.m.

Details

Message ID 20160826150431.5498-1-tom.stdenis@amd.com
State New
Headers show
Series "drm/amd/powerplay: Fix CZ SMU firmware load check" ( rev: 3 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Tom St Denis Aug. 26, 2016, 3:04 p.m.
Remove an errant return in the middle of the check
function as well as check for success in the start
function.

(v2) Add return check to smu_load_fw()
(v3) Don't return early if SMU load check fails

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
index 87c023e518ab..3aa7f1461a6a 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
@@ -195,9 +195,6 @@  static int cz_check_fw_load_finish(struct pp_smumgr *smumgr,
 	if (smumgr == NULL || smumgr->device == NULL)
 		return -EINVAL;
 
-	return cgs_read_register(smumgr->device,
-					mmSMU_MP1_SRBM2P_ARG_0);
-
 	cgs_write_register(smumgr->device, mmMP0PUB_IND_INDEX, index);
 
 	for (i = 0; i < smumgr->usec_timeout; i++) {
@@ -275,7 +272,12 @@  static int cz_start_smu(struct pp_smumgr *smumgr)
 	if (smumgr->chip_id == CHIP_STONEY)
 		fw_to_check &= ~(UCODE_ID_SDMA1_MASK | UCODE_ID_CP_MEC_JT2_MASK);
 
-	cz_request_smu_load_fw(smumgr);
+	ret = cz_request_smu_load_fw(smumgr);
+	if (ret) {
+		printk(KERN_ERR "[ powerplay] SMU firmware load failed\n");
+		return ret;
+	}
+
 	cz_check_fw_load_finish(smumgr, fw_to_check);
 
 	ret = cz_load_mec_firmware(smumgr);

Comments

> -----Original Message-----

> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf

> Of Tom St Denis

> Sent: Friday, August 26, 2016 11:05 AM

> To: amd-gfx@lists.freedesktop.org

> Cc: StDenis, Tom

> Subject: [PATCH] drm/amd/powerplay: Fix CZ SMU firmware load check (v3)

> 

> Remove an errant return in the middle of the check

> function as well as check for success in the start

> function.

> 

> (v2) Add return check to smu_load_fw()

> (v3) Don't return early if SMU load check fails

> 

> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>

> ---

>  drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 10 ++++++----

>  1 file changed, 6 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c

> b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c

> index 87c023e518ab..3aa7f1461a6a 100644

> --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c

> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c

> @@ -195,9 +195,6 @@ static int cz_check_fw_load_finish(struct pp_smumgr

> *smumgr,

>  	if (smumgr == NULL || smumgr->device == NULL)

>  		return -EINVAL;

> 

> -	return cgs_read_register(smumgr->device,

> -					mmSMU_MP1_SRBM2P_ARG_0);

> -

>  	cgs_write_register(smumgr->device, mmMP0PUB_IND_INDEX,

> index);

> 

>  	for (i = 0; i < smumgr->usec_timeout; i++) {

> @@ -275,7 +272,12 @@ static int cz_start_smu(struct pp_smumgr *smumgr)

>  	if (smumgr->chip_id == CHIP_STONEY)

>  		fw_to_check &= ~(UCODE_ID_SDMA1_MASK |

> UCODE_ID_CP_MEC_JT2_MASK);

> 

> -	cz_request_smu_load_fw(smumgr);

> +	ret = cz_request_smu_load_fw(smumgr);

> +	if (ret) {

> +		printk(KERN_ERR "[ powerplay] SMU firmware load

> failed\n");

> +		return ret;

> +	}

> +


No need to return early here.  I think the original patch is correct.

Alex

>  	cz_check_fw_load_finish(smumgr, fw_to_check);

> 

>  	ret = cz_load_mec_firmware(smumgr);

> --

> 2.9.3

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx