"int" type is used to hold the time difference between the successive
updates to nr_run in sched_update_nr_prod(). This can result in
overflow, if the function is called ~2.15 sec after it was called
before. The most probable scenarios are when CPU is idle and
hotplugged. But as we update the last_time of all possible CPUs in
sched_get_nr_running_avg() periodically from a deferrable timer context
(core_ctl module), this overflow is observed only when the system is
completely idle for long time. When this overflow happens we hit
a BUG_ON() in sched_get_nr_running_avg().
Use "u64" type instead of "int" for holding the time difference and
add additional BUG_ON() to catch the instances where sched_clock()
returns a backward value.
Change-Id: I284abb5889ceb8cf9cc689c79ed69422a0e74986
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
The kgsl driver relies on checking the PagePrivate flag for secure memory.
Commit 471a5dd237 ("ion: system_heap:
Add a new allocation method") did not properly set this flag in all cases.
Fix this.
Change-Id: I4f29ee151158cd70a1617d365decc7d3fd8fe6ac
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Hide kernel pointers from unprivileged users by using %pk format-specifier
instead of %p. This respects the kptr_restrict sysctl setting which is by
default on. So by default %pk will print zeroes as address. echo 1 to
kptr_restrict to print proper kernel address.
Change-Id: Ia300e3e38b8662afac15edda28959564b05c9367
Signed-off-by: Satyajit Desai <sadesai@codeaurora.org>
Make sure test_rq is not accessed after its freed.
Also take care of initializing num_bios_per_request before use.
Change-Id: Ief9e4ff118691d74782f4f405dc195cb9bdb7c32
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Minimum residency of current level is maximum residency of previous
level + 1. If none of the previous levels are enabled, minimum
residency of currenct level is time_overhead of current level.
Minimum residencies are used for New LPM level selection using
prediction logic.
Change-Id: I5e69a847d78d14ecbb7caeac383287a1897f7ce8
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
The low power mode selection logic has problems while
selecting best mode both in cpu and cluster selection.
When latency requirement is not met, the level selection
loop breaks without selecting another possible shallow
power mode that meets both latency and residency
requirements. The residencies are initialized to ~0
(0xFFFFFFFF) when a particular mode is disabled in idle
context. This results in wrong selection of shallower
mode in suspend context instead of selecting best possible
deepest low power mode (assuming the mode is enabled in
suspend context but disabled in idle context). This can
have impact on power.
The change addresses this by selecting a possible
shallower power mode that can meet the latency criteria.
It also initializes the residencies to 0 when a mode is
not allowed in idle context. This results in selection
of deepest low power mode in suspend context and
saves power.
Change-Id: Iae8b6ad74ef0f28d9c542315745577b1a5924664
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
The driver looks through all the enabled modes and does energy
calculation runtime before it selects a low power mode to enter.
With residency values, the cpu/cluster can choose the low power
mode as soon as it comes across the low power mode which meets
the residency constraint.
Change-Id: I71235c212b26c3688a8ac5426942f2b88b681d47
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
There is a possible stack overflow vulnerability in the rmidev_write
function because the stack array size is from user space.
changes to allocate heap memory for the temporary buffer instead of
stack memory to prevent the stack overflow vulnerability.
As discussed under CVE-2016-3865 and ANDROID-28799389.
Change-Id: I20f639e09aaf3c533c98a12a2413570feae3d6d0
Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Current driver is swapping the chroma subsample
for the read pipe when rotation is in place,
this configuration is already taken care by the
rotator, and it is not needed to swap the chroma
sampling for the rotator pipes.
This fixes wrong stride calculations, causing
wrong colors shown in h2v1/h1v2 tests.
CRs-Fixed: 1069748
Change-Id: Idfbe229a39bda728aebbdecd45e468b808026ff8
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
AAC encode is failing in ADSP due to mismatch
in channel config datatype.
Update channel config data type for aac encoder.
Change-Id: I844d6e1ac1b2b171cd74a2601ae09280a22589c9
Signed-off-by: Naresh Tanniru <ntanniru@codeaurora.org>
Add APIs to allocate and instanciate f_qc_rndis function
driver using configFS.
Change-Id: I24f3dcb14c6467ab4c2d2eda464dfacda2c5b426
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Few gpu faults need system level information like voltages,
interface clock etc. This information can't be extracted
through the snapshot dump. Add a facility to force panic
on gpu fault, which will help to extract additional
information from the ramdumps.
To trigger BUG_ON for a gpu fault:
echo 1 > /sys/class/kgsl/kgsl-3d0/snapshot/force_panic
Change-Id: I020b5518fcaedd4fecc572b580a989bf117f6ceb
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
On some targets RNDIS function uses BAM to BAM transport, and is
handled by the f_qc_rndis driver. This change adds RNDIS support
using IPA over BAM2BAM. Also removes all different supported control
and data transports and assume BAM2BAM_IPA as default mode. RNDIS UL
changes using software path also removed as IPA supports both UL
and DL on latest products.
DPL support will be added in subsequent patches.
Change-Id: I8f7bf069523a8f3ea37e0a32a2e32830944a5c97
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
Synaptics driver supports an RMI4 dev module to
interact with userspace. Disable the module due to
security concerns.
CRs-Fixed: 1073043
Change-Id: I24e3f888167b7ff593373bfc4a55ce81cfc9e5c7
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Add device tree changes to enable mi2s and aux pcm so audio
can be playback and capture via mi2s and aux pcm interfaces.
CRs-Fixed: 1047362 1047365
Change-Id: I6d8f31cf841cb977bd1d7af3441b9d2c1da9b85c
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
The HMP scheduler has two types of task placement boost policies.
(1) boost-on-big policy make use of all big CPUs up to their full capacity
before using the little CPUs. This improves performance on true b.L systems
where the big CPUs have higher efficiency compared to the little CPUs.
(2) boost-on-all policy place the tasks on the CPU having the highest
spare capacity. This policy is optimal for SMP like systems.
The scheduler sets the boost policy to boost-on-big on systems which has
CPUs of different efficiencies. However it is possible that CPUs of the
same micro architecture to have slight difference in efficiency due to
other factors like cache size. Selecting the boost-on-big policy based
on relative difference in efficiency is not optimal on such systems.
The boost-policy device tree property is introduced to specify the
required boost type and it overrides the default selection of boost
type in the scheduler. The possible values for this property are
"boost-on-big" and "boost-on-all".
Change-Id: Iac19183fa7d4bfd9e5746b02a02b2b19cf64b78d
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Add a stub function for init_cluster() and remove a ifdefry
for SCHED_HMP in sched_init()
Change-Id: I6745485152d735436d8398818f7fb5e70ce5ee65
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
The current policy has a preference to select an idle CPU in the waker
cluster compared to the waker CPU running only 1 task. By selecting
an idle CPU, it eliminates the chance of waker migrating to a
different CPU after the wakee preempts it. This policy is also not
susceptible to the incorrect "sync" usage i.e the waker does not
goto sleep after waking up the wakee.
However LPM exit latency associated with an idle CPU outweigh the
above benefits on some targets. So add a knob to prefer the waker
CPU having only 1 runnable task over idle CPUs in the waker cluster.
Change-Id: Id974748c07625c1b19112235f426a5d204dfdb33
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
When cycle_counter is used to estimate the frequency, calling
update_task_ravg() twice on the same task without refreshing
the wallclock results in a division by zero bug. Add a safety
check in update_task_ravg() to prevent this.
The above bug is hit from __schedule() when next == prev. There
is no need to call update_task_ravg() twice for PUT_PREV_TASK
and PICK_NEXT_TASK events for the same task. Calling
update_task_ravg() with TASK_UPDATE event is sufficient.
Change-Id: Ib3af9004f2462618c535b8195377bedb584d0261
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>