Skip to content

Commit 88fff0b

Browse files
committed
Merge tag 'drm-fixes-2020-07-24' of git://anongit.freedesktop.org/drm/drm into master
Pull drm fixes from Dave Airlie: "Quiet fixes, I may have a single regression fix follow up to this for nouveau, but it might be next week, Ben was testing it a bit more . Otherwise two amdgpu fixes, one lima and one sun4i: amdgpu: - Fix crash when overclocking VegaM - Fix possible crash when editing dpm levels sun4i: - Fix inverted HPD result; fixes an earlier fix lima: - fix timeout during reset" * tag 'drm-fixes-2020-07-24' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: Fix NULL dereference in dpm sysfs handlers drm/amd/powerplay: fix a crash when overclocking Vega M drm/lima: fix wait pp reset timeout drm: sun4i: hdmi: Fix inverted HPD result
2 parents f37e99a + d8904ca commit 88fff0b

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,7 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
778778
tmp_str++;
779779
while (isspace(*++tmp_str));
780780

781-
while (tmp_str[0]) {
782-
sub_str = strsep(&tmp_str, delimiter);
781+
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
783782
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
784783
if (ret)
785784
return -EINVAL;
@@ -1039,8 +1038,7 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
10391038
memcpy(buf_cpy, buf, bytes);
10401039
buf_cpy[bytes] = '\0';
10411040
tmp = buf_cpy;
1042-
while (tmp[0]) {
1043-
sub_str = strsep(&tmp, delimiter);
1041+
while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
10441042
if (strlen(sub_str)) {
10451043
ret = kstrtol(sub_str, 0, &level);
10461044
if (ret)
@@ -1637,8 +1635,7 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
16371635
i++;
16381636
memcpy(buf_cpy, buf, count-i);
16391637
tmp_str = buf_cpy;
1640-
while (tmp_str[0]) {
1641-
sub_str = strsep(&tmp_str, delimiter);
1638+
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
16421639
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
16431640
if (ret)
16441641
return -EINVAL;

drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,18 +644,20 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr,
644644

645645
/* sclk is bigger than max sclk in the dependence table */
646646
*voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
647-
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
648-
(dep_table->entries[i - 1].vddc -
649-
(uint16_t)VDDC_VDDCI_DELTA));
650647

651648
if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
652649
*voltage |= (data->vbios_boot_state.vddci_bootup_value *
653650
VOLTAGE_SCALE) << VDDCI_SHIFT;
654651
else if (dep_table->entries[i - 1].vddci)
655652
*voltage |= (dep_table->entries[i - 1].vddci *
656653
VOLTAGE_SCALE) << VDDC_SHIFT;
657-
else
654+
else {
655+
vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
656+
(dep_table->entries[i - 1].vddc -
657+
(uint16_t)VDDC_VDDCI_DELTA));
658+
658659
*voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
660+
}
659661

660662
if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
661663
*mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE;

drivers/gpu/drm/lima/lima_pp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ void lima_pp_fini(struct lima_ip *ip)
271271

272272
int lima_pp_bcast_resume(struct lima_ip *ip)
273273
{
274+
/* PP has been reset by individual PP resume */
275+
ip->data.async_reset = false;
274276
return 0;
275277
}
276278

drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)
260260
unsigned long reg;
261261

262262
reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG);
263-
if (reg & SUN4I_HDMI_HPD_HIGH) {
263+
if (!(reg & SUN4I_HDMI_HPD_HIGH)) {
264264
cec_phys_addr_invalidate(hdmi->cec_adap);
265265
return connector_status_disconnected;
266266
}

0 commit comments

Comments
 (0)