Commit d9811cfc authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: use MGPU friendly err/warn/info/dbg messages

Use dev_err/warn/info/dbg instead of pr_err/warn/info/debug.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 207f0f13
...@@ -609,7 +609,7 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size) ...@@ -609,7 +609,7 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (header->usStructureSize != size) { if (header->usStructureSize != size) {
pr_err("pp table size not matched !\n"); dev_err(smu->adev->dev, "pp table size not matched !\n");
return -EIO; return -EIO;
} }
...@@ -633,7 +633,7 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size) ...@@ -633,7 +633,7 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size)
ret = smu_reset(smu); ret = smu_reset(smu);
if (ret) if (ret)
pr_info("smu reset failed, ret = %d\n", ret); dev_info(smu->adev->dev, "smu reset failed, ret = %d\n", ret);
smu->uploading_custom_pp_table = false; smu->uploading_custom_pp_table = false;
...@@ -847,7 +847,7 @@ static int smu_init_fb_allocations(struct smu_context *smu) ...@@ -847,7 +847,7 @@ static int smu_init_fb_allocations(struct smu_context *smu)
&tables[SMU_TABLE_PMSTATUSLOG].mc_address, &tables[SMU_TABLE_PMSTATUSLOG].mc_address,
&tables[SMU_TABLE_PMSTATUSLOG].cpu_addr); &tables[SMU_TABLE_PMSTATUSLOG].cpu_addr);
if (ret) { if (ret) {
pr_err("VRAM allocation for tool table failed!\n"); dev_err(adev->dev, "VRAM allocation for tool table failed!\n");
return ret; return ret;
} }
} }
...@@ -876,7 +876,7 @@ static int smu_init_fb_allocations(struct smu_context *smu) ...@@ -876,7 +876,7 @@ static int smu_init_fb_allocations(struct smu_context *smu)
&driver_table->mc_address, &driver_table->mc_address,
&driver_table->cpu_addr); &driver_table->cpu_addr);
if (ret) { if (ret) {
pr_err("VRAM allocation for driver table failed!\n"); dev_err(adev->dev, "VRAM allocation for driver table failed!\n");
if (tables[SMU_TABLE_PMSTATUSLOG].mc_address) if (tables[SMU_TABLE_PMSTATUSLOG].mc_address)
amdgpu_bo_free_kernel(&tables[SMU_TABLE_PMSTATUSLOG].bo, amdgpu_bo_free_kernel(&tables[SMU_TABLE_PMSTATUSLOG].bo,
&tables[SMU_TABLE_PMSTATUSLOG].mc_address, &tables[SMU_TABLE_PMSTATUSLOG].mc_address,
...@@ -979,7 +979,7 @@ static int smu_smc_table_sw_init(struct smu_context *smu) ...@@ -979,7 +979,7 @@ static int smu_smc_table_sw_init(struct smu_context *smu)
*/ */
ret = smu_init_smc_tables(smu); ret = smu_init_smc_tables(smu);
if (ret) { if (ret) {
pr_err("Failed to init smc tables!\n"); dev_err(smu->adev->dev, "Failed to init smc tables!\n");
return ret; return ret;
} }
...@@ -989,7 +989,7 @@ static int smu_smc_table_sw_init(struct smu_context *smu) ...@@ -989,7 +989,7 @@ static int smu_smc_table_sw_init(struct smu_context *smu)
*/ */
ret = smu_init_power(smu); ret = smu_init_power(smu);
if (ret) { if (ret) {
pr_err("Failed to init smu_init_power!\n"); dev_err(smu->adev->dev, "Failed to init smu_init_power!\n");
return ret; return ret;
} }
...@@ -1021,13 +1021,13 @@ static int smu_smc_table_sw_fini(struct smu_context *smu) ...@@ -1021,13 +1021,13 @@ static int smu_smc_table_sw_fini(struct smu_context *smu)
ret = smu_fini_power(smu); ret = smu_fini_power(smu);
if (ret) { if (ret) {
pr_err("Failed to init smu_fini_power!\n"); dev_err(smu->adev->dev, "Failed to init smu_fini_power!\n");
return ret; return ret;
} }
ret = smu_fini_smc_tables(smu); ret = smu_fini_smc_tables(smu);
if (ret) { if (ret) {
pr_err("Failed to smu_fini_smc_tables!\n"); dev_err(smu->adev->dev, "Failed to smu_fini_smc_tables!\n");
return ret; return ret;
} }
...@@ -1090,19 +1090,19 @@ static int smu_sw_init(void *handle) ...@@ -1090,19 +1090,19 @@ static int smu_sw_init(void *handle)
smu->smu_dpm.requested_dpm_level = AMD_DPM_FORCED_LEVEL_AUTO; smu->smu_dpm.requested_dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
ret = smu_init_microcode(smu); ret = smu_init_microcode(smu);
if (ret) { if (ret) {
pr_err("Failed to load smu firmware!\n"); dev_err(adev->dev, "Failed to load smu firmware!\n");
return ret; return ret;
} }
ret = smu_smc_table_sw_init(smu); ret = smu_smc_table_sw_init(smu);
if (ret) { if (ret) {
pr_err("Failed to sw init smc table!\n"); dev_err(adev->dev, "Failed to sw init smc table!\n");
return ret; return ret;
} }
ret = smu_register_irq_handler(smu); ret = smu_register_irq_handler(smu);
if (ret) { if (ret) {
pr_err("Failed to register smc irq handler!\n"); dev_err(adev->dev, "Failed to register smc irq handler!\n");
return ret; return ret;
} }
...@@ -1117,7 +1117,7 @@ static int smu_sw_fini(void *handle) ...@@ -1117,7 +1117,7 @@ static int smu_sw_fini(void *handle)
ret = smu_smc_table_sw_fini(smu); ret = smu_smc_table_sw_fini(smu);
if (ret) { if (ret) {
pr_err("Failed to sw fini smc table!\n"); dev_err(adev->dev, "Failed to sw fini smc table!\n");
return ret; return ret;
} }
...@@ -1132,7 +1132,7 @@ static int smu_smc_hw_setup(struct smu_context *smu) ...@@ -1132,7 +1132,7 @@ static int smu_smc_hw_setup(struct smu_context *smu)
int ret; int ret;
if (smu_is_dpm_running(smu) && adev->in_suspend) { if (smu_is_dpm_running(smu) && adev->in_suspend) {
pr_info("dpm has been enabled\n"); dev_info(adev->dev, "dpm has been enabled\n");
return 0; return 0;
} }
...@@ -1182,7 +1182,7 @@ static int smu_smc_hw_setup(struct smu_context *smu) ...@@ -1182,7 +1182,7 @@ static int smu_smc_hw_setup(struct smu_context *smu)
return ret; return ret;
if (!smu_is_dpm_running(smu)) if (!smu_is_dpm_running(smu))
pr_info("dpm has been disabled\n"); dev_info(adev->dev, "dpm has been disabled\n");
ret = smu_override_pcie_parameters(smu); ret = smu_override_pcie_parameters(smu);
if (ret) if (ret)
...@@ -1198,7 +1198,7 @@ static int smu_smc_hw_setup(struct smu_context *smu) ...@@ -1198,7 +1198,7 @@ static int smu_smc_hw_setup(struct smu_context *smu)
ret = smu_disable_umc_cdr_12gbps_workaround(smu); ret = smu_disable_umc_cdr_12gbps_workaround(smu);
if (ret) { if (ret) {
pr_err("Workaround failed to disable UMC CDR feature on 12Gbps SKU!\n"); dev_err(adev->dev, "Workaround failed to disable UMC CDR feature on 12Gbps SKU!\n");
return ret; return ret;
} }
...@@ -1210,7 +1210,7 @@ static int smu_smc_hw_setup(struct smu_context *smu) ...@@ -1210,7 +1210,7 @@ static int smu_smc_hw_setup(struct smu_context *smu)
adev->pm.ac_power ? SMU_POWER_SOURCE_AC : adev->pm.ac_power ? SMU_POWER_SOURCE_AC :
SMU_POWER_SOURCE_DC); SMU_POWER_SOURCE_DC);
if (ret) { if (ret) {
pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC"); dev_err(adev->dev, "Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
return ret; return ret;
} }
...@@ -1247,7 +1247,7 @@ static int smu_start_smc_engine(struct smu_context *smu) ...@@ -1247,7 +1247,7 @@ static int smu_start_smc_engine(struct smu_context *smu)
if (smu->ppt_funcs->check_fw_status) { if (smu->ppt_funcs->check_fw_status) {
ret = smu->ppt_funcs->check_fw_status(smu); ret = smu->ppt_funcs->check_fw_status(smu);
if (ret) { if (ret) {
pr_err("SMC is not ready\n"); dev_err(adev->dev, "SMC is not ready\n");
return ret; return ret;
} }
} }
...@@ -1274,7 +1274,7 @@ static int smu_hw_init(void *handle) ...@@ -1274,7 +1274,7 @@ static int smu_hw_init(void *handle)
ret = smu_start_smc_engine(smu); ret = smu_start_smc_engine(smu);
if (ret) { if (ret) {
pr_err("SMU is not ready yet!\n"); dev_err(adev->dev, "SMU is not ready yet!\n");
return ret; return ret;
} }
...@@ -1307,7 +1307,7 @@ static int smu_hw_init(void *handle) ...@@ -1307,7 +1307,7 @@ static int smu_hw_init(void *handle)
adev->pm.dpm_enabled = true; adev->pm.dpm_enabled = true;
pr_info("SMU is initialized successfully!\n"); dev_info(adev->dev, "SMU is initialized successfully!\n");
return 0; return 0;
...@@ -1360,11 +1360,11 @@ static int smu_disable_dpms(struct smu_context *smu) ...@@ -1360,11 +1360,11 @@ static int smu_disable_dpms(struct smu_context *smu)
features_to_disable, features_to_disable,
0); 0);
if (ret) if (ret)
pr_err("Failed to disable smu features except BACO.\n"); dev_err(adev->dev, "Failed to disable smu features except BACO.\n");
} else { } else {
ret = smu_system_features_control(smu, false); ret = smu_system_features_control(smu, false);
if (ret) if (ret)
pr_err("Failed to disable smu features.\n"); dev_err(adev->dev, "Failed to disable smu features.\n");
} }
if (adev->asic_type >= CHIP_NAVI10 && if (adev->asic_type >= CHIP_NAVI10 &&
...@@ -1385,7 +1385,7 @@ static int smu_smc_hw_cleanup(struct smu_context *smu) ...@@ -1385,7 +1385,7 @@ static int smu_smc_hw_cleanup(struct smu_context *smu)
ret = smu_disable_thermal_alert(smu); ret = smu_disable_thermal_alert(smu);
if (ret) { if (ret) {
pr_warn("Fail to stop thermal control!\n"); dev_warn(adev->dev, "Fail to stop thermal control!\n");
return ret; return ret;
} }
...@@ -1479,11 +1479,11 @@ static int smu_resume(void *handle) ...@@ -1479,11 +1479,11 @@ static int smu_resume(void *handle)
if (!smu->pm_enabled) if (!smu->pm_enabled)
return 0; return 0;
pr_info("SMU is resuming...\n"); dev_info(adev->dev, "SMU is resuming...\n");
ret = smu_start_smc_engine(smu); ret = smu_start_smc_engine(smu);
if (ret) { if (ret) {
pr_err("SMU is not ready yet!\n"); dev_err(adev->dev, "SMU is not ready yet!\n");
goto failed; goto failed;
} }
...@@ -1498,7 +1498,7 @@ static int smu_resume(void *handle) ...@@ -1498,7 +1498,7 @@ static int smu_resume(void *handle)
adev->pm.dpm_enabled = true; adev->pm.dpm_enabled = true;
pr_info("SMU is resumed successfully!\n"); dev_info(adev->dev, "SMU is resumed successfully!\n");
return 0; return 0;
...@@ -1591,7 +1591,7 @@ int smu_get_current_clocks(struct smu_context *smu, ...@@ -1591,7 +1591,7 @@ int smu_get_current_clocks(struct smu_context *smu,
ret = smu_get_clock_info(smu, &hw_clocks, PERF_LEVEL_ACTIVITY); ret = smu_get_clock_info(smu, &hw_clocks, PERF_LEVEL_ACTIVITY);
if (ret) { if (ret) {
pr_err("Error in smu_get_clock_info\n"); dev_err(smu->adev->dev, "Error in smu_get_clock_info\n");
goto failed; goto failed;
} }
...@@ -1687,21 +1687,21 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu, ...@@ -1687,21 +1687,21 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu,
if (!skip_display_settings) { if (!skip_display_settings) {
ret = smu_display_config_changed(smu); ret = smu_display_config_changed(smu);
if (ret) { if (ret) {
pr_err("Failed to change display config!"); dev_err(smu->adev->dev, "Failed to change display config!");
return ret; return ret;
} }
} }
ret = smu_apply_clocks_adjust_rules(smu); ret = smu_apply_clocks_adjust_rules(smu);
if (ret) { if (ret) {
pr_err("Failed to apply clocks adjust rules!"); dev_err(smu->adev->dev, "Failed to apply clocks adjust rules!");
return ret; return ret;
} }
if (!skip_display_settings) { if (!skip_display_settings) {
ret = smu_notify_smc_display_config(smu); ret = smu_notify_smc_display_config(smu);
if (ret) { if (ret) {
pr_err("Failed to notify smc display config!"); dev_err(smu->adev->dev, "Failed to notify smc display config!");
return ret; return ret;
} }
} }
...@@ -1709,7 +1709,7 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu, ...@@ -1709,7 +1709,7 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu,
if (smu_dpm_ctx->dpm_level != level) { if (smu_dpm_ctx->dpm_level != level) {
ret = smu_asic_set_performance_level(smu, level); ret = smu_asic_set_performance_level(smu, level);
if (ret) { if (ret) {
pr_err("Failed to set performance level!"); dev_err(smu->adev->dev, "Failed to set performance level!");
return ret; return ret;
} }
...@@ -1875,7 +1875,7 @@ int smu_force_clk_levels(struct smu_context *smu, ...@@ -1875,7 +1875,7 @@ int smu_force_clk_levels(struct smu_context *smu,
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) { if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) {
pr_debug("force clock level is for dpm manual mode only.\n"); dev_dbg(smu->adev->dev, "force clock level is for dpm manual mode only.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1933,7 +1933,7 @@ int smu_set_mp1_state(struct smu_context *smu, ...@@ -1933,7 +1933,7 @@ int smu_set_mp1_state(struct smu_context *smu,
ret = smu_send_smc_msg(smu, msg, NULL); ret = smu_send_smc_msg(smu, msg, NULL);
if (ret) if (ret)
pr_err("[PrepareMp1] Failed!\n"); dev_err(smu->adev->dev, "[PrepareMp1] Failed!\n");
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
...@@ -1955,7 +1955,7 @@ int smu_set_df_cstate(struct smu_context *smu, ...@@ -1955,7 +1955,7 @@ int smu_set_df_cstate(struct smu_context *smu,
ret = smu->ppt_funcs->set_df_cstate(smu, state); ret = smu->ppt_funcs->set_df_cstate(smu, state);
if (ret) if (ret)
pr_err("[SetDfCstate] failed!\n"); dev_err(smu->adev->dev, "[SetDfCstate] failed!\n");
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
...@@ -1976,7 +1976,7 @@ int smu_allow_xgmi_power_down(struct smu_context *smu, bool en) ...@@ -1976,7 +1976,7 @@ int smu_allow_xgmi_power_down(struct smu_context *smu, bool en)
ret = smu->ppt_funcs->allow_xgmi_power_down(smu, en); ret = smu->ppt_funcs->allow_xgmi_power_down(smu, en);
if (ret) if (ret)
pr_err("[AllowXgmiPowerDown] failed!\n"); dev_err(smu->adev->dev, "[AllowXgmiPowerDown] failed!\n");
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
...@@ -2042,7 +2042,7 @@ int smu_set_ac_dc(struct smu_context *smu) ...@@ -2042,7 +2042,7 @@ int smu_set_ac_dc(struct smu_context *smu)
smu->adev->pm.ac_power ? SMU_POWER_SOURCE_AC : smu->adev->pm.ac_power ? SMU_POWER_SOURCE_AC :
SMU_POWER_SOURCE_DC); SMU_POWER_SOURCE_DC);
if (ret) if (ret)
pr_err("Failed to switch to %s mode!\n", dev_err(smu->adev->dev, "Failed to switch to %s mode!\n",
smu->adev->pm.ac_power ? "AC" : "DC"); smu->adev->pm.ac_power ? "AC" : "DC");
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
......
This diff is collapsed.
...@@ -175,7 +175,7 @@ static int renoir_get_metrics_table(struct smu_context *smu, ...@@ -175,7 +175,7 @@ static int renoir_get_metrics_table(struct smu_context *smu,
ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
(void *)smu_table->metrics_table, false); (void *)smu_table->metrics_table, false);
if (ret) { if (ret) {
pr_info("Failed to export SMU metrics table!\n"); dev_info(smu->adev->dev, "Failed to export SMU metrics table!\n");
mutex_unlock(&smu->metrics_lock); mutex_unlock(&smu->metrics_lock);
return ret; return ret;
} }
...@@ -508,7 +508,7 @@ static int renoir_get_current_activity_percent(struct smu_context *smu, ...@@ -508,7 +508,7 @@ static int renoir_get_current_activity_percent(struct smu_context *smu,
*value = metrics.AverageGfxActivity / 100; *value = metrics.AverageGfxActivity / 100;
break; break;
default: default:
pr_err("Invalid sensor for retrieving clock activity\n"); dev_err(smu->adev->dev, "Invalid sensor for retrieving clock activity\n");
return -EINVAL; return -EINVAL;
} }
...@@ -620,7 +620,7 @@ static int renoir_force_clk_levels(struct smu_context *smu, ...@@ -620,7 +620,7 @@ static int renoir_force_clk_levels(struct smu_context *smu,
case SMU_GFXCLK: case SMU_GFXCLK:
case SMU_SCLK: case SMU_SCLK:
if (soft_min_level > 2 || soft_max_level > 2) { if (soft_min_level > 2 || soft_max_level > 2) {
pr_info("Currently sclk only support 3 levels on APU\n"); dev_info(smu->adev->dev, "Currently sclk only support 3 levels on APU\n");
return -EINVAL; return -EINVAL;
} }
...@@ -674,7 +674,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u ...@@ -674,7 +674,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u
uint32_t profile_mode = input[size]; uint32_t profile_mode = input[size];
if (profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) { if (profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) {
pr_err("Invalid power profile mode %d\n", smu->power_profile_mode); dev_err(smu->adev->dev, "Invalid power profile mode %d\n", smu->power_profile_mode);
return -EINVAL; return -EINVAL;
} }
...@@ -685,7 +685,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u ...@@ -685,7 +685,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u
* TODO: If some case need switch to powersave/default power mode * TODO: If some case need switch to powersave/default power mode
* then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving. * then can consider enter WORKLOAD_COMPUTE/WORKLOAD_CUSTOM for power saving.
*/ */
pr_err_once("Unsupported power profile mode %d on RENOIR\n",smu->power_profile_mode); dev_err_once(smu->adev->dev, "Unsupported power profile mode %d on RENOIR\n",smu->power_profile_mode);
return -EINVAL; return -EINVAL;
} }
...@@ -693,7 +693,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u ...@@ -693,7 +693,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u
1 << workload_type, 1 << workload_type,
NULL); NULL);
if (ret) { if (ret) {
pr_err_once("Fail to set workload type %d\n", workload_type); dev_err_once(smu->adev->dev, "Fail to set workload type %d\n", workload_type);
return ret; return ret;
} }
...@@ -826,7 +826,7 @@ static int renoir_set_watermarks_table( ...@@ -826,7 +826,7 @@ static int renoir_set_watermarks_table(
if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) { if (!(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
ret = smu_write_watermarks_table(smu); ret = smu_write_watermarks_table(smu);
if (ret) { if (ret) {
pr_err("Failed to update WMTABLE!"); dev_err(smu->adev->dev, "Failed to update WMTABLE!");
return ret; return ret;
} }
smu->watermarks_bitmap |= WATERMARKS_LOADED; smu->watermarks_bitmap |= WATERMARKS_LOADED;
......
...@@ -105,7 +105,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu, ...@@ -105,7 +105,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu,
mutex_lock(&smu->message_lock); mutex_lock(&smu->message_lock);
ret = smu_v11_0_wait_for_response(smu); ret = smu_v11_0_wait_for_response(smu);
if (ret) { if (ret) {
pr_err("Msg issuing pre-check failed and " dev_err(adev->dev, "Msg issuing pre-check failed and "
"SMU may be not in the right state!\n"); "SMU may be not in the right state!\n");
goto out; goto out;
} }
...@@ -118,7 +118,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu, ...@@ -118,7 +118,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu,
ret = smu_v11_0_wait_for_response(smu); ret = smu_v11_0_wait_for_response(smu);
if (ret) { if (ret) {
pr_err("failed send message: %10s (%d) \tparam: 0x%08x response %#x\n", dev_err(adev->dev, "failed send message: %10s (%d) \tparam: 0x%08x response %#x\n",
smu_get_message_name(smu, msg), index, param, ret); smu_get_message_name(smu, msg), index, param, ret);
goto out; goto out;
} }
...@@ -126,7 +126,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu, ...@@ -126,7 +126,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu,
if (read_arg) { if (read_arg) {
ret = smu_v11_0_read_arg(smu, read_arg); ret = smu_v11_0_read_arg(smu, read_arg);
if (ret) { if (ret) {
pr_err("failed to read message arg: %10s (%d) \tparam: 0x%08x response %#x\n", dev_err(adev->dev, "failed to read message arg: %10s (%d) \tparam: 0x%08x response %#x\n",
smu_get_message_name(smu, msg), index, param, ret); smu_get_message_name(smu, msg), index, param, ret);
goto out; goto out;
} }
...@@ -294,7 +294,7 @@ int smu_v11_0_check_fw_version(struct smu_context *smu) ...@@ -294,7 +294,7 @@ int smu_v11_0_check_fw_version(struct smu_context *smu)
smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_Sienna_Cichlid; smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_Sienna_Cichlid;
break; break;
default: default:
pr_err("smu unsupported asic type:%d.\n", smu->adev->asic_type); dev_err(smu->adev->dev, "smu unsupported asic type:%d.\n", smu->adev->asic_type);
smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_INV; smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_INV;
break; break;
} }
...@@ -308,11 +308,11 @@ int smu_v11_0_check_fw_version(struct smu_context *smu) ...@@ -308,11 +308,11 @@ int smu_v11_0_check_fw_version(struct smu_context *smu)
* of halt driver loading. * of halt driver loading.
*/ */
if (if_version != smu->smc_driver_if_version) { if (if_version != smu->smc_driver_if_version) {
pr_info("smu driver if version = 0x%08x, smu fw if version = 0x%08x, " dev_info(smu->adev->dev, "smu driver if version = 0x%08x, smu fw if version = 0x%08x, "
"smu fw version = 0x%08x (%d.%d.%d)\n", "smu fw version = 0x%08x (%d.%d.%d)\n",
smu->smc_driver_if_version, if_version, smu->smc_driver_if_version, if_version,
smu_version, smu_major, smu_minor, smu_debug); smu_version, smu_major, smu_minor, smu_debug);
pr_warn("SMU driver if version not matched\n"); dev_warn(smu->adev->dev, "SMU driver if version not matched\n");
} }
return ret; return ret;
...@@ -375,7 +375,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu) ...@@ -375,7 +375,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
version_major = le16_to_cpu(hdr->header.header_version_major); version_major = le16_to_cpu(hdr->header.header_version_major);
version_minor = le16_to_cpu(hdr->header.header_version_minor); version_minor = le16_to_cpu(hdr->header.header_version_minor);
if (version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) { if (version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) {
pr_info("use driver provided pptable %d\n", smu->smu_table.boot_values.pp_table_id); dev_info(adev->dev, "use driver provided pptable %d\n", smu->smu_table.boot_values.pp_table_id);
switch (version_minor) { switch (version_minor) {
case 0: case 0:
ret = smu_v11_0_set_pptable_v2_0(smu, &table, &size); ret = smu_v11_0_set_pptable_v2_0(smu, &table, &size);
...@@ -392,7 +392,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu) ...@@ -392,7 +392,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
return ret; return ret;
} else { } else {
pr_info("use vbios provided pptable\n"); dev_info(adev->dev, "use vbios provided pptable\n");
index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1, index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
powerplayinfo); powerplayinfo);
...@@ -617,7 +617,7 @@ int smu_v11_0_get_vbios_bootup_values(struct smu_context *smu) ...@@ -617,7 +617,7 @@ int smu_v11_0_get_vbios_bootup_values(struct smu_context *smu)
return ret; return ret;
if (header->format_revision != 3) { if (header->format_revision != 3) {
pr_err("unknown atom_firmware_info version! for smu11\n"); dev_err(smu->adev->dev, "unknown atom_firmware_info version! for smu11\n");
return -EINVAL; return -EINVAL;
} }
...@@ -767,7 +767,7 @@ int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk) ...@@ -767,7 +767,7 @@ int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk)
ret = smu_send_smc_msg_with_param(smu, ret = smu_send_smc_msg_with_param(smu,
SMU_MSG_SetMinDeepSleepDcefclk, clk, NULL); SMU_MSG_SetMinDeepSleepDcefclk, clk, NULL);
if (ret) if (ret)
pr_err("SMU11 attempt to set divider for DCEFCLK Failed!"); dev_err(smu->adev->dev, "SMU11 attempt to set divider for DCEFCLK Failed!");
return ret; return ret;
} }
...@@ -951,7 +951,7 @@ smu_v11_0_get_max_sustainable_clock(struct smu_context *smu, uint32_t *clock, ...@@ -951,7 +951,7 @@ smu_v11_0_get_max_sustainable_clock(struct smu_context *smu, uint32_t *clock,
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDcModeMaxDpmFreq, ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetDcModeMaxDpmFreq,
clk_id << 16, clock); clk_id << 16, clock);
if (ret) { if (ret) {
pr_err("[GetMaxSustainableClock] Failed to get max DC clock from SMC!"); dev_err(smu->adev->dev, "[GetMaxSustainableClock] Failed to get max DC clock from SMC!");
return ret; return ret;
} }
...@@ -962,7 +962,7 @@ smu_v11_0_get_max_sustainable_clock(struct smu_context *smu, uint32_t *clock, ...@@ -962,7 +962,7 @@ smu_v11_0_get_max_sustainable_clock(struct smu_context *smu, uint32_t *clock,
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetMaxDpmFreq, ret = smu_send_smc_msg_with_param(smu, SMU_MSG_GetMaxDpmFreq,
clk_id << 16, clock); clk_id << 16, clock);
if (ret) { if (ret) {
pr_err("[GetMaxSustainableClock] failed to get max AC clock from SMC!"); dev_err(smu->adev->dev, "[GetMaxSustainableClock] failed to get max AC clock from SMC!");
return ret; return ret;
} }
...@@ -987,7 +987,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -987,7 +987,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->uclock), &(max_sustainable_clocks->uclock),
SMU_UCLK); SMU_UCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max UCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max UCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -998,7 +998,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -998,7 +998,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->soc_clock), &(max_sustainable_clocks->soc_clock),
SMU_SOCCLK); SMU_SOCCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max SOCCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max SOCCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -1009,7 +1009,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -1009,7 +1009,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->dcef_clock), &(max_sustainable_clocks->dcef_clock),
SMU_DCEFCLK); SMU_DCEFCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max DCEFCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max DCEFCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -1018,7 +1018,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -1018,7 +1018,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->display_clock), &(max_sustainable_clocks->display_clock),
SMU_DISPCLK); SMU_DISPCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max DISPCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max DISPCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -1026,7 +1026,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -1026,7 +1026,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->phy_clock), &(max_sustainable_clocks->phy_clock),
SMU_PHYCLK); SMU_PHYCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max PHYCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max PHYCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -1034,7 +1034,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu) ...@@ -1034,7 +1034,7 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
&(max_sustainable_clocks->pixel_clock), &(max_sustainable_clocks->pixel_clock),
SMU_PIXCLK); SMU_PIXCLK);
if (ret) { if (ret) {
pr_err("[%s] failed to get max PIXCLK from SMC!", dev_err(smu->adev->dev, "[%s] failed to get max PIXCLK from SMC!",
__func__); __func__);
return ret; return ret;
} }
...@@ -1054,7 +1054,7 @@ int smu_v11_0_set_power_limit(struct smu_context *smu, uint32_t n) ...@@ -1054,7 +1054,7 @@ int smu_v11_0_set_power_limit(struct smu_context *smu, uint32_t n)
max_power_limit = smu_get_max_power_limit(smu); max_power_limit = smu_get_max_power_limit(smu);
if (n > max_power_limit) { if (n > max_power_limit) {
pr_err("New power limit (%d) is over the max allowed %d\n", dev_err(smu->adev->dev, "New power limit (%d) is over the max allowed %d\n",
n, n,
max_power_limit); max_power_limit);
return -EINVAL; return -EINVAL;
...@@ -1064,13 +1064,13 @@ int smu_v11_0_set_power_limit(struct smu_context *smu, uint32_t n) ...@@ -1064,13 +1064,13 @@ int smu_v11_0_set_power_limit(struct smu_context *smu, uint32_t n)
n = smu->default_power_limit; n = smu->default_power_limit;
if (!smu_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT)) { if (!smu_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT)) {
pr_err("Setting new power limit is not supported!\n"); dev_err(smu->adev->dev, "Setting new power limit is not supported!\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetPptLimit, n, NULL); ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetPptLimit, n, NULL);
if (ret) { if (ret) {
pr_err("[%s] Set power limit Failed!\n", __func__); dev_err(smu->adev->dev, "[%s] Set power limit Failed!\n", __func__);
return ret; return ret;
} }
smu->power_limit = n; smu->power_limit = n;
...@@ -1243,7 +1243,7 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu, ...@@ -1243,7 +1243,7 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
clk_select = SMU_UCLK; clk_select = SMU_UCLK;
break; break;
default: default:
pr_info("[%s] Invalid Clock Type!", __func__); dev_info(smu->adev->dev, "[%s] Invalid Clock Type!", __func__);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -1307,7 +1307,7 @@ smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control) ...@@ -1307,7 +1307,7 @@ smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
ret = smu_feature_set_enabled(smu, SMU_FEATURE_FAN_CONTROL_BIT, auto_fan_control); ret = smu_feature_set_enabled(smu, SMU_FEATURE_FAN_CONTROL_BIT, auto_fan_control);
if (ret) if (ret)
pr_err("[%s]%s smc FAN CONTROL feature failed!", dev_err(smu->adev->dev, "[%s]%s smc FAN CONTROL feature failed!",
__func__, (auto_fan_control ? "Start" : "Stop")); __func__, (auto_fan_control ? "Start" : "Stop"));
return ret; return ret;
...@@ -1378,7 +1378,7 @@ smu_v11_0_set_fan_control_mode(struct smu_context *smu, ...@@ -1378,7 +1378,7 @@ smu_v11_0_set_fan_control_mode(struct smu_context *smu,
} }
if (ret) { if (ret) {
pr_err("[%s]Set fan control mode failed!", __func__); dev_err(smu->adev->dev, "[%s]Set fan control mode failed!", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -1849,7 +1849,7 @@ int smu_v11_0_override_pcie_parameters(struct smu_context *smu) ...@@ -1849,7 +1849,7 @@ int smu_v11_0_override_pcie_parameters(struct smu_context *smu)
ret = smu_update_pcie_parameters(smu, pcie_gen, pcie_width); ret = smu_update_pcie_parameters(smu, pcie_gen, pcie_width);
if (ret) if (ret)
pr_err("[%s] Attempt to override pcie params failed!\n", __func__); dev_err(adev->dev, "[%s] Attempt to override pcie params failed!\n", __func__);
return ret; return ret;
......
...@@ -92,7 +92,7 @@ smu_v12_0_send_msg_with_param(struct smu_context *smu, ...@@ -92,7 +92,7 @@ smu_v12_0_send_msg_with_param(struct smu_context *smu,
mutex_lock(&smu->message_lock); mutex_lock(&smu->message_lock);
ret = smu_v12_0_wait_for_response(smu); ret = smu_v12_0_wait_for_response(smu);
if (ret) { if (ret) {
pr_err("Msg issuing pre-check failed and " dev_err(adev->dev, "Msg issuing pre-check failed and "
"SMU may be not in the right state!\n"); "SMU may be not in the right state!\n");
goto out; goto out;
} }
...@@ -105,14 +105,14 @@ smu_v12_0_send_msg_with_param(struct smu_context *smu, ...@@ -105,14 +105,14 @@ smu_v12_0_send_msg_with_param(struct smu_context *smu,
ret = smu_v12_0_wait_for_response(smu); ret = smu_v12_0_wait_for_response(smu);
if (ret) { if (ret) {
pr_err("Failed to send message 0x%x, response 0x%x param 0x%x\n", dev_err(adev->dev, "Failed to send message 0x%x, response 0x%x param 0x%x\n",
index, ret, param); index, ret, param);
goto out; goto out;
} }
if (read_arg) { if (read_arg) {
ret = smu_v12_0_read_arg(smu, read_arg); ret = smu_v12_0_read_arg(smu, read_arg);
if (ret) { if (ret) {
pr_err("Failed to read message arg 0x%x, response 0x%x param 0x%x\n", dev_err(adev->dev, "Failed to read message arg 0x%x, response 0x%x param 0x%x\n",
index, ret, param); index, ret, param);
goto out; goto out;
} }
...@@ -161,11 +161,11 @@ int smu_v12_0_check_fw_version(struct smu_context *smu) ...@@ -161,11 +161,11 @@ int smu_v12_0_check_fw_version(struct smu_context *smu)
* of halt driver loading. * of halt driver loading.
*/ */
if (if_version != smu->smc_driver_if_version) { if (if_version != smu->smc_driver_if_version) {
pr_info("smu driver if version = 0x%08x, smu fw if version = 0x%08x, " dev_info(smu->adev->dev, "smu driver if version = 0x%08x, smu fw if version = 0x%08x, "
"smu fw version = 0x%08x (%d.%d.%d)\n", "smu fw version = 0x%08x (%d.%d.%d)\n",
smu->smc_driver_if_version, if_version, smu->smc_driver_if_version, if_version,
smu_version, smu_major, smu_minor, smu_debug); smu_version, smu_major, smu_minor, smu_debug);
pr_warn("SMU driver if version not matched\n"); dev_warn(smu->adev->dev, "SMU driver if version not matched\n");
} }
return ret; return ret;
...@@ -378,7 +378,7 @@ int smu_v12_0_get_dpm_ultimate_freq(struct smu_context *smu, enum smu_clk_type c ...@@ -378,7 +378,7 @@ int smu_v12_0_get_dpm_ultimate_freq(struct smu_context *smu, enum smu_clk_type c
case SMU_SCLK: case SMU_SCLK:
ret = smu_send_smc_msg(smu, SMU_MSG_GetMaxGfxclkFrequency, max); ret = smu_send_smc_msg(smu, SMU_MSG_GetMaxGfxclkFrequency, max);
if (ret) { if (ret) {
pr_err("Attempt to get max GX frequency from SMC Failed !\n"); dev_err(smu->adev->dev, "Attempt to get max GX frequency from SMC Failed !\n");
goto failed; goto failed;
} }
break; break;
...@@ -406,7 +406,7 @@ int smu_v12_0_get_dpm_ultimate_freq(struct smu_context *smu, enum smu_clk_type c ...@@ -406,7 +406,7 @@ int smu_v12_0_get_dpm_ultimate_freq(struct smu_context *smu, enum smu_clk_type c
case SMU_SCLK: case SMU_SCLK:
ret = smu_send_smc_msg(smu, SMU_MSG_GetMinGfxclkFrequency, min); ret = smu_send_smc_msg(smu, SMU_MSG_GetMinGfxclkFrequency, min);
if (ret) { if (ret) {
pr_err("Attempt to get min GX frequency from SMC Failed !\n"); dev_err(smu->adev->dev, "Attempt to get min GX frequency from SMC Failed !\n");
goto failed; goto failed;
} }
break; break;
......
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