mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
thermal/drivers/mediatek/lvts_thermal: Make reset optional for MT8196
Depending on the SoC+Firmware combination, the LVTS hardware may be may be actively used by one or even multiple concurrent MCUs! In this case, resetting it may produce either a severe slowdown of the entire system, or even a thermal protection AP reset, as some MCU(s) may be reading a very high or very low temperature while the LVTS is being reset. On those, don't fail if no reset is found as that may be omitted on purpose, but still check if there's one, because some board(s) may be running on a different bootchain with reduced firmwares or using firmwares with reduced functionality. So, use devm_reset_control_get_optional_exclusive() instead, as the LVTS controller always had only one reset and retrieving that by index, specifically, always made little sense anyway. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20260721105230.101906-3-angelogioacchino.delregno@collabora.com
This commit is contained in:
parent
5f0d4a7943
commit
6b73e78462
|
|
@ -1470,7 +1470,20 @@ static int lvts_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(lvts_td->base))
|
||||
return dev_err_probe(dev, PTR_ERR(lvts_td->base), "Failed to map io resource\n");
|
||||
|
||||
lvts_td->reset = devm_reset_control_get_by_index(dev, 0);
|
||||
/*
|
||||
* Depending on the SoC+Firmware combination, the LVTS hardware may be
|
||||
* may be actively used by one or even multiple concurrent MCUs!
|
||||
* In this case, resetting it may produce either a severe slowdown of
|
||||
* the entire system, or even a thermal protection AP reset, as some
|
||||
* MCU(s) may be reading a very high or very low temperature while the
|
||||
* LVTS is being reset.
|
||||
*
|
||||
* On those, don't fail if no reset is found as that may be omitted on
|
||||
* purpose, but still check if there's one, because some board(s) may
|
||||
* be running on a different bootchain with reduced firmwares or using
|
||||
* firmwares with reduced functionality.
|
||||
*/
|
||||
lvts_td->reset = devm_reset_control_get_optional_exclusive(dev, NULL);
|
||||
if (IS_ERR(lvts_td->reset))
|
||||
return dev_err_probe(dev, PTR_ERR(lvts_td->reset), "Failed to get reset control\n");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user