Skip to content

Commit 7e8d2f6

Browse files
committed
Merge tag 'thermal-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux into master
Pull thermal fixes from Daniel Lezcano: - Fix invalid index array access on int340x_thermal leading to a kernel panic (Bartosz Szczepanek) - Fix debug message level to prevent flooding on some platform (Alex Hung) - Fix invalid bank access by reverting "thermal: mediatek: fix register index error" (Enric Balletbo i Serra) * tag 'thermal-v5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: Revert "thermal: mediatek: fix register index error" thermal: int3403_thermal: Downgrade error message thermal/int340x_thermal: Prevent page fault on .set_mode() op
2 parents f845669 + a8f62f1 commit 7e8d2f6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,16 @@ static int int3400_thermal_run_osc(acpi_handle handle,
216216
acpi_status status;
217217
int result = 0;
218218
struct acpi_osc_context context = {
219-
.uuid_str = int3400_thermal_uuids[uuid],
219+
.uuid_str = NULL,
220220
.rev = 1,
221221
.cap.length = 8,
222222
};
223223

224+
if (uuid < 0 || uuid >= INT3400_THERMAL_MAXIMUM_UUID)
225+
return -EINVAL;
226+
227+
context.uuid_str = int3400_thermal_uuids[uuid];
228+
224229
buf[OSC_QUERY_DWORD] = 0;
225230
buf[OSC_SUPPORT_DWORD] = enable;
226231

drivers/thermal/intel/int340x_thermal/int3403_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void int3403_notify(acpi_handle handle,
7474
THERMAL_TRIP_CHANGED);
7575
break;
7676
default:
77-
dev_err(&priv->pdev->dev, "Unsupported event [0x%x]\n", event);
77+
dev_dbg(&priv->pdev->dev, "Unsupported event [0x%x]\n", event);
7878
break;
7979
}
8080
}

drivers/thermal/mtk_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,7 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)
594594
u32 raw;
595595

596596
for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) {
597-
raw = readl(mt->thermal_base +
598-
conf->msr[conf->bank_data[bank->id].sensors[i]]);
597+
raw = readl(mt->thermal_base + conf->msr[i]);
599598

600599
temp = raw_to_mcelsius(mt,
601600
conf->bank_data[bank->id].sensors[i],
@@ -736,8 +735,7 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,
736735

737736
for (i = 0; i < conf->bank_data[num].num_sensors; i++)
738737
writel(conf->sensor_mux_values[conf->bank_data[num].sensors[i]],
739-
mt->thermal_base +
740-
conf->adcpnp[conf->bank_data[num].sensors[i]]);
738+
mt->thermal_base + conf->adcpnp[i]);
741739

742740
writel((1 << conf->bank_data[num].num_sensors) - 1,
743741
controller_base + TEMP_MONCTL0);

0 commit comments

Comments
 (0)