Skip to content

thermal: Validate new state in cur_state_store()

Viresh Kumar linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2thermal: Validate new state in cur_state_store()drivers/thermal/gov_fair_share.c drivers/thermal/thermal_core.c drivers/thermal/thermal_sysfs.c +1 more+14 -190 replies
2/2thermal: sysfs: Reuse cdev->max_statedrivers/thermal/thermal_sysfs.c+10 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] thermal: Validate new state in cur_state_store()

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(-)
Signature · 1 line
2.31.1.272.g89b43f80a514