Merge tag 'amd-drm-fixes-5.8-2020-07-22' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
amd-drm-fixes-5.8-2020-07-22: amdgpu: - Fix crash when overclocking VegaM - Fix possible crash when editing dpm levels Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200723032608.3865-1-alexander.deucher@amd.com
This commit is contained in:
commit
d8904ca9d3
|
@ -778,8 +778,7 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
|
||||||
tmp_str++;
|
tmp_str++;
|
||||||
while (isspace(*++tmp_str));
|
while (isspace(*++tmp_str));
|
||||||
|
|
||||||
while (tmp_str[0]) {
|
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||||
sub_str = strsep(&tmp_str, delimiter);
|
|
||||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -1039,8 +1038,7 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
|
||||||
memcpy(buf_cpy, buf, bytes);
|
memcpy(buf_cpy, buf, bytes);
|
||||||
buf_cpy[bytes] = '\0';
|
buf_cpy[bytes] = '\0';
|
||||||
tmp = buf_cpy;
|
tmp = buf_cpy;
|
||||||
while (tmp[0]) {
|
while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
|
||||||
sub_str = strsep(&tmp, delimiter);
|
|
||||||
if (strlen(sub_str)) {
|
if (strlen(sub_str)) {
|
||||||
ret = kstrtol(sub_str, 0, &level);
|
ret = kstrtol(sub_str, 0, &level);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1637,8 +1635,7 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
|
||||||
i++;
|
i++;
|
||||||
memcpy(buf_cpy, buf, count-i);
|
memcpy(buf_cpy, buf, count-i);
|
||||||
tmp_str = buf_cpy;
|
tmp_str = buf_cpy;
|
||||||
while (tmp_str[0]) {
|
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
|
||||||
sub_str = strsep(&tmp_str, delimiter);
|
|
||||||
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
ret = kstrtol(sub_str, 0, ¶meter[parameter_size]);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -644,9 +644,6 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr,
|
||||||
|
|
||||||
/* sclk is bigger than max sclk in the dependence table */
|
/* sclk is bigger than max sclk in the dependence table */
|
||||||
*voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
|
*voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
|
||||||
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
|
|
||||||
(dep_table->entries[i - 1].vddc -
|
|
||||||
(uint16_t)VDDC_VDDCI_DELTA));
|
|
||||||
|
|
||||||
if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
|
if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
|
||||||
*voltage |= (data->vbios_boot_state.vddci_bootup_value *
|
*voltage |= (data->vbios_boot_state.vddci_bootup_value *
|
||||||
|
@ -654,8 +651,13 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr,
|
||||||
else if (dep_table->entries[i - 1].vddci)
|
else if (dep_table->entries[i - 1].vddci)
|
||||||
*voltage |= (dep_table->entries[i - 1].vddci *
|
*voltage |= (dep_table->entries[i - 1].vddci *
|
||||||
VOLTAGE_SCALE) << VDDC_SHIFT;
|
VOLTAGE_SCALE) << VDDC_SHIFT;
|
||||||
else
|
else {
|
||||||
|
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
|
||||||
|
(dep_table->entries[i - 1].vddc -
|
||||||
|
(uint16_t)VDDC_VDDCI_DELTA));
|
||||||
|
|
||||||
*voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
|
*voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
|
||||||
|
}
|
||||||
|
|
||||||
if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
|
if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
|
||||||
*mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE;
|
*mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE;
|
||||||
|
|
Loading…
Reference in New Issue