thermal/drivers/mediatek/lvts: fix mt7987 thermal crash
Subsystems (2)
PATCH 1/1 thermal/drivers/mediatek/lvts: fix mt7987 thermal crash
From: Frank Wunderlich <[email protected]>
On mt7987 we see a crash due to missing ops entry.
[ 1.518540] Internal error: Oops: 0000000096000005 [#1] SMP ... [ 1.564481] pc : lvts_get_temp+0x84/0xc4 [ 1.564492] lr : lvts_get_temp+0x60/0xc4 ... [ 1.620900] Call trace: [ 1.631753] lvts_get_temp+0x84/0xc4 (P) [ 1.645471] __thermal_zone_get_temp+0x24/0x11c [ 1.656502] __thermal_zone_device_update+0x9c/0x52c
Add the new ops member added in 7.0-rc1 for mt7987 too.
--- drivers/thermal/mediatek/lvts_thermal.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/mediatek/lvts_thermal.c +1 -0
@@ -2026,6 +2026,7 @@ static const struct lvts_data mt7987_lvts_ap_data = { .temp_offset = LVTS_COEFF_B_MT7987, .gt_calib_bit_offset = 32, .def_calibration = 19380, + .ops = &lvts_platform_ops_mt7988, };static const struct lvts_data mt7988_lvts_ap_data = {
Signature · 1 line
2.43.0
Hi!
Quoted 14 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
On mt7987 we see a crash due to missing ops entry.
[ 1.518540] Internal error: Oops: 0000000096000005 [#1] SMP ... [ 1.564481] pc : lvts_get_temp+0x84/0xc4 [ 1.564492] lr : lvts_get_temp+0x60/0xc4 ... [ 1.620900] Call trace: [ 1.631753] lvts_get_temp+0x84/0xc4 (P) [ 1.645471] __thermal_zone_get_temp+0x24/0x11c [ 1.656502] __thermal_zone_device_update+0x9c/0x52c
Quoted 3 lines
Add the new ops member added in 7.0-rc1 for mt7987 too.
Fixes a4c40559499f ("thermal/drivers/mediatek/lvts: Add platform ops to support alternative conversion logic")
I think the Fixes tag should reference "thermal/drivers/mediatek/lvts_thermal: Add mt7987 support", as the commit introducing the ops also updated all existing data structs (seems like mt7987 support landed right after).
drivers/thermal/mediatek/lvts_thermal.c static const struct lvts_data mt7987_lvts_ap_data = { · line 2028
Quoted 13 lines
Signed-off-by Frank Wunderlich <[email protected]>--- drivers/thermal/mediatek/lvts_thermal.c | 1 + 1 file changed, 1 insertion(+)drivers/thermal/mediatek/lvts_thermal.c +0
-0@@ -2026,6 +2026,7 @@ static const struct lvts_data mt7987_lvts_ap_data = { .temp_offset = LVTS_COEFF_B_MT7987, .gt_calib_bit_offset = 32, .def_calibration = 19380,
You'll probably need to define num_cal_offsets too, since the number of calibration bytes was also made configurable (not sure if this is already addressed by a separate patch).
drivers/thermal/mediatek/lvts_thermal.c static const struct lvts_data mt7987_lvts_ap_data = { · line 2032
Quoted 4 lines
drivers/thermal/mediatek/lvts_thermal.c +1
-0+ .ops = &lvts_platform_ops_mt7988, };static const struct lvts_data mt7988_lvts_ap_data = {
Best,
Laura
Am 11. März 2026 10:35:19 MEZ schrieb Laura Nao <[email protected]>:
Quoted 17 lines
Hi!
Quoted 14 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
On mt7987 we see a crash due to missing ops entry.
[ 1.518540] Internal error: Oops: 0000000096000005 [#1] SMP ... [ 1.564481] pc : lvts_get_temp+0x84/0xc4 [ 1.564492] lr : lvts_get_temp+0x60/0xc4 ... [ 1.620900] Call trace: [ 1.631753] lvts_get_temp+0x84/0xc4 (P) [ 1.645471] __thermal_zone_get_temp+0x24/0x11c [ 1.656502] __thermal_zone_device_update+0x9c/0x52c
Quoted 8 lines
Quoted 3 lines
Add the new ops member added in 7.0-rc1 for mt7987 too.
Fixes a4c40559499f ("thermal/drivers/mediatek/lvts: Add platform ops to support alternative conversion logic")I think the Fixes tag should reference "thermal/drivers/mediatek/lvts_thermal: Add mt7987 support", as the commit introducing the ops also updated all existing data structs (seems like mt7987 support landed right after).
Ok, i will change this. Have not looked on order how commits are applied. Both commits were new in 7.0.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Frank Wunderlich <[email protected]>--- drivers/thermal/mediatek/lvts_thermal.c | 1 + 1 file changed, 1 insertion(+)
Quoted 12 lines
drivers/thermal/mediatek/lvts_thermal.c static const struct lvts_data mt7987_lvts_ap_data = { · line 2028
Quoted 8 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-0@@ -2026,6 +2026,7 @@ static const struct lvts_data mt7987_lvts_ap_data = { .temp_offset = LVTS_COEFF_B_MT7987, .gt_calib_bit_offset = 32, .def_calibration = 19380,You'll probably need to define
num_cal_offsetstoo, since the number of calibration bytes was also made configurable (not sure if this is already addressed by a separate patch).
Thanks for pointing to this.
Should i change in same patch or in separate one?
Quoted 8 lines
drivers/thermal/mediatek/lvts_thermal.c static const struct lvts_data mt7987_lvts_ap_data = { · line 2032
Quoted 4 lines
drivers/thermal/mediatek/lvts_thermal.c +1
-0+ .ops = &lvts_platform_ops_mt7988, };static const struct lvts_data mt7988_lvts_ap_data = {Best,
Laura
regards Frank
Hi,
Quoted 48 lines · Frank Wunderlich
Am 11. März 2026 10:35:19 MEZ schrieb Laura Nao <[email protected]>:
Quoted 17 lines
Hi!
Quoted 14 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
On mt7987 we see a crash due to missing ops entry.
[ 1.518540] Internal error: Oops: 0000000096000005 [#1] SMP ... [ 1.564481] pc : lvts_get_temp+0x84/0xc4 [ 1.564492] lr : lvts_get_temp+0x60/0xc4 ... [ 1.620900] Call trace: [ 1.631753] lvts_get_temp+0x84/0xc4 (P) [ 1.645471] __thermal_zone_get_temp+0x24/0x11c [ 1.656502] __thermal_zone_device_update+0x9c/0x52cQuoted 8 lines
Quoted 3 lines
Add the new ops member added in 7.0-rc1 for mt7987 too.
Fixes a4c40559499f ("thermal/drivers/mediatek/lvts: Add platform ops to support alternative conversion logic")I think the Fixes tag should reference "thermal/drivers/mediatek/lvts_thermal: Add mt7987 support", as the commit introducing the ops also updated all existing data structs (seems like mt7987 support landed right after).
Ok, i will change this. Have not looked on order how commits are applied. Both commits were new in 7.0.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Frank Wunderlich <[email protected]>--- drivers/thermal/mediatek/lvts_thermal.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/thermal/mediatek/lvts_thermal.c static const struct lvts_data mt7987_lvts_ap_data = { · line 2028
Quoted 8 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-0@@ -2026,6 +2026,7 @@ static const struct lvts_data mt7987_lvts_ap_data = { .temp_offset = LVTS_COEFF_B_MT7987, .gt_calib_bit_offset = 32, .def_calibration = 19380,You'll probably need to define
num_cal_offsetstoo, since the number of calibration bytes was also made configurable (not sure if this is already addressed by a separate patch).
Quoted 3 lines
Thanks for pointing to this.
Should i change in same patch or in separate one?
I would suggest including this in the v2 of this patch, updating the commit title and message to mention that both the ops and num_cal_offsets were added.
Best,
Laura