Re: [PATCH v2 2/8] thermal/debugfs: Do not extend mitigation episodes beyond system resume

From: Daniel Lezcano
Date: Mon Jun 10 2024 - 09:39:38 EST


On 10/06/2024 13:29, Rafael J. Wysocki wrote:
On Mon, Jun 10, 2024 at 10:28 AM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxx> wrote:

On 28/05/2024 16:53, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

Because thermal zone handling by the thermal core is started from
scratch during resume from system-wide suspend, prevent the debug
code from extending mitigation episodes beyond that point by ending
the mitigation episode currently in progress, if any, for each thermal
zone.

Why it is done at resume time and not at suspend time ?

Because it is related to thermal_zone_device_init() which also runs at
the resume time, so IMV it's better to keep these two pieces together.

Why would it be better to run this during suspend?

From a logical point of view, it makes more sense to cancel something at suspend time rather than resume. That prevents future readers to be puzzled by an action done in an unexpected place.

Technically speaking there is no difference if it is done during suspend or resume. Well... we want to prevent actions to be done at resume time in order to not increase the resume duration but I'm not sure this code is doing a big difference.

If you want to keep it as is, feel free to add my:

Acked-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog