Commit graph

575739 commits

Author SHA1 Message Date
Pavankumar Kondeti
f20772adf3 sched: Fix integer overflow in sched_update_nr_prod()
"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>
2016-10-04 08:47:48 +05:30
Patrick Daly
295721b363 ion: ion_system_heap: SetPagePrivate when splitting secure pages
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>
2016-10-03 18:42:01 -07:00
Sunil Paidimarri
5334ff493a msm: ipa: Fix ipa ready cb return value
Ethernet driver can be loaded before IPA. IPA
ready callback not returning correct value.

Change-Id: I4cd08a8ab8a5de6c46643eaff9b61779858887e3
CRs-Fixed: 1070644
Signed-off-by: Sunil Paidimarri <hisunil@codeaurora.org>
2016-10-03 12:51:25 -07:00
Satyajit Desai
0f327e4ccc ion: use %pK instead of %p which respects kptr_restrict sysctl
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>
2016-10-03 11:42:20 -07:00
Venkat Gopalakrishnan
0365116c48 scsi: ufs_test: fix use after free issue
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>
2016-10-03 10:57:19 -07:00
Linux Build Service Account
057bdafd97 Merge "clk: msm: clock-gpu-cobalt: Update the graphics core clock frequency" 2016-10-03 10:35:02 -07:00
Linux Build Service Account
f02700dfc6 Merge "sched: Fix CPU selection when all online CPUs are isolated" 2016-10-03 10:35:02 -07:00
Linux Build Service Account
73bc67e1ea Merge "ARM: dts: msm: enable mi2s and aux pcm on msmcobalt" 2016-10-03 10:35:01 -07:00
Linux Build Service Account
839e644e4e Merge "ARM: dts: msm: add support for TDM" 2016-10-03 10:35:00 -07:00
Linux Build Service Account
125777bed4 Merge "ARM: dts: msm: Remove clocks listed under GPU, PCIE, USB & MDSS GDSC nodes" 2016-10-03 10:34:59 -07:00
Linux Build Service Account
ae0165688c Merge "sched: Add a stub function for init_clusters()" 2016-10-03 10:34:59 -07:00
Linux Build Service Account
a6e4924acb Merge "sched: add a knob to prefer the waker CPU for sync wakeups" 2016-10-03 10:34:58 -07:00
Linux Build Service Account
5a313c5e74 Merge "ASoC: msm: qdsp6v2: Fix improper channel config for aac" 2016-10-03 10:34:57 -07:00
Linux Build Service Account
7a81402490 Merge "ASoC: msm: Update the error handling when APR sends packet failed" 2016-10-03 10:34:57 -07:00
Linux Build Service Account
08d58a723b Merge "hrtimer: Ensure timer is not running before migrating" 2016-10-03 10:34:56 -07:00
Linux Build Service Account
d1ba2d0b97 Merge "ARM: dts: msm: add TSPP support for msmcobalt" 2016-10-03 10:34:54 -07:00
Linux Build Service Account
ebe0e1b44c Merge "input: synaptics_dsx_core: make clocks as optional for secure touch" 2016-10-03 10:34:54 -07:00
Linux Build Service Account
abc3610d33 Merge "blk-mq: use static mapping" 2016-10-03 10:34:53 -07:00
Linux Build Service Account
a9849c7d7f Merge "defconfig: msmcortex: disable RMI4 dev module" 2016-10-03 10:34:51 -07:00
Abinaya P
a0bc19daec defconfig: enable secure touch option for Synaptics 2.0 for msmcobalt
msmcobalt CDP/MTP uses Secure touch on Synaptics controller. Hence, enable
Secure touch for Synaptics 2.0 touch driver.

Change-Id: I8b89e71428f566d72e6c2e0026bda207ec53e71c
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
2016-10-03 21:38:51 +05:30
Raju P.L.S.S.S.N
201164f28b lpm-levels: Compute minimum residencies for LPM levels
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>
2016-10-03 10:01:18 -06:00
Raju P.L.S.S.S.N
7aef3b1f9b lpm-levels: Fix low power mode selection
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>
2016-10-03 10:00:32 -06:00
Mahesh Sivasubramanian
0fb5a62a22 lpm-levels: Use residency instead of power and energy values
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>
2016-10-03 09:58:54 -06:00
Linux Build Service Account
0b3886773c Merge "msm: vidc: Disable power collapse for HFR" 2016-10-03 05:54:41 -07:00
Linux Build Service Account
1221a4694b Merge "ASoC: msm: qdsp6v2: add routing map for multimedia6" 2016-10-03 05:54:41 -07:00
Linux Build Service Account
a79c822905 Merge "clk: qcom: Add support to force enable/disable the RCG" 2016-10-03 05:54:40 -07:00
Linux Build Service Account
45235de032 Merge "ARM: dts: msm: Add the pmfalcon and pm2falcon dtsi files" 2016-10-03 05:54:38 -07:00
Linux Build Service Account
7fb2ad9105 Merge "Bluetooth: HID: Add Bus type for specific HID Keyboard" 2016-10-03 05:54:37 -07:00
Ravi Kumar Siddojigari
dab813eaa5 input: synaptics_dsx: allocate heap memory for temp buf
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>
2016-10-03 17:27:52 +05:30
Alan Kwong
a51dee4748 msm: sde: fix wrong chroma stride for h2v1/h1v2 formats
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>
2016-10-03 04:37:56 -07:00
Naresh Tanniru
058d9ab161 ASoC: msm: qdsp6v2: Fix improper channel config for aac
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>
2016-10-03 03:15:36 -07:00
Chandana Kishori Chiluveru
a6fb576c5b usb: gadget: f_qc_rndis: Add support for configfs
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>
2016-10-03 14:31:00 +05:30
Hareesh Gundu
641acaf018 msm: kgsl: Add facility to BUG_ON for a gpu fault
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>
2016-10-03 00:04:19 -07:00
Chandana Kishori Chiluveru
5f7a2a2a57 usb: gadget: f_qc_rndis: Add RNDIS support using IPA over BAM2BAM
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>
2016-10-03 12:17:32 +05:30
Shantanu Jain
08c47ca822 defconfig: msm: disable RMI4 dev module
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>
2016-10-03 12:01:20 +05:30
Kuirong Wang
3a0f71b590 ARM: dts: msm: enable mi2s and aux pcm on msmcobalt
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>
2016-10-02 09:59:53 -07:00
Pavankumar Kondeti
a86b380f35 sched: Add a device tree property to specify the sched boost type
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>
2016-10-02 10:54:45 +05:30
Pavankumar Kondeti
c7e3dde08c sched: Add a stub function for init_clusters()
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>
2016-10-02 10:52:15 +05:30
Pavankumar Kondeti
f1e9995fe4 sched: add a knob to prefer the waker CPU for sync wakeups
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>
2016-10-02 10:52:06 +05:30
Linux Build Service Account
e4e58248ef Merge "usb: gadget: f_cdev: Fix memory leak with func_name" 2016-10-01 10:41:53 -07:00
Linux Build Service Account
2c2e30e5f3 Merge "usb: gadget: f_cdev: Remove func_name and port_num attributes" 2016-10-01 10:41:52 -07:00
Pavankumar Kondeti
7c3461a6ac sched: Fix a division by zero bug in scale_exec_time()
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>
2016-10-01 10:05:08 +05:30
Linux Build Service Account
0c1bf6e64e Merge "ASoC: soc: change audio cpe drivers to use %pK" 2016-09-30 18:24:04 -07:00
Linux Build Service Account
b9a2515e19 Merge "msm: secure_buffer: Add VMID_CP_CAMERA_PREVIEW" 2016-09-30 18:24:04 -07:00
Linux Build Service Account
9ee3ab3d93 Merge "scsi: ufs: gate ref_clk during aggressive clk gating" 2016-09-30 18:24:03 -07:00
Linux Build Service Account
d764916497 Merge "clk: qcom: Add support to register rpm-smd clocks" 2016-09-30 18:24:02 -07:00
Linux Build Service Account
8bfc0b3d0a Merge "msm: kgsl: Change GPU clock gating sequence for A4XX and A5XX" 2016-09-30 18:24:01 -07:00
Linux Build Service Account
456cfbdf20 Merge "msm: kgsl: Fix dispatch_q NULL dereference" 2016-09-30 18:24:01 -07:00
Linux Build Service Account
36b28a7842 Merge "ASoC: wcd934x: Add support for HPH surge recovery" 2016-09-30 18:23:59 -07:00
Linux Build Service Account
e33b7f64d3 Merge "ASoC: wcd934x: Use correct API for force enable micbias" 2016-09-30 18:23:58 -07:00