From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Amit Kucheria <amitk@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Zhang Rui <rui.zhang@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] thermal: Validate new state in cur_state_store()
Date: Mon, 17 Oct 2022 15:33:00 +0530 [thread overview]
Message-ID: <cover.1666000867.git.viresh.kumar@linaro.org> (raw)
In cur_state_store(), the new state of the cooling device is received
from user-space and is not validated by the thermal core but the same is
left for the individual drivers to take care of. Apart from duplicating
the code it leaves possibility for introducing bugs where a driver may
not do it right.
Lets make the thermal core check the new state itself and store the max
value in the cooling device structure.
Once this is merged, I will update the thermal drivers to stop checking
for the same.
Based of v6.1-rc1.
Viresh Kumar (2):
thermal: Validate new state in cur_state_store()
thermal: sysfs: Reuse cdev->max_state
drivers/thermal/gov_fair_share.c | 6 +-----
drivers/thermal/thermal_core.c | 15 ++++++-------
drivers/thermal/thermal_sysfs.c | 37 +++++++++++++-------------------
include/linux/thermal.h | 1 +
4 files changed, 24 insertions(+), 35 deletions(-)
--
2.31.1.272.g89b43f80a514
next reply other threads:[~2022-10-17 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 10:03 Viresh Kumar [this message]
2022-10-17 10:03 ` [PATCH 1/2] thermal: Validate new state in cur_state_store() Viresh Kumar
2022-10-17 10:03 ` [PATCH 2/2] thermal: sysfs: Reuse cdev->max_state Viresh Kumar
2022-10-25 16:59 ` [PATCH 0/2] thermal: Validate new state in cur_state_store() Rafael J. Wysocki
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=cover.1666000867.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=amitk@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=vincent.guittot@linaro.org \
/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