Skip to contentSkip to conversation

drm/amd/powerplay: fix a logic error in pp_hw_init

PATCH In review Rex Zhu 3 participants 4 messages Sep 30, 2017 – Oct 1, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/2 drm/amd/powerplay: fix a logic error in pp_hw_init

Change-Id I8607e51a0e4153b36268e2bcf4fe594c2bfbfe23
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +4 -5
index df70cc7..586cab7 100644
@@ -163,12 +163,11 @@ static int pp_hw_init(void *handle)
 		}
 		if (ret == PP_DPM_DISABLED)
 			goto exit;
+		ret = hwmgr_hw_init(pp_handle);
+		if (ret)
+			goto exit;
 	}
-
-	ret = hwmgr_hw_init(pp_handle);
-	if (ret)
-		goto exit;
-	return 0;
+	return ret;
 exit:
 	pp_handle->pm_en = 0;
 	cgs_notify_dpm_enabled(hwmgr->device, false);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1506739820-28659-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amd/powerplay: fix ret checks in amd_powerplay.c

regresstion issue caused by

commit e37a7b4088da
("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c")

Change-Id I46be14d8230ad7bc9039782a56a94bb060a21423
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 74 +++++++++++++--------------
 1 file changed, 37 insertions(+), 37 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +37 -37
