public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] thermal: gov_bang_bang: Prevent cooling devices from getting stuck in the "on" state
@ 2024-08-13 14:23 Rafael J. Wysocki
  2024-08-13 14:25 ` [PATCH v1 1/4] thermal: gov_bang_bang: Call __thermal_cdev_update() directly Rafael J. Wysocki
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Rafael J. Wysocki @ 2024-08-13 14:23 UTC (permalink / raw)
  To: Linux PM; +Cc: LKML, Lukasz Luba, Daniel Lezcano, Zhang Rui, Peter Kästle

Hi Everyone,

After changes made in 6.10, the Bang-bang governor has an initialization problem
on systems where cooling devices start in the "on" state, but the thermal zone
temperature stays below the corresponding trip points.

Namely, the Bang-bang governor only implements a .trip_crossed() callback which
only runs when a trip point is crossed.  If the zone temperature is always below
the trip point, that callback will never be invoked.  Now, if a cooling device
bound to that trip point starts in the "on" state, the governor has no chance
to change its state to "off".

This currently happens in the acerhdf driver, but it may as well happen elsewhere,
so I think that it needs to be addressed in the thermal subsystem.

It can be addressed by adding a .manage() callback to the Bang-bang governor,
which is done in patch [3/4].  That callback will be invoked every time
__thermal_zone_device_update() runs, not just when a trip is crossed, so it
can adjust the states of the cooling devices to the thermal zone temperature.
However, after running once, it becomes a pure needless overhead because the
states of cooling devices only need to be fixed up once (modulo some special
situations like system resume).

That's addressed in patch [4/4] which uses governor_data to store the information
on whether or not the states of the cooling devices will need to be adjusted.

Patches [1-2/4] are preliminary, but IMV it is better to make these changes
separately for clarity, but also in case they turn out to have a functional
effect which is not expected.

Overall, this series is a fix candidate for 6.11-rc because the change in
behavior addressed by it can be regarded as a regression with respect to 6.9.

Unfortunately, it affects this series:

https://lore.kernel.org/linux-pm/114901234.nniJfEyVGO@rjwysocki.net/

which will need to be reordered and rebased (slightly), but because I've dropped
one broken patch from it already, it will need to be changed anyway.

Thanks!




^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-08-16  3:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 14:23 [PATCH v1 0/4] thermal: gov_bang_bang: Prevent cooling devices from getting stuck in the "on" state Rafael J. Wysocki
2024-08-13 14:25 ` [PATCH v1 1/4] thermal: gov_bang_bang: Call __thermal_cdev_update() directly Rafael J. Wysocki
2024-08-13 21:03   ` Peter Kästle
2024-08-14  6:18   ` Zhang, Rui
2024-08-14 17:34     ` Rafael J. Wysocki
2024-08-16  3:00   ` Zhang, Rui
2024-08-13 14:26 ` [PATCH v1 2/4] thermal: gov_bang_bang: Split bang_bang_control() Rafael J. Wysocki
2024-08-13 21:03   ` Peter Kästle
2024-08-16  3:00   ` Zhang, Rui
2024-08-13 14:27 ` [PATCH v1 3/4] thermal: gov_bang_bang: Add .manage() callback Rafael J. Wysocki
2024-08-13 21:04   ` Peter Kästle
2024-08-13 21:07   ` Peter Kästle
2024-08-14 17:18     ` Rafael J. Wysocki
2024-08-14 20:55       ` Peter Kästle
2024-08-16  3:00   ` Zhang, Rui
2024-08-13 14:29 ` [PATCH v1 4/4] thermal: gov_bang_bang: Use governor_data to reduce overhead Rafael J. Wysocki
2024-08-13 21:08   ` Peter Kästle
2024-08-14  6:09   ` Zhang, Rui
2024-08-14 17:26     ` Rafael J. Wysocki
2024-08-15  3:26       ` Zhang, Rui
2024-08-15 12:35         ` Rafael J. Wysocki
2024-08-16  2:59           ` Zhang, Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox