public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] thermal: Validate new state in cur_state_store()
@ 2022-10-17 10:03 Viresh Kumar
  2022-10-17 10:03 ` [PATCH 1/2] " Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Viresh Kumar @ 2022-10-17 10:03 UTC (permalink / raw)
  To: Rafael J. Wysocki, Amit Kucheria, Daniel Lezcano, Zhang Rui
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Dan Carpenter,
	linux-kernel

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


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

end of thread, other threads:[~2022-10-25 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 10:03 [PATCH 0/2] thermal: Validate new state in cur_state_store() Viresh Kumar
2022-10-17 10:03 ` [PATCH 1/2] " 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

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