Youngtae Lee [Wed, 2 May 2018 02:27:23 +0000 (11:27 +0900)]
samsung: emc: set base mode when user_mode is disabled
Change-Id: I12176542ddcba548913d5c0c0d14e81c4b9c9b6e
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Wed, 2 May 2018 01:54:04 +0000 (10:54 +0900)]
cpufreq: acme: get_freq returns cached freq when access offline cluster
Change-Id: Id3a3fb04256664644a4a3daf61f2764e0c10462e
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Fri, 27 Apr 2018 06:29:48 +0000 (15:29 +0900)]
cpufreq: acme: Add function to check max_constraints of boost domain.
Change-Id: I956942e6ed1ea6e1da8ccd1f747d9cf503b95b2b
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Fri, 27 Apr 2018 06:28:58 +0000 (15:28 +0900)]
samsung: emc: Add function to check target_freq is available
Change-Id: Ie957e3d0c8064f5d8b2fa324fb1205d373554cf6
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Fri, 27 Apr 2018 04:49:39 +0000 (13:49 +0900)]
cpu: support cpus_up for fast hotplug in
Change-Id: I5dc7103355eed846fdb839fbf721547055f5297f
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Thu, 26 Apr 2018 12:31:48 +0000 (21:31 +0900)]
samsung: emc: change msleep to udelay and expired time for power checking
Change-Id: I274968b7291ba0f23fcd1943e4dd2116ce62b680
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Thu, 26 Apr 2018 12:29:58 +0000 (21:29 +0900)]
arm64: smp: change print level of "shutdown"
Change-Id: Ieb68cd68af9c7b98fb2fc0c6399be28766212719
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Thu, 26 Apr 2018 05:48:29 +0000 (14:48 +0900)]
samsung: emc: Change priority of change thread
Change-Id: I480a38e996aa94781811c18988d3c1232b5d1327
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Thu, 26 Apr 2018 04:56:00 +0000 (13:56 +0900)]
base: topology: Don't add/remove sysfs for hotplug
To reduce hotplug time, don't add or remove sysfs group
Change-Id: I1b7cab11e9157f5291492d8412e4e815a6cec96c
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Tue, 24 Apr 2018 10:03:37 +0000 (19:03 +0900)]
cpu: Support to paraller takedown_cpus
Change-Id: Ia40b4c61adf95de510832bfd0d5fa4db0adda06d
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Tue, 24 Apr 2018 08:47:28 +0000 (17:47 +0900)]
Revert "smp/hotplug: Differentiate the AP-work lockdep class between up and down"
This reverts commit
5f4b55e10645b7371322c800a5ec745cab487a6c.
Change-Id: I841ec3c7ecd6197ae30c52987c8d6e86655d453e
Youngtae Lee [Tue, 24 Apr 2018 08:44:52 +0000 (17:44 +0900)]
Revert "cpu/hotplug: Convert hotplug locking to percpu rwsem"
This reverts commit
fc8dffd379ca5620664336eb895a426b42847558.
Change-Id: I842b5ee4c622f1a892a1a292f5a4ad886943320c
Youngtae Lee [Mon, 23 Apr 2018 11:16:21 +0000 (20:16 +0900)]
cpu: change order and mehod for sched_active/deactive
Change-Id: Ia456ad0febd5c63be8390f74ec6a80c6a60499f4
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 07:29:22 +0000 (16:29 +0900)]
samsung: cpupm: Disable idle during hotplug in-out
Change-Id: I4eaff38545bf584b3867da9078b16bebaf42499d
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 07:23:25 +0000 (16:23 +0900)]
kernel: cpu: support to processe paraller cpus hp
Change-Id: I0dc6c787a773b7784d7fc0ab566e47a49835b00b
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 04:06:33 +0000 (13:06 +0900)]
sched: schedutil: remove syncronize_rcu for fast hp
Change-Id: I3eebe5d8e12fc8fe5bc0810949c76883cb0564be
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 04:00:19 +0000 (13:00 +0900)]
cpufreq: Add fast_on/offline for fast hotplug
This function performs fast hotplug processing
on fast hp cpus at once. Even if cluster off,
executes only goernor stop & start for fast hp
Change-Id: I288ebd19ee0fbb91f596234eac0fb11fd71573c5
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 03:59:32 +0000 (12:59 +0900)]
samsung: cpuhp: Support cpus_up/down for fast hotplug
Change-Id: I02aa69a55c80e3e1ff43a2eb790b01adee6a78c7
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Youngtae Lee [Mon, 23 Apr 2018 03:57:31 +0000 (12:57 +0900)]
cpu: Support cpus_up/dow for fast hotplug
Change-Id: Ib0b3da952426338a4afc7e388c9fd5d6874cdce7
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
Park Bumgyu [Fri, 25 May 2018 05:01:52 +0000 (14:01 +0900)]
sched: ems: introduce task band
Change-Id: Ic3fbe3e80c8033f5c1c77f02cb0eeb6ee04d9630
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
lakkyung.jung [Tue, 24 Apr 2018 14:02:12 +0000 (23:02 +0900)]
sched: fair: Add support to PELT ramp/decay timings
Change-Id: If12dd8b4df211c898667cdb7c8b42d0eba9ac200
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Fri, 4 May 2018 11:16:53 +0000 (20:16 +0900)]
sched: fair/ems: Add schedtune_util_est
Change-Id: I0a0f1723356683829ce709ec750f4f013aa1c75b
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Fri, 4 May 2018 01:20:03 +0000 (10:20 +0900)]
sched: tune: Add utilest interface to schedtune.
Change-Id: I4e5313f7128f5aa599b7214eaf13679d1f9484ef
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Mon, 16 Apr 2018 14:05:00 +0000 (23:05 +0900)]
sched: fair/ems: Add to apply util-est to wake up balance.
Change-Id: Ia3ff1303d3180612308399d0f311d6c278ddefa9
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Mon, 16 Apr 2018 13:22:43 +0000 (22:22 +0900)]
sched/events: Introduce util_est trace events
Change-Id: I22c98bbaa7dda598d31a20b310afbf16d5fb8208
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Mon, 16 Apr 2018 06:46:16 +0000 (15:46 +0900)]
sched/fair: update util_est only on util_avg updates
The estimated utilization of a task is currently updated every time the
task is dequeued. However, to keep overheads under control, PELT signals
are effectively updated at maximum once every 1ms.
Thus, for really short running tasks, it can happen that their util_avg
value has not been updates since their last enqueue. If such tasks are
also frequently running tasks (e.g. the kind of workload generated by
hackbench) it can also happen that their util_avg is updated only every
few activations.
This means that updating util_est at every dequeue potentially introduces
not necessary overheads and it's also conceptually wrong if the util_avg
signal has never been updated during a task activation.
Let's introduce a throttling mechanism on task's util_est updates
to sync them with util_avg updates. To make the solution memory
efficient, both in terms of space and load/store operations, we encode a
synchronization flag into the LSB of util_est.enqueued.
This makes util_est an even values only metric, which is still
considered good enough for its purpose.
The synchronization bit is (re)set by __update_load_avg_se() once the
PELT signal of a task has been updated during its last activation.
Such a throttling mechanism allows to keep under control util_est
overheads in the wakeup hot path, thus making it a suitable mechanism
which can be enabled also on high-intensity workload systems.
Thus, this now switches on by default the estimation utilization
scheduler feature.
Change-Id: Ia548c1fa33ab1e9d20faa0bf7503ebaba5946063
Suggested-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Turner <pjt@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: linux-kernel@vger.kernel.org
lakkyung.jung [Mon, 16 Apr 2018 02:23:13 +0000 (11:23 +0900)]
sched/cpufreq_schedutil: use util_est for OPP selection
- backport util-est from linux-power.git
When schedutil looks at the CPU utilization, the current PELT value for
that CPU is returned straight away. In certain scenarios this can have
undesired side effects and delays on frequency selection.
For example, since the task utilization is decayed at wakeup time, a
long sleeping big task newly enqueued does not add immediately a
significant contribution to the target CPU. This introduces some latency
before schedutil will be able to detect the best frequency required by
that task.
Moreover, the PELT signal build-up time is a function of the current
frequency, because of the scale invariant load tracking support. Thus,
starting from a lower frequency, the utilization build-up time will
increase even more and further delays the selection of the actual
frequency which better serves the task requirements.
In order to reduce this kind of latencies, we integrate the usage
of the CPU's estimated utilization in the sugov_get_util function.
This allows to properly consider the expected utilization of a CPU which,
for example, has just got a big task running after a long sleep period.
Ultimately this allows to select the best frequency to run a task
right after its wake-up.
Change-Id: Ibf98a4be222546733cbd88b9a8f2c8858319dd96
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Paul Turner <pjt@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
lakkyung.jung [Mon, 16 Apr 2018 02:07:57 +0000 (11:07 +0900)]
sched/fair: use util_est in LB and WU paths
When the scheduler looks at the CPU utilization, the current PELT value
for a CPU is returned straight away. In certain scenarios this can have
undesired side effects on task placement.
For example, since the task utilization is decayed at wakeup time, when
a long sleeping big task is enqueued it does not add immediately a
significant contribution to the target CPU.
As a result we generate a race condition where other tasks can be placed
on the same CPU while it is still considered relatively empty.
In order to reduce this kind of race conditions, this patch introduces the
required support to integrate the usage of the CPU's estimated utilization
in the wakeup path, via cpu_util_wake(), as well as in the load-balance
path, via cpu_util() which is used by update_sg_lb_stats().
The estimated utilization of a CPU is defined to be the maximum between
its PELT's utilization and the sum of the estimated utilization (at
previous dequeue time) of all the tasks currently RUNNABLE on that CPU.
This allows to properly represent the spare capacity of a CPU which, for
example, has just got a big task running since a long sleep period.
Change-Id: Iab14de2d509a15974c3176f091c0d5197cdbd081
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Paul Turner <pjt@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
lakkyung.jung [Mon, 16 Apr 2018 01:25:28 +0000 (10:25 +0900)]
sched/fair: add util_est on top of PELT
- backport util-est from linux-power.git
The util_avg signal computed by PELT is too variable for some use-cases.
For example, a big task waking up after a long sleep period will have its
utilization almost completely decayed. This introduces some latency before
schedutil will be able to pick the best frequency to run a task.
The same issue can affect task placement. Indeed, since the task
utilization is already decayed at wakeup, when the task is enqueued in a
CPU, this can result in a CPU running a big task as being temporarily
represented as being almost empty. This leads to a race condition where
other tasks can be potentially allocated on a CPU which just started to run
a big task which slept for a relatively long period.
Moreover, the PELT utilization of a task can be updated every [ms], thus
making it a continuously changing value for certain longer running
tasks. This means that the instantaneous PELT utilization of a RUNNING
task is not really meaningful to properly support scheduler decisions.
For all these reasons, a more stable signal can do a better job of
representing the expected/estimated utilization of a task/cfs_rq.
Such a signal can be easily created on top of PELT by still using it as
an estimator which produces values to be aggregated on meaningful
events.
This patch adds a simple implementation of util_est, a new signal built on
top of PELT's util_avg where:
util_est(task) = max(task::util_avg, f(task::util_avg@dequeue))
This allows to remember how big a task has been reported by PELT in its
previous activations via f(task::util_avg@dequeue), which is the new
_task_util_est(struct task_struct*) function added by this patch.
If a task should change its behavior and it runs longer in a new
activation, after a certain time its util_est will just track the
original PELT signal (i.e. task::util_avg).
The estimated utilization of cfs_rq is defined only for root ones.
That's because the only sensible consumer of this signal are the
scheduler and schedutil when looking for the overall CPU utilization
due to FAIR tasks.
For this reason, the estimated utilization of a root cfs_rq is simply
defined as:
util_est(cfs_rq) = max(cfs_rq::util_avg, cfs_rq::util_est::enqueued)
where:
cfs_rq::util_est::enqueued = sum(_task_util_est(task))
for each RUNNABLE task on that root cfs_rq
It's worth to note that the estimated utilization is tracked only for
objects of interests, specifically:
- Tasks: to better support tasks placement decisions
- root cfs_rqs: to better support both tasks placement decisions as
well as frequencies selection
Change-Id: Ic5cad5aab372a8a247024e5304e4a55191fe16ea
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Paul Turner <pjt@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
lakkyung.jung [Thu, 12 Jul 2018 03:58:44 +0000 (12:58 +0900)]
arm64: dtsi: Modify lbt ratio to spread task within coregroup.
Change-Id: I9eba9ffc0c9b9f42d9daca3474cd0570d6a45db4
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
lakkyung.jung [Thu, 12 Jul 2018 01:57:44 +0000 (10:57 +0900)]
arm64: dtsi: Modify ontime node structure.
- Modify to define ontime conditions for each coregroup, not for each step
- Rename threshold to boundary
- Remove min-residency-us condition
- Add coverage-ratio condition
Change-Id: I44e31dd1c68f017c288739699c74973c6d6d2107
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
Daeyeong Lee [Mon, 4 Jun 2018 06:57:36 +0000 (15:57 +0900)]
sched: ems: ontime: Rename ontime threshold to boundary.
Change-Id: I124f16d1cc884884fe0f58de5e871b53da6c1372
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Thu, 31 May 2018 07:41:40 +0000 (16:41 +0900)]
sched: ems: ontime: Clear unnecessary sequence to migrate ontime task.
Change-Id: I29083497168ad57712394d12ba98d1997f5a6cba
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Wed, 23 May 2018 06:10:24 +0000 (15:10 +0900)]
sched: ems: ontime: Change new entity's initial ontime load policy.
Change-Id: I4688cd1fb459ca74092b386356843b37d361b07a
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Fri, 18 May 2018 06:51:50 +0000 (15:51 +0900)]
sched: ems: ontime: Allow to migrate to active core within coverage ratio.
Change-Id: I501963c396772bdd5051e7c69e8d642bcbdfac59
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Mon, 14 May 2018 10:09:11 +0000 (19:09 +0900)]
sched: ems: ontime: Don't allow to down-migrate heaviest task.
Change-Id: I0daf9e82d69438155ce80c33a6a4709523462491
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Mon, 14 May 2018 01:52:03 +0000 (10:52 +0900)]
sched: ems: ontime: Use fit cpus when ontime migration.
Change-Id: Icea69935638628cb8dc41d38a47a9bc4046110b0
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Fri, 18 May 2018 02:01:56 +0000 (11:01 +0900)]
sched: ems: ontime: Use fit cpus when ontime task wake-up.
Change-Id: I143735486cb003fea16d80144bb67ffaeb2bf01e
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Fri, 18 May 2018 01:58:30 +0000 (10:58 +0900)]
sched: ems: ontime: Add API to find fit cpus for heavy task.
Change-Id: I833b0c6997c40eb239836ba54385d3acb782b9ec
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 11:05:16 +0000 (20:05 +0900)]
sched: ems: ontime: Modify message of ontime trace log.
Change-Id: I5560fd905fa03b77e4f609fc7d5d983b0405ac8c
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 10:56:09 +0000 (19:56 +0900)]
sched: ems: ontime: Remove distinction between ontime and normal task.
Change-Id: I343feff2d7db0d97d3813b570193f1ee8e3af93e
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 10:34:41 +0000 (19:34 +0900)]
sched: ems: ontime: Remove min_residency at ontime condition.
Change-Id: I2263bff40f49ff9c9f112aac1db0546330c1447f
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 10:11:05 +0000 (19:11 +0900)]
sched: ems: ontime: Modify sysfs node for new structure.
Change-Id: Iaf7001616dde4f95f126e2021e4efd42b90fcc69
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 08:06:21 +0000 (17:06 +0900)]
sched: ems: ontime: Modify ontime condition structure.
- Modify the ontime condition to have each coregroup individually
- Use list_head struct instead of ontime_cond *next
Change-Id: I0e81c10af914a82d09ceedaf08975efdfb9f7e3a
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 07:09:07 +0000 (16:09 +0900)]
sched: ems: ontime: Code clean-up for readability.
Change-Id: I93097d20d27b7899526b3569aaf99378ff6e1856
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
Daeyeong Lee [Tue, 8 May 2018 06:18:47 +0000 (15:18 +0900)]
sched: ehmp: Check whether curr_task is perfer_perf when searching heavy task.
Change-Id: Ic9cd388cc173fdca6c43ec9dec0b4db6c16df305
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
lakkyung.jung [Thu, 12 Jul 2018 01:46:06 +0000 (10:46 +0900)]
Revert "sched: ems: Resolve prevent issue of ontime"
This reverts commit
7798e78210369f2f81eb4d65cd1bb5e5f301efb8.
Change-Id: I17d22ed1d1d0d347e64f2d33ebc75e4ac31a00f4
Soohyun Kim [Fri, 8 Jun 2018 07:25:00 +0000 (16:25 +0900)]
samsung: acme: skip unnecessary operation when frequency change.
do nothing when target frequency is same with old frequency.
Change-Id: I9ca59361dd4849f27d2a1828f8dba28060ead5ef
Signed-off-by: Soohyun Kim <soohyuni.kim@samsung.com>
lakkyung.jung [Thu, 12 Jul 2018 01:44:27 +0000 (10:44 +0900)]
arm64: dts: fill up the virtual cluster info
Change-Id: I6bd3b3e43ca4af9de069bdc8e4f2f6b8d22c58c4
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
Johnlay Park [Fri, 8 Jun 2018 14:45:20 +0000 (23:45 +0900)]
soc: samsung: cpupm: introduce virtual cluster info
to abstract the CPU topology
Change-Id: I4e13b6a45059743ceab143ba95826a35670b5357
Signed-off-by: Johnlay Park <jonglae.park@samsung.com>
Johnlay Park [Fri, 8 Jun 2018 11:41:00 +0000 (20:41 +0900)]
cpufreq: acme: optimize the clock handling when buck off
Change-Id: I661307b7c2045111166bbb269f675c8ba691841b
Signed-off-by: Johnlay Park <jonglae.park@samsung.com>
Davidlohr Bueso [Mon, 2 Apr 2018 16:49:54 +0000 (09:49 -0700)]
sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning
[ Upstream commit
d29a20645d5e929aa7e8616f28e5d8e1c49263ec ]
While running rt-tests' pi_stress program I got the following splat:
rq->clock_update_flags < RQCF_ACT_SKIP
WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 assert_clock_updated.isra.38.part.39+0x13/0x20
[...]
<IRQ>
enqueue_top_rt_rq+0xf4/0x150
? cpufreq_dbs_governor_start+0x170/0x170
sched_rt_rq_enqueue+0x65/0x80
sched_rt_period_timer+0x156/0x360
? sched_rt_rq_enqueue+0x80/0x80
__hrtimer_run_queues+0xfa/0x260
hrtimer_interrupt+0xcb/0x220
smp_apic_timer_interrupt+0x62/0x120
apic_timer_interrupt+0xf/0x20
</IRQ>
[...]
do_idle+0x183/0x1e0
cpu_startup_entry+0x5f/0x70
start_secondary+0x192/0x1d0
secondary_startup_64+0xa5/0xb0
We can get rid of it be the "traditional" means of adding an
update_rq_clock() call after acquiring the rq->lock in
do_sched_rt_period_timer().
The case for the RT task throttling (which this workload also hits)
can be ignored in that the skip_update call is actually bogus and
quite the contrary (the request bits are removed/reverted).
By setting RQCF_UPDATED we really don't care if the skip is happening
or not and will therefore make the assert_clock_updated() check happy.
Change-Id: I12014f33e599de5a35f39dd742555a2f99403b20
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@stgolabs.net
Cc: linux-kernel@vger.kernel.org
Cc: rostedt@goodmis.org
Link: http://lkml.kernel.org/r/20180402164954.16255-1-dave@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joel Fernandes [Thu, 9 Nov 2017 18:52:19 +0000 (10:52 -0800)]
UPSTREAM: sched/fair: Consider RT/IRQ pressure in capacity_spare_wake
capacity_spare_wake in the slow path influences choice of idlest groups,
as we search for groups with maximum spare capacity. In scenarios where
RT pressure is high, a sub optimal group can be chosen and hurt
performance of the task being woken up.
Several tests with results are included below to show improvements with
this change.
1) Hackbench on Pixel 2 Android device (4x4 ARM64 Octa core)
------------------------------------------------------------
Here we have RT activity running on big CPU cluster induced with rt-app,
and running hackbench in parallel. The RT tasks are bound to 4 CPUs on
the big cluster (cpu 4,5,6,7) and have 100ms periodicity with
runtime=20ms sleep=80ms.
Hackbench shows big benefit (30%) improvement when number of tasks is 8
and 32: Note: data is completion time in seconds (lower is better).
Number of loops for 8 and 16 tasks is 50000, and for 32 tasks its 20000.
+--------+-----+-------+-------------------+---------------------------+
| groups | fds | tasks | Without Patch | With Patch |
+--------+-----+-------+---------+---------+-----------------+---------+
| | | | Mean | Stdev | Mean | Stdev |
| | | +-------------------+-----------------+---------+
| 1 | 8 | 8 | 1.0534 | 0.13722 | 0.7293 (+30.7%) | 0.02653 |
| 2 | 8 | 16 | 1.6219 | 0.16631 | 1.6391 (-1%) | 0.24001 |
| 4 | 8 | 32 | 1.2538 | 0.13086 | 1.1080 (+11.6%) | 0.16201 |
+--------+-----+-------+---------+---------+-----------------+---------+
2) Rohit ran barrier.c test (details below) with following improvements:
------------------------------------------------------------------------
This was Rohit's original use case for a patch he posted at [1] however
from his recent tests he showed my patch can replace his slow path
changes [1] and there's no need to selectively scan/skip CPUs in
find_idlest_group_cpu in the slow path to get the improvement he sees.
barrier.c (open_mp code) as a micro-benchmark. It does a number of
iterations and barrier sync at the end of each for loop.
Here barrier,c is running in along with ping on CPU 0 and 1 as:
'ping -l 10000 -q -s 10 -f hostX'
barrier.c can be found at:
http://www.spinics.net/lists/kernel/msg2506955.html
Following are the results for the iterations per second with this
micro-benchmark (higher is better), on a 44 core, 2 socket 88 Threads
Intel x86 machine:
+--------+------------------+---------------------------+
|Threads | Without patch | With patch |
| | | |
+--------+--------+---------+-----------------+---------+
| | Mean | Std Dev | Mean | Std Dev |
+--------+--------+---------+-----------------+---------+
|1 | 539.36 | 60.16 | 572.54 (+6.15%) | 40.95 |
|2 | 481.01 | 19.32 | 530.64 (+10.32%)| 56.16 |
|4 | 474.78 | 22.28 | 479.46 (+0.99%) | 18.89 |
|8 | 450.06 | 24.91 | 447.82 (-0.50%) | 12.36 |
|16 | 436.99 | 22.57 | 441.88 (+1.12%) | 7.39 |
|32 | 388.28 | 55.59 | 429.4 (+10.59%)| 31.14 |
|64 | 314.62 | 6.33 | 311.81 (-0.89%) | 11.99 |
+--------+--------+---------+-----------------+---------+
3) ping+hackbench test on bare-metal sever (Rohit ran this test)
----------------------------------------------------------------
Here hackbench is running in threaded mode along
with, running ping on CPU 0 and 1 as:
'ping -l 10000 -q -s 10 -f hostX'
This test is running on 2 socket, 20 core and 40 threads Intel x86
machine:
Number of loops is 10000 and runtime is in seconds (Lower is better).
+--------------+-----------------+--------------------------+
|Task Groups | Without patch | With patch |
| +-------+---------+----------------+---------+
|(Groups of 40)| Mean | Std Dev | Mean | Std Dev |
+--------------+-------+---------+----------------+---------+
|1 | 0.851 | 0.007 | 0.828 (+2.77%)| 0.032 |
|2 | 1.083 | 0.203 | 1.087 (-0.37%)| 0.246 |
|4 | 1.601 | 0.051 | 1.611 (-0.62%)| 0.055 |
|8 | 2.837 | 0.060 | 2.827 (+0.35%)| 0.031 |
|16 | 5.139 | 0.133 | 5.107 (+0.63%)| 0.085 |
|25 | 7.569 | 0.142 | 7.503 (+0.88%)| 0.143 |
+--------------+-------+---------+----------------+---------+
[1] https://patchwork.kernel.org/patch/
9991635/
Matt Fleming also ran cyclictest and several different hackbench tests
on his test machines to santiy-check that the patch doesn't harm any
of his usecases.
Change-Id: I75826f9541ebe2e324fac2454790c5f5dff0d9b6
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Morten Ramussen <morten.rasmussen@arm.com>
Cc: Brendan Jackman <brendan.jackman@arm.com>
Tested-by: Rohit Jain <rohit.k.jain@oracle.com>
Tested-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Rafael J. Wysocki [Wed, 9 May 2018 09:44:56 +0000 (11:44 +0200)]
cpufreq: schedutil: Avoid using invalid next_freq.
commit
97739501f207efe33145b918817f305b822987f8 upstream.
If the next_freq field of struct sugov_policy is set to UINT_MAX,
it shouldn't be used for updating the CPU frequency (this is a
special "invalid" value), but after commit
b7eaf1aab9f8 (cpufreq:
schedutil: Avoid reducing frequency of busy CPUs prematurely) it
may be passed as the new frequency to sugov_update_commit() in
sugov_update_single().
Fix that by adding an extra check for the special UINT_MAX value
of next_freq to sugov_update_single().
Change-Id: I516963d8b0fda677e9d82290c0f3d4dc3cb6e477
Fixes:
b7eaf1aab9f8 (cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely)
Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.12+ <stable@vger.kernel.org> # 4.12+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Janghyuck Kim [Fri, 20 Jul 2018 04:14:27 +0000 (13:14 +0900)]
media: scaler: remove unnecessary definition
Change-Id: I39a83673bb2b5f9cfc740c97cf32163371102229
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 20 Jun 2018 04:32:45 +0000 (13:32 +0900)]
[COMMON] media: scaler: support linear P010 format
Change-Id: I0a647422214c8fc8b7f9cf60972265b27365fab6
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 20 Jun 2018 04:32:12 +0000 (13:32 +0900)]
include: linux: add linear P010 format
Change-Id: I9dbe5a25b615704a6f7c566094850ca42646d3c3
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 2 May 2018 05:32:19 +0000 (14:32 +0900)]
[COMMON] media: m2m1shot: support IO coherency
IO coherency is supported by checking dma-coherent property and passed
IOMMU_CACHE property to ion_iovmm_map().
Change-Id: I5afb0849ebf11030e6c765e160e50dd973f8df79
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 20 Jun 2018 07:46:08 +0000 (16:46 +0900)]
media: videobuf2-core: add error handling for fence
Vb2-core supports in-fence and out-fence for buffer synchronization.
However, in-fence might not be signaled by unexpected situation. Current
logic is waiting for fence signaling infinitely.
This patch added timer when in-fence without signaled is coming, and it
will be expired if callback for in-fence would not be called, which
means in-fence was not signaled during 1000 ms. This case is timeout and
buffer is passed into driver by buf_queue callback, however, it would be
marked with error status.
To support this error handling, vb2-core logic is changed to use
workqueue to avoid calling buf_queue callback in interrupt context.
Change-Id: Icd533c355fa83605e958c8058a676256a6940f14
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Mon, 9 Jul 2018 04:51:23 +0000 (13:51 +0900)]
media: videobuf2-core: fix wrong jump
In error case handling, wrong jump was detected and fixed.
Change-Id: I76006903406354c69b232fa6eee22034bfae0101
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 6 Jul 2018 10:10:19 +0000 (19:10 +0900)]
media: scaler: improve alignment check
This patch improved alignment checking to make returning error instead
of the error interrupt after H/W operation.
Change-Id: I06df771d24fe5d1626bf4c33b6c1da1e1ecf3ba8
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Tue, 26 Jun 2018 11:43:53 +0000 (20:43 +0900)]
media: scaler: add job scheduling in buf_queue
buf_queue callback will be called when fence is signaled.
At that time, job should be tried to run because this buffer
queueing might satisfy the condition to work. Job would be never
triggered without this scheduling.
Change-Id: Iba5a25b1280e60b35f431266d289f1d5b2af5fdb
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 11 Jul 2018 02:19:58 +0000 (11:19 +0900)]
[COMMON] media: scaler: add version information
Change-Id: I64af7122ccc5fee89c57235a3e2c968d3300e2a0
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Thu, 28 Jun 2018 08:29:58 +0000 (17:29 +0900)]
[COMMON] media: scaler: apply 16 alignment for 2bit span
Span value of 2 bit should be 16 aligned.
Change-Id: Ibf26a8da49e14f7610f342596a4d87dbf303979f
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Tue, 5 Jun 2018 05:44:23 +0000 (14:44 +0900)]
[COMMON] media: scaler: fix middle buffer calculation
This patch added size calculation for 10bit pixel format to avoid page
fault when double scaling is operated with 10bit pixel format.
Change-Id: I1b00d991d08498131299f99476ccf398a6d77a2e
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Mon, 21 May 2018 09:54:17 +0000 (18:54 +0900)]
[COMMON] media: scaler: fix config value for S10B
Change-Id: I3c62349eb1dac8da032e34f64e7fe897cee9f13d
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Mon, 28 May 2018 07:24:07 +0000 (16:24 +0900)]
[COMMON] media: scaler: add byteswap seting for P010
When source format is P010, reading order is different than standard
format, so byteswap should be set to correct order.
Change-Id: Ib07d44edd98e29db95e006c470679f6b9bd80c42
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 1 Jun 2018 04:58:38 +0000 (13:58 +0900)]
[COMMON] media: scaler: fix condition for clk request
After 5.0.1 version, clk request setting is supported.
Change-Id: Iaf5d476e75ce93746e0c575e189698557b0f3296
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 27 Apr 2018 10:03:58 +0000 (19:03 +0900)]
[COMMON] media: scaler: add framerate interface for m2m1shot
framerate interface for m2m1shot is added and common setting code is
separated as common function.
Change-Id: I84a77a2e97dba857d2da8d45a43a5cf390a7c7f8
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 27 Apr 2018 04:30:48 +0000 (13:30 +0900)]
[COMMON] media: scaler: change clk request sequence
CLK request should be the first before scaler S/W reset.
Change-Id: I4e0133e141a6fd8ba79bf5b5c749a337775e6926
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Tue, 6 Mar 2018 10:06:50 +0000 (19:06 +0900)]
[COMMON] media: scaler: improve scaler SFR dump
This patch improved scaler SFR dump that reduced redundant dump and
added mandatory dump for debug status.
Change-Id: Icd5114d766135594948a3172493996b141e6cf63
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
hyesoo.yu [Fri, 1 Jun 2018 12:11:06 +0000 (21:11 +0900)]
[COMMOn] g2d: enable secure mode when self protection
G2D always enable the secure mode before the job
is executed to enable the firewall regardless of
self protection.
Change-Id: Ie1ff1528d5f83563c1ee202254a826edda97a8c1
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Fri, 13 Jul 2018 08:10:32 +0000 (17:10 +0900)]
g2d: fix using virt_to_phys against stack variable
If CONFIG_VMAP_STACK is enabled, kernel stack is not physically linear
any more. Instead, it is allocated from vmap area and virt_to_phys and
similar macros are not available on that area.
G2D driver needs to get phyical address of a structure that describes
job properties to deliver the information to the secure world if G2D
H/W is not capable of protecting secure content leak.
Instead allocating the descriptor from the kernel stack, it is now
placed in g2d_task. It helps reducing data redundancy because all
values of the descriptor are also stored in g2d_task.
Change-Id: I91f9c9c5f3806890b4625db87e8b01627d58e5a0
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 20 Jun 2018 07:03:04 +0000 (16:03 +0900)]
g2d: handle fence errors
dma_fence supports delivering error to the fence waiters. The fences
with error are also signaled like good fences. The waiters then should
check if the signaled fence has error status.
G2D driver now checks the status of all signaled before pushing a task
to H/W. If it finds an error from the fences, it does not run H/W with
the task and push the back to the free task pool after resolving all
acquired resources including fences attached to the task. If the task
has a release fence, it is also signaled with -EIO error status.
G2D driver also signals release fences with error status when the a
fence is timed out or H/W does not incur interrupt until the deadline.
Signaling release fence with an error is helpful for the system
stability because the reader of the G2D output can determine if the
data from G2D is complete.
Change-Id: Ia54fafed45d1f8f0e0e1c2e3e81f084746ef02e5
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Wed, 23 May 2018 02:27:18 +0000 (11:27 +0900)]
[COMMON] g2d: schedule the task directly on ioctl
Task of g2d should be scheduled on process context
due to power management, so every task are executed
on workqueue. However, task on state that all
fences are signaled on ioctl could be scheduled
directly without queueing and it make remove the delay
for workqueue.
Change-Id: I72475096165237eccba8172e0c8a7d9e6e3c34c9
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Tue, 3 Apr 2018 10:25:30 +0000 (19:25 +0900)]
[COMMON] g2d: split timer as purpose
One timer is used for two purposes, but it may cause
unexpected race condition between timer handler
and deletion, initialization for another purpose.
So, we seperate timers into two for each purpose.
Change-Id: I44831a4a7b663d75c5d5d4297a78e245f3b4d3ef
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Hyesoo Yu [Tue, 27 Mar 2018 10:57:16 +0000 (19:57 +0900)]
[COMMON] g2d: fix the compat ioctl
The variable of buffer is corrupted while looping,
so incorrect data is written to the user's area in
the loop.
And user address of buffer is possible to be
corrupted when union variable is not initialized,
so fix it.
Change-Id: I5bb38eb4dd548a868153a32ebd5b31a76a20f112
Signed-off-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Seungchul Kim [Fri, 8 Jun 2018 02:04:16 +0000 (11:04 +0900)]
media: vb2: fix missing iovmm_unmap in vb2-dma-sg
Change-Id: Id5d9cb3c4c687b5daf5ad339cb67e990056551ab
Signed-off-by: Seungchul Kim <sc377.kim@samsung.com>
Cho KyongHo [Tue, 3 Apr 2018 14:12:17 +0000 (23:12 +0900)]
[COMMON] ion: fix conflicts
Change-Id: I250c65be08f436f8cef3fc00674587a74886ea61
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Thu, 31 May 2018 09:30:06 +0000 (18:30 +0900)]
[COMMON] ion: add ion_exynos_dma_buf_start[end]_cpu_access
The function provides cache flush for the buffer
if start[end] of cpu access from dmabuf framework
has direction of DMA_BIDIRECTIONAL even if there
is no attached device.
Change-Id: I22800e0abcc51b7f4e93d1d58dc55c0fd84901bb
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 31 May 2018 09:15:29 +0000 (18:15 +0900)]
Revert "android: ion: add dmabuf cpu access ops for exynos"
This reverts commit
6e3e01a3504e7873d16777b1bf3f2ee54ec97cb7.
Change-Id: I843b42d82681c25fbec7df58710e2b00cd70caf6
hyesoo.yu [Thu, 31 May 2018 09:03:10 +0000 (18:03 +0900)]
[COMMON] ion: skip cache maintenance when DMA_NONE
Change-Id: Ifd6fc48d15a7d5b1330431e8bf0366441e2e9dba
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Sun, 3 Jun 2018 08:10:03 +0000 (17:10 +0900)]
[COMMON] g2d: remove unnecessary sharable mapping
e3364c5c3c68 [COMMON] iommu/exynos: set sharable mapping for dma coherent device
6d648acaeb84 [COMMON] ion: set sharable mapping for dma coherent device
The iovmm mapping of dma coherent device is always
treated sharable mapping on exynos for cachable
memory.
Change-Id: I7b770f90f2a6cb3af8c6ef987109a33b747325a3
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 31 May 2018 09:07:55 +0000 (18:07 +0900)]
[COMMON] ion: set sharable mapping for dma coherent device
Change-Id: Ia2c32882772adc6a8f8cce3a4de28f24d44f9e98
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 1 Jun 2018 02:29:15 +0000 (11:29 +0900)]
[COMMON] ion: send aligned size to secure OS
Change-Id: I172f426a3289b3d8f26853e43fcd219d12e994c6
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Mon, 15 Jan 2018 07:44:30 +0000 (16:44 +0900)]
[COMMON] g2d: release hwfc buffer when error happens
Change-Id: I561e8eefdebc3dca5d60e4c7945e89e5f4121725
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Seungpyo Hong [Thu, 17 May 2018 05:43:11 +0000 (14:43 +0900)]
[COMMON] g2d: add debug code to measure the LLWFD latency
Change-Id: Ib9660284ef5bb133b14b922056b153a22bba4a7b
Signed-off-by: Seungpyo Hong <sp.hong@samsung.com>
hyesoo.yu [Fri, 1 Jun 2018 02:33:58 +0000 (11:33 +0900)]
[COMMON] g2d: enable to lock device frequency
Change-Id: I377499a8d7c351f17a7a7c2aa8aed8e8e1ebdc05
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 1 Jun 2018 02:32:54 +0000 (11:32 +0900)]
Revert "[HACK] g2d: ignore performance request"
This reverts commit
fe08c179382bccf66d82d0d92dfedb9b4f5586a6.
Change-Id: I8d328282366ff72bbe331d9b60c0bd5c81205906
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 31 May 2018 10:02:27 +0000 (19:02 +0900)]
[COMMON] g2d: increase max extra regs for coefficient
Change-Id: I3ab380c8663198e35d60ff9eb3fc7c9c61af150b
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Fri, 18 May 2018 03:12:18 +0000 (12:12 +0900)]
g2d: add complete support for Exynos9610
commit
46f75b91e ('[COMMON] g2d: add support for Exynos9610') is
cherry-picked from the middle of the patch development for the branch
android-exynos-4.14-mcd-dev.
That is why the above commit is incomplete.
So, the rest part of the complete commit to in
android-exynos-4.14-mcd-dev is now applied.
Change-Id: Ia3b6ea635a24c74425f05d15ba20ff5d85f5c6f1
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Masami Hiramatsu [Tue, 6 Feb 2018 08:02:23 +0000 (03:02 -0500)]
media: vb2: Fix videobuf2 to map correct area
[ Upstream commit
d13a0139d7874a0577b5955d6eed895517d23b72 ]
Fixes vb2_vmalloc_get_userptr() to ioremap correct area.
Since the current code does ioremap the page address, if the offset > 0,
it does not do ioremap the last page and results in kernel panic.
This fixes to pass the size + offset to ioremap so that ioremap
can map correct area. Also, this uses __pfn_to_phys() to get the physical
address of given PFN.
Change-Id: Ic03697b0f12932995d2f0602b05394f72a1464df
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Takao Orito <orito.takao@socionext.com>
Reported-by: Fumihiro ATSUMI <atsumi@infinitegra.co.jp>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hyesoo.yu [Wed, 2 May 2018 07:12:25 +0000 (16:12 +0900)]
media: vb2: replace iovmm api supported by ion
The iovmm api doesn't support system MMU mapping
of protected buffer. It is supported in exynos ion side.
We replace iovmm api to support protected buffer.
Change-Id: Ie6fe3f0fc2c877b31f0b7be7f23fe4492049a019
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Sami Tolvanen [Fri, 18 Aug 2017 17:00:51 +0000 (10:00 -0700)]
ANDROID: v4l2-ioctl: fix function types for IOCTL_INFO_STD
Bug:
67506682
Change-Id: I0bfdb4a198e8fb8719ac6aa884fd39e163dbf762
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Mauro Carvalho Chehab [Wed, 28 Mar 2018 17:59:22 +0000 (13:59 -0400)]
media: v4l2-compat-ioctl32: don't oops on overlay
commit
85ea29f19eab56ec16ec6b92bc67305998706afa upstream.
At put_v4l2_window32(), it tries to access kp->clips. However,
kp points to an userspace pointer. So, it should be obtained
via get_user(), otherwise it can OOPS:
vivid-000: ================== END STATUS ==================
BUG: unable to handle kernel paging request at
00000000fffb18e0
IP: [<
ffffffffc05468d9>] __put_v4l2_format32+0x169/0x220 [videodev]
PGD
3f5776067 PUD
3f576f067 PMD
3f5769067 PTE
800000042548f067
Oops: 0001 [#1] SMP
Modules linked in: vivid videobuf2_vmalloc videobuf2_memops v4l2_dv_timings videobuf2_core v4l2_common videodev media xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables bluetooth rfkill binfmt_misc snd_hda_codec_hdmi i915 snd_hda_intel snd_hda_controller snd_hda_codec intel_rapl x86_pkg_temp_thermal snd_hwdep intel_powerclamp snd_pcm coretemp snd_seq_midi kvm_intel kvm snd_seq_midi_event snd_rawmidi i2c_algo_bit drm_kms_helper snd_seq drm crct10dif_pclmul e1000e snd_seq_device crc32_pclmul snd_timer ghash_clmulni_intel snd mei_me mei ptp pps_core soundcore lpc_ich video crc32c_intel [last unloaded: media]
CPU: 2 PID: 28332 Comm: v4l2-compliance Not tainted 3.18.102+ #107
Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
task:
ffff8804293f8000 ti:
ffff8803f5640000 task.ti:
ffff8803f5640000
RIP: 0010:[<
ffffffffc05468d9>] [<
ffffffffc05468d9>] __put_v4l2_format32+0x169/0x220 [videodev]
RSP: 0018:
ffff8803f5643e28 EFLAGS:
00010246
RAX:
0000000000000000 RBX:
0000000000000000 RCX:
00000000fffb1ab4
RDX:
00000000fffb1a68 RSI:
00000000fffb18d8 RDI:
00000000fffb1aa8
RBP:
ffff8803f5643e48 R08:
0000000000000001 R09:
ffff8803f54b0378
R10:
0000000000000000 R11:
0000000000000168 R12:
00000000fffb18c0
R13:
00000000fffb1a94 R14:
00000000fffb18c8 R15:
0000000000000000
FS:
0000000000000000(0000) GS:
ffff880456d00000(0063) knlGS:
00000000f7100980
CS: 0010 DS: 002b ES: 002b CR0:
0000000080050033
CR2:
00000000fffb18e0 CR3:
00000003f552b000 CR4:
00000000003407e0
Stack:
00000000fffb1a94 00000000c0cc5640 0000000000000056 ffff8804274f3600
ffff8803f5643ed0 ffffffffc0547e16 0000000000000003 ffff8803f5643eb0
ffffffff81301460 ffff88009db44b01 ffff880441942520 ffff8800c0d05640
Call Trace:
[<
ffffffffc0547e16>] v4l2_compat_ioctl32+0x12d6/0x1b1d [videodev]
[<
ffffffff81301460>] ? file_has_perm+0x70/0xc0
[<
ffffffff81252a2c>] compat_SyS_ioctl+0xec/0x1200
[<
ffffffff8173241a>] sysenter_dispatch+0x7/0x21
Code: 00 00 48 8b 80 48 c0 ff ff 48 83 e8 38 49 39 c6 0f 87 2b ff ff ff 49 8d 45 1c e8 a3 ce e3 c0 85 c0 0f 85 1a ff ff ff 41 8d 40 ff <4d> 8b 64 24 20 41 89 d5 48 8d 44 40 03 4d 8d 34 c4 eb 15 0f 1f
RIP [<
ffffffffc05468d9>] __put_v4l2_format32+0x169/0x220 [videodev]
RSP <
ffff8803f5643e28>
CR2:
00000000fffb18e0
Tested with vivid driver on Kernel v3.18.102.
Same bug happens upstream too:
BUG: KASAN: user-memory-access in __put_v4l2_format32+0x98/0x4d0 [videodev]
Read of size 8 at addr
00000000ffe48400 by task v4l2-compliance/8713
CPU: 0 PID: 8713 Comm: v4l2-compliance Not tainted 4.16.0-rc4+ #108
Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
Call Trace:
dump_stack+0x5c/0x7c
kasan_report+0x164/0x380
? __put_v4l2_format32+0x98/0x4d0 [videodev]
__put_v4l2_format32+0x98/0x4d0 [videodev]
v4l2_compat_ioctl32+0x1aec/0x27a0 [videodev]
? __fsnotify_inode_delete+0x20/0x20
? __put_v4l2_format32+0x4d0/0x4d0 [videodev]
compat_SyS_ioctl+0x646/0x14d0
? do_ioctl+0x30/0x30
do_fast_syscall_32+0x191/0x3f4
entry_SYSENTER_compat+0x6b/0x7a
==================================================================
Disabling lock debugging due to kernel taint
BUG: unable to handle kernel paging request at
00000000ffe48400
IP: __put_v4l2_format32+0x98/0x4d0 [videodev]
PGD
3a22fb067 P4D
3a22fb067 PUD
39b6f0067 PMD
39b6f1067 PTE
80000003256af067
Oops: 0001 [#1] SMP KASAN
Modules linked in: vivid videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops v4l2_tpg v4l2_dv_timings videobuf2_v4l2 videobuf2_common v4l2_common videodev xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack libcrc32c tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables bluetooth rfkill ecdh_generic binfmt_misc snd_hda_codec_hdmi intel_rapl x86_pkg_temp_thermal intel_powerclamp i915 coretemp snd_hda_intel snd_hda_codec kvm_intel snd_hwdep snd_hda_core kvm snd_pcm irqbypass crct10dif_pclmul crc32_pclmul snd_seq_midi ghash_clmulni_intel snd_seq_midi_event i2c_algo_bit intel_cstate snd_rawmidi intel_uncore snd_seq drm_kms_helper e1000e snd_seq_device snd_timer intel_rapl_perf
drm ptp snd mei_me mei lpc_ich pps_core soundcore video crc32c_intel
CPU: 0 PID: 8713 Comm: v4l2-compliance Tainted: G B 4.16.0-rc4+ #108
Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
RIP: 0010:__put_v4l2_format32+0x98/0x4d0 [videodev]
RSP: 0018:
ffff8803b9be7d30 EFLAGS:
00010282
RAX:
0000000000000000 RBX:
ffff8803ac983e80 RCX:
ffffffff8cd929f2
RDX:
1ffffffff1d0a149 RSI:
0000000000000297 RDI:
0000000000000297
RBP:
00000000ffe485c0 R08:
fffffbfff1cf5123 R09:
ffffffff8e7a8948
R10:
0000000000000001 R11:
fffffbfff1cf5122 R12:
00000000ffe483e0
R13:
00000000ffe485c4 R14:
ffff8803ac985918 R15:
00000000ffe483e8
FS:
0000000000000000(0000) GS:
ffff880407400000(0063) knlGS:
00000000f7a46980
CS: 0010 DS: 002b ES: 002b CR0:
0000000080050033
CR2:
00000000ffe48400 CR3:
00000003a83f2003 CR4:
00000000003606f0
Call Trace:
v4l2_compat_ioctl32+0x1aec/0x27a0 [videodev]
? __fsnotify_inode_delete+0x20/0x20
? __put_v4l2_format32+0x4d0/0x4d0 [videodev]
compat_SyS_ioctl+0x646/0x14d0
? do_ioctl+0x30/0x30
do_fast_syscall_32+0x191/0x3f4
entry_SYSENTER_compat+0x6b/0x7a
Code: 4c 89 f7 4d 8d 7c 24 08 e8 e6 a4 69 cb 48 8b 83 98 1a 00 00 48 83 e8 10 49 39 c7 0f 87 9d 01 00 00 49 8d 7c 24 20 e8 c8 a4 69 cb <4d> 8b 74 24 20 4c 89 ef 4c 89 fe ba 10 00 00 00 e8 23 d9 08 cc
RIP: __put_v4l2_format32+0x98/0x4d0 [videodev] RSP:
ffff8803b9be7d30
CR2:
00000000ffe48400
Change-Id: I07273310c5dd671eed74faf1f38446ac3d840553
cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mauro Carvalho Chehab [Thu, 28 Dec 2017 14:16:47 +0000 (09:16 -0500)]
media: videobuf2-core: don't go out of the buffer range
[ Upstream commit
df93dc61b0d8b19a5c9db545cf3fcc24f88dfde4 ]
Currently, there's no check if an invalid buffer range
is passed. However, while testing DVB memory mapped apps,
I got this:
videobuf2_core: VB: num_buffers -
2143943680, buffer 33, index -
2143943647
unable to handle kernel paging request at
ffff888b773c0890
IP: __vb2_queue_alloc+0x134/0x4e0 [videobuf2_core]
PGD
4142c7067 P4D
4142c7067 PUD 0
Oops: 0002 [#1] SMP
Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables bluetooth rfkill ecdh_generic binfmt_misc rc_dvbsky sp2 ts2020 intel_rapl x86_pkg_temp_thermal dvb_usb_dvbsky intel_powerclamp dvb_usb_v2 coretemp m88ds3103 kvm_intel i2c_mux dvb_core snd_hda_codec_hdmi crct10dif_pclmul crc32_pclmul videobuf2_vmalloc videobuf2_memops snd_hda_intel ghash_clmulni_intel videobuf2_core snd_hda_codec rc_core mei_me intel_cstate snd_hwdep snd_hda_core videodev intel_uncore snd_pcm mei media tpm_tis tpm_tis_core intel_rapl_perf tpm snd_timer lpc_ich snd soundcore kvm irqbypass libcrc32c i915 i2c_algo_bit drm_kms_helper
e1000e ptp drm crc32c_intel video pps_core
CPU: 3 PID: 1776 Comm: dvbv5-zap Not tainted 4.14.0+ #78
Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
task:
ffff88877c73bc80 task.stack:
ffffb7c402418000
RIP: 0010:__vb2_queue_alloc+0x134/0x4e0 [videobuf2_core]
RSP: 0018:
ffffb7c40241bc60 EFLAGS:
00010246
RAX:
0000000080360421 RBX:
0000000000000021 RCX:
000000000000000a
RDX:
ffffb7c40241bcf4 RSI:
ffff888780362c60 RDI:
ffff888796d8e130
RBP:
ffffb7c40241bcc8 R08:
0000000000000316 R09:
0000000000000004
R10:
ffff888780362c00 R11:
0000000000000001 R12:
000000000002f000
R13:
ffff8887758be700 R14:
0000000000021000 R15:
0000000000000001
FS:
00007f2849024740(0000) GS:
ffff888796d80000(0000) knlGS:
0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0:
0000000080050033
CR2:
ffff888b773c0890 CR3:
000000043beb2005 CR4:
00000000003606e0
Call Trace:
vb2_core_reqbufs+0x226/0x420 [videobuf2_core]
dvb_vb2_reqbufs+0x2d/0xc0 [dvb_core]
dvb_dvr_do_ioctl+0x98/0x1d0 [dvb_core]
dvb_usercopy+0x53/0x1b0 [dvb_core]
? dvb_demux_ioctl+0x20/0x20 [dvb_core]
? tty_ldisc_deref+0x16/0x20
? tty_write+0x1f9/0x310
? process_echoes+0x70/0x70
dvb_dvr_ioctl+0x15/0x20 [dvb_core]
do_vfs_ioctl+0xa5/0x600
SyS_ioctl+0x79/0x90
entry_SYSCALL_64_fastpath+0x1a/0xa5
RIP: 0033:0x7f28486f7ea7
RSP: 002b:
00007ffc13b2db18 EFLAGS:
00000246 ORIG_RAX:
0000000000000010
RAX:
ffffffffffffffda RBX:
000055b10fc06130 RCX:
00007f28486f7ea7
RDX:
00007ffc13b2db48 RSI:
00000000c0086f3c RDI:
0000000000000007
RBP:
0000000000000203 R08:
000055b10df1e02c R09:
000000000000002e
R10:
0036b42415108357 R11:
0000000000000246 R12:
0000000000000000
R13:
00007f2849062f60 R14:
00000000000001f1 R15:
00007ffc13b2da54
Code: 74 0a 60 8b 0a 48 83 c0 30 48 83 c2 04 89 48 d0 89 48 d4 48 39 f0 75 eb 41 8b 42 08 83 7d d4 01 41 c7 82 ec 01 00 00 ff ff ff ff <4d> 89 94 c5 88 00 00 00 74 14 83 c3 01 41 39 dc 0f 85 f1 fe ff
RIP: __vb2_queue_alloc+0x134/0x4e0 [videobuf2_core] RSP:
ffffb7c40241bc60
CR2:
ffff888b773c0890
So, add a sanity check in order to prevent going past array.
Change-Id: I926c2bdd3b1f412a4f48ce9b6d5efd18470e233b
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cho KyongHo [Wed, 18 Jul 2018 11:28:15 +0000 (20:28 +0900)]
Revert "[HACK] g2d: enable self protection not to use smc call"
This reverts commit
e72811145b3b24d9c54b0445d025ffe79139b497.
Change-Id: Ia272efa0a66aad3a98778413dbf14d716ffea2d7
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Seungpyo Hong [Thu, 19 Jul 2018 06:56:18 +0000 (15:56 +0900)]
media: tsmux: add reordering_pes_private_data() function
The tsmux HAL will not support to reorder the input/stream counter.
The tsmux driver will support that.
Change-Id: Ib4839d257f1bdfcca129f43f2a870d48e96ecc1c
Signed-off-by: Seungpyo Hong <sp.hong@samsung.com>
shinwon.lee [Tue, 10 Jul 2018 10:47:14 +0000 (19:47 +0900)]
media: tsmux: add spin lock to protect m2m rtp seq number
Change-Id: I57db1b1bc74319af712d9dc39f91f4d47cd70f15
Signed-off-by: shinwon.lee <shinwon.lee@samsung.com>
shinwon.lee [Fri, 20 Jul 2018 09:51:15 +0000 (18:51 +0900)]
media: tsmux: modify build option for tsmux and repeater
Change-Id: Iaf7bf98482f81ec35025d6a53d4c26b469e58373
Signed-off-by: shinwon.lee <shinwon.lee@samsung.com>