index 586cab7..f3f303e 100644
@@ -230,7 +230,7 @@ static int pp_set_powergating_state(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -378,7 +378,7 @@ static int pp_dpm_force_performance_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -396,7 +396,7 @@ static int pp_dpm_force_performance_level(void *handle,
 	hwmgr->request_dpm_level = level;
 	hwmgr_handle_task(pp_handle, AMD_PP_TASK_READJUST_POWER_STATE, NULL, NULL);
 	ret = hwmgr->hwmgr_func->force_dpm_level(hwmgr, level);
-	if (!ret)
+	if (ret)
 		hwmgr->dpm_level = hwmgr->request_dpm_level;
 
 	mutex_unlock(&pp_handle->pp_lock);
@@ -413,7 +413,7 @@ static enum amd_dpm_forced_level pp_dpm_get_performance_level(
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -432,7 +432,7 @@ static uint32_t pp_dpm_get_sclk(void *handle, bool low)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -456,7 +456,7 @@ static uint32_t pp_dpm_get_mclk(void *handle, bool low)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -479,7 +479,7 @@ static void pp_dpm_powergate_vce(void *handle, bool gate)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
 	hwmgr = pp_handle->hwmgr;
@@ -501,7 +501,7 @@ static void pp_dpm_powergate_uvd(void *handle, bool gate)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
 	hwmgr = pp_handle->hwmgr;
@@ -523,7 +523,7 @@ static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	mutex_lock(&pp_handle->pp_lock);
@@ -543,7 +543,7 @@ static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -585,7 +585,7 @@ static void pp_dpm_set_fan_control_mode(void *handle, uint32_t mode)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
 	hwmgr = pp_handle->hwmgr;
@@ -608,7 +608,7 @@ static uint32_t pp_dpm_get_fan_control_mode(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -631,7 +631,7 @@ static int pp_dpm_set_fan_speed_percent(void *handle, uint32_t percent)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -654,7 +654,7 @@ static int pp_dpm_get_fan_speed_percent(void *handle, uint32_t *speed)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -678,7 +678,7 @@ static int pp_dpm_get_fan_speed_rpm(void *handle, uint32_t *rpm)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -700,7 +700,7 @@ static int pp_dpm_get_temperature(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -725,7 +725,7 @@ static int pp_dpm_get_pp_num_states(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -770,7 +770,7 @@ static int pp_dpm_get_pp_table(void *handle, char **table)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -813,7 +813,7 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -855,7 +855,7 @@ static int pp_dpm_force_clock_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -879,7 +879,7 @@ static int pp_dpm_print_clock_levels(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -902,7 +902,7 @@ static int pp_dpm_get_sclk_od(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -925,7 +925,7 @@ static int pp_dpm_set_sclk_od(void *handle, uint32_t value)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -949,7 +949,7 @@ static int pp_dpm_get_mclk_od(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -972,7 +972,7 @@ static int pp_dpm_set_mclk_od(void *handle, uint32_t value)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -996,7 +996,7 @@ static int pp_dpm_read_sensor(void *handle, int idx,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1022,7 +1022,7 @@ static int pp_dpm_read_sensor(void *handle, int idx,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return NULL;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1174,7 +1174,7 @@ static int pp_display_configuration_change(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1193,7 +1193,7 @@ static int pp_get_display_power_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1218,7 +1218,7 @@ static int pp_get_current_clocks(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1235,7 +1235,7 @@ static int pp_get_current_clocks(void *handle,
 		ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
 					&hw_clocks, PHM_PerformanceLevelDesignation_Activity);
 
-	if (!ret) {
+	if (ret) {
 		pr_info("Error in phm_get_clock_info \n");
 		mutex_unlock(&pp_handle->pp_lock);
 		return -EINVAL;
@@ -1269,7 +1269,7 @@ static int pp_get_clock_by_type(void *handle, enum amd_pp_clock_type type, struc
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1292,7 +1292,7 @@ static int pp_get_clock_by_type_with_latency(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clocks)
@@ -1314,7 +1314,7 @@ static int pp_get_clock_by_type_with_voltage(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clocks)
@@ -1338,7 +1338,7 @@ static int pp_set_watermarks_for_clocks_ranges(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!wm_with_clock_ranges)
@@ -1362,7 +1362,7 @@ static int pp_display_clock_voltage_request(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clock)
@@ -1386,7 +1386,7 @@ static int pp_get_display_mode_validation_clocks(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1506739820-28659-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

#4 lore raw

RE: [PATCH 2/2] drm/amd/powerplay: fix ret checks in amd_powerplay.c

Series are reviewed-by: Evan Quan <[email protected]>

Regards,
Evan

Quoted 369 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Rex Zhu
Sent: Saturday, September 30, 2017 10:50 AM
To: [email protected]
Cc: Zhu, Rex <[email protected]>
Subject: [PATCH 2/2] drm/amd/powerplay: fix ret checks in amd_powerplay.c

regresstion issue caused by

commit e37a7b4088da
("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c")

Change-Id I46be14d8230ad7bc9039782a56a94bb060a21423

---
drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 74 +++++++++++++--------------

1 file changed, 37 insertions(+), 37 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -3
index 586cab7..f3f303e 100644
@@ -230,7 +230,7 @@ static int pp_set_powergating_state(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -378,7 +378,7 @@ static int pp_dpm_force_performance_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -396,7 +396,7 @@ static int pp_dpm_force_performance_level(void *handle,
 	hwmgr->request_dpm_level = level;
 	hwmgr_handle_task(pp_handle, AMD_PP_TASK_READJUST_POWER_STATE, NULL,
 NULL);
 	ret = hwmgr->hwmgr_func->force_dpm_level(hwmgr, level);
-	if (!ret)
+	if (ret)
 		hwmgr->dpm_level = hwmgr->request_dpm_level;
 
	mutex_unlock(&pp_handle->pp_lock);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0 -0
@@ -413,7 +413,7 @@ static enum amd_dpm_forced_level

pp_dpm_get_performance_level(

	ret = pp_check(pp_handle);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
-	if (!ret)
+	if (ret)
		return ret;

	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +5 -5
@@ -432,7 +432,7 @@ static uint32_t pp_dpm_get_sclk(void *handle, bool low)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -456,7 +456,7 @@ static uint32_t pp_dpm_get_mclk(void *handle, bool low)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -479,7 +479,7 @@ static void pp_dpm_powergate_vce(void *handle, bool gate)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
 	hwmgr = pp_handle->hwmgr;
@@ -501,7 +501,7 @@ static void pp_dpm_powergate_uvd(void *handle, bool gate)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
 	hwmgr = pp_handle->hwmgr;
@@ -523,7 +523,7 @@ static int pp_dpm_dispatch_tasks(void *handle, enum
 amd_pp_task task_id,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
	mutex_lock(&pp_handle->pp_lock);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
@@ -543,7 +543,7 @@ static enum amd_pm_state_type
 pp_dpm_get_current_power_state(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
@@ -585,7 +585,7 @@ static void pp_dpm_set_fan_control_mode(void *handle, uint32_t
 mode)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return;
 
	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +2 -2
@@ -608,7 +608,7 @@ static uint32_t pp_dpm_get_fan_control_mode(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -631,7 +631,7 @@ static int pp_dpm_set_fan_speed_percent(void *handle, uint32_t
 percent)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
@@ -654,7 +654,7 @@ static int pp_dpm_get_fan_speed_percent(void *handle, uint32_t
 *speed)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +5 -5
@@ -678,7 +678,7 @@ static int pp_dpm_get_fan_speed_rpm(void *handle, uint32_t *rpm)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -700,7 +700,7 @@ static int pp_dpm_get_temperature(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -725,7 +725,7 @@ static int pp_dpm_get_pp_num_states(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -770,7 +770,7 @@ static int pp_dpm_get_pp_table(void *handle, char **table)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -813,7 +813,7 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf,
 size_t size)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +12 -12
@@ -855,7 +855,7 @@ static int pp_dpm_force_clock_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -879,7 +879,7 @@ static int pp_dpm_print_clock_levels(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -902,7 +902,7 @@ static int pp_dpm_get_sclk_od(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -925,7 +925,7 @@ static int pp_dpm_set_sclk_od(void *handle, uint32_t value)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -949,7 +949,7 @@ static int pp_dpm_get_mclk_od(void *handle)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -972,7 +972,7 @@ static int pp_dpm_set_mclk_od(void *handle, uint32_t value)
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -996,7 +996,7 @@ static int pp_dpm_read_sensor(void *handle, int idx,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1022,7 +1022,7 @@ static int pp_dpm_read_sensor(void *handle, int idx,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return NULL;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1174,7 +1174,7 @@ static int pp_display_configuration_change(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1193,7 +1193,7 @@ static int pp_get_display_power_level(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1218,7 +1218,7 @@ static int pp_get_current_clocks(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
@@ -1235,7 +1235,7 @@ static int pp_get_current_clocks(void *handle,
 		ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
 					&hw_clocks,
 PHM_PerformanceLevelDesignation_Activity);
 
-	if (!ret) {
+	if (ret) {
 		pr_info("Error in phm_get_clock_info \n");
 		mutex_unlock(&pp_handle->pp_lock);
		return -EINVAL;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0 -0
@@ -1269,7 +1269,7 @@ static int pp_get_clock_by_type(void *handle, enum

amd_pp_clock_type type, struc

	ret = pp_check(pp_handle);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
-	if (!ret)
+	if (ret)
		return ret;

	hwmgr = pp_handle->hwmgr;
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +5 -6
@@ -1292,7 +1292,7 @@ static int pp_get_clock_by_type_with_latency(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clocks)
@@ -1314,7 +1314,7 @@ static int pp_get_clock_by_type_with_voltage(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clocks)
@@ -1338,7 +1338,7 @@ static int pp_set_watermarks_for_clocks_ranges(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!wm_with_clock_ranges)
@@ -1362,7 +1362,7 @@ static int pp_display_clock_voltage_request(void *handle,
 	int ret = 0;
 
 	ret = pp_check(pp_handle);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (!clock)
@@ -1386,7 +1386,7 @@ static int pp_get_display_mode_validation_clocks(void *handle,
 
 	ret = pp_check(pp_handle);
 
-	if (!ret)
+	if (ret)
 		return ret;
 
 	hwmgr = pp_handle->hwmgr;
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Acked-by
#5 lore raw
In reply to a message not in the archive
Quoted 2 lines · Rex Zhu
Change-Id I8607e51a0e4153b36268e2bcf4fe594c2bfbfe23
Quoted 28 lines
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +4 -6
index df70cc7..586cab7 100644
@@ -163,12 +163,11 @@ static int pp_hw_init(void *handle)
                }
                if (ret == PP_DPM_DISABLED)
                        goto exit;
+               ret = hwmgr_hw_init(pp_handle);
+               if (ret)
+                       goto exit;
        }
-
-       ret = hwmgr_hw_init(pp_handle);
-       if (ret)
-               goto exit;
-       return 0;
+       return ret;
 exit:
        pp_handle->pm_en = 0;
        cgs_notify_dpm_enabled(hwmgr->device, false);
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx