diff options
| author | Lijo Lazar <lijo.lazar@amd.com> | 2025-11-26 10:57:44 +0300 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2025-12-08 22:14:13 +0300 |
| commit | c5842537bd4317a1bc64670b4c7fc930cde47faa (patch) | |
| tree | f3c8e0220f81c2c63e83a7964bc5453205b64f66 | |
| parent | b0e0503cb46875fd37206584453efbe0fe756bf6 (diff) | |
| download | linux-c5842537bd4317a1bc64670b4c7fc930cde47faa.tar.xz | |
drm/amd/pm: Use emit_clk_levels in SMUv14.0.2
Move to emit_clk_levels from print_clk_levels
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c index 2cea688c604f..ab57bb2e5dcf 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c @@ -1045,9 +1045,9 @@ static void smu_v14_0_2_get_od_setting_limits(struct smu_context *smu, *max = od_max_setting; } -static int smu_v14_0_2_print_clk_levels(struct smu_context *smu, - enum smu_clk_type clk_type, - char *buf) +static int smu_v14_0_2_emit_clk_levels(struct smu_context *smu, + enum smu_clk_type clk_type, char *buf, + int *offset) { struct smu_dpm_context *smu_dpm = &smu->smu_dpm; struct smu_14_0_dpm_context *dpm_context = smu_dpm->dpm_context; @@ -1056,16 +1056,13 @@ static int smu_v14_0_2_print_clk_levels(struct smu_context *smu, struct smu_14_0_dpm_table *single_dpm_table; struct smu_14_0_pcie_table *pcie_table; uint32_t gen_speed, lane_width; - int i, curr_freq, size = 0, start_offset = 0; + int i, curr_freq, size = *offset, start_offset = *offset; int32_t min_value, max_value; int ret = 0; - smu_cmn_get_sysfs_buf(&buf, &size); - start_offset = size; - if (amdgpu_ras_intr_triggered()) { - size += sysfs_emit_at(buf, size, "unavailable\n"); - return size - start_offset; + sysfs_emit_at(buf, size, "unavailable\n"); + return -EBUSY; } switch (clk_type) { @@ -1375,7 +1372,9 @@ static int smu_v14_0_2_print_clk_levels(struct smu_context *smu, break; } - return size - start_offset; + *offset += size - start_offset; + + return 0; } static int smu_v14_0_2_force_clk_levels(struct smu_context *smu, @@ -2873,7 +2872,7 @@ static const struct pptable_funcs smu_v14_0_2_ppt_funcs = { .get_vbios_bootup_values = smu_v14_0_get_vbios_bootup_values, .read_sensor = smu_v14_0_2_read_sensor, .feature_is_enabled = smu_cmn_feature_is_enabled, - .print_clk_levels = smu_v14_0_2_print_clk_levels, + .emit_clk_levels = smu_v14_0_2_emit_clk_levels, .force_clk_levels = smu_v14_0_2_force_clk_levels, .update_pcie_parameters = smu_v14_0_2_update_pcie_parameters, .get_thermal_temperature_range = smu_v14_0_2_get_thermal_temperature_range, |
