mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Lukasz Luba" <lukasz.luba@arm.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Peter Kästle" <peter@piie.net>
Subject: [PATCH v1 0/4] thermal: gov_bang_bang: Prevent cooling devices from getting stuck in the "on" state
Date: Tue, 13 Aug 2024 16:23:35 +0200	[thread overview]
Message-ID: <1903691.tdWV9SEqCh@rjwysocki.net> (raw)

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!




             reply	other threads:[~2024-08-13 14:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 14:23 Rafael J. Wysocki [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1903691.tdWV9SEqCh@rjwysocki.net \
    --to=rjw@rjwysocki.net \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=peter@piie.net \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®