Re: [PATCH v2 2/2] thermal/drivers/mediatek/lvts_thermal: Make reset optional for MT8196
Philipp Zabel <[email protected]>
| Newsgroups | org.infradead.lists.linux-mediatek,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
On Di, 2026-07-21 at 12:52 +0200, AngeloGioacchino Del Regno wrote: > 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 <[email protected]> > --- > drivers/thermal/mediatek/lvts_thermal.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c > index 92711896ce24..8b779fc5e970 100644 > --- a/drivers/thermal/mediatek/lvts_thermal.c > +++ b/drivers/thermal/mediatek/lvts_thermal.c > @@ -1473,7 +1473,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); Reviewed-by: Philipp Zabel <[email protected]> regards Philipp