kernel-fxtec-pro1x/kernel/sched
Qais Yousef cb0a2cdd48 UPSTREAM: sched/uclamp: Reject negative values in cpu_uclamp_write()
The check to ensure that the new written value into cpu.uclamp.{min,max}
is within range, [0:100], wasn't working because of the signed
comparison

 7301                 if (req.percent > UCLAMP_PERCENT_SCALE) {
 7302                         req.ret = -ERANGE;
 7303                         return req;
 7304                 }

	# echo -1 > cpu.uclamp.min
	# cat cpu.uclamp.min
	42949671.96

Cast req.percent into u64 to force the comparison to be unsigned and
work as intended in capacity_from_percent().

	# echo -1 > cpu.uclamp.min
	sh: write error: Numerical result out of range

Bug: 120440300
Fixes: 2480c093130f ("sched/uclamp: Extend CPU's cgroup controller")
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200114210947.14083-1-qais.yousef@arm.com
(cherry picked from commit b562d140649966d4daedd0483a8fe59ad3bb465a)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I17fc2b119dcbffb212e130ed2c37ae3a8d5bbb61
2020-03-03 11:41:08 +00:00
..
autogroup.c ANDROID: sched/autogroup: Define autogroup_path() for !CONFIG_SCHED_DEBUG 2018-10-26 12:44:03 +01:00
autogroup.h
clock.c
completion.c
core.c UPSTREAM: sched/uclamp: Reject negative values in cpu_uclamp_write() 2020-03-03 11:41:08 +00:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c cpufreq: Avoid leaving stale IRQ work items during CPU offline 2019-12-31 16:36:22 +01:00
cpufreq_schedutil.c ANDROID: Re-use SUGOV_RT_MAX_FREQ to control uclamp rt behavior 2020-02-01 16:14:12 +00:00
cpupri.c BACKPORT: sched/rt: Make RT capacity-aware 2020-02-01 15:03:16 +00:00
cpupri.h BACKPORT: sched/rt: Make RT capacity-aware 2020-02-01 15:03:16 +00:00
cputime.c This is the 4.19.82 stable release 2019-11-06 13:21:58 +01:00
deadline.c This is the 4.19.77 stable release 2019-10-06 11:27:45 +02:00
debug.c jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00
fair.c This is the 4.19.101 stable release 2020-02-02 20:22:38 +00:00
features.h UPSTREAM: sched/fair/util_est: Implement faster ramp-up EWMA on utilization increases 2020-02-01 17:35:00 +00:00
idle.c This is the 4.19.77 stable release 2019-10-06 11:27:45 +02:00
isolation.c
loadavg.c UPSTREAM: sched: loadavg: make calc_load_n() public 2019-03-21 16:25:27 -07:00
Makefile UPSTREAM: psi: pressure stall information for CPU, memory, and IO 2019-03-21 16:25:27 -07:00
membarrier.c sched/membarrier: Fix private expedited registration check 2019-10-11 18:21:22 +02:00
pelt.c UPSTREAM: sched/fair: Update scale invariance of PELT 2019-03-26 14:22:50 +00:00
pelt.h UPSTREAM: sched/fair: Update scale invariance of PELT 2019-03-26 14:22:50 +00:00
psi.c UPSTREAM: sched/psi: Fix OOB write when writing 0 bytes to PSI files 2020-02-28 15:30:25 +00:00
rt.c BACKPORT: sched/rt: Make RT capacity-aware 2020-02-01 15:03:16 +00:00
sched-pelt.h sched/fair: Fix "runnable_avg_yN_inv" not used warnings 2019-07-26 09:14:08 +02:00
sched.h ANDROID: sched/core: Move SchedTune task API into UtilClamp wrappers 2020-02-01 16:14:11 +00:00
stats.c
stats.h UPSTREAM: psi: make disabling/enabling easier for vendor kernels 2019-03-21 16:25:27 -07:00
stop_task.c FROMLIST: sched/fair: Use wake_q length as a hint for wake_wide 2018-10-26 12:15:52 +01:00
swait.c
topology.c UPSTREAM: sched/topology: Introduce a sysctl for Energy Aware Scheduling 2020-02-19 10:50:59 +00:00
tune.c ANDROID: increase limit on sched-tune boost groups 2020-02-26 21:55:29 +00:00
tune.h ANDROID: sched/tune: Move SchedTune cpu API into UtilClamp wrappers 2020-02-01 15:03:17 +00:00
wait.c
wait_bit.c