In stability runs for 8952, observe excessive logging result
in watchdog bite due to audio prints. Add rate limit check
for prints in failure cases while SSR with 500ms duration.
CRs-Fixed: 842762
Change-Id: Iaca8f8d0dd3a451f4c939e7f73657a4fd53bf25c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Needed for easy switching to 300HZ kernel. some drivers need there 100HZ.
[CertifiedBlyndGuy]:
* Also convert a couple to a 1000HZ basis. 3.18 uses higher calculations
in some cases that might prove beneficial
Signed-off-by: Joe Maples <joe@frap129.org>
voice_svc_dev is allocated as a device managed resource
and need not be freed since it is freed automatically.
Remove the logic to free voice_svc_dev in probe failure
and remove functions to avoid double free.
CRs-Fixed: 2204285
Bug: 109741750
Change-Id: If4f9ca840b00448b987f5ce443f66b0923b01969
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Audio Packet Router (APR) is used by multiple audio services
to communicate between APSS and ADSP. These audio services
registers for service level APR communication (port 0xFFFFFFFF),
or for session level APR communication (using port 0x101 etc.).
The services might choose to call apr_register for any port at
random. The expectation is that the refcounting for the number
of ports registered with APR for any specific service, is handled
irrespective of the order in which registrations are done. The
current logic fails to handle the refcounting when apr_register
is called for 0xFFFFFFFF before other session based ports. Fix
this correctly using the service count (svc_cnt) variable in apr_svc.
CRs-fixed: 2022490
Bug: 34088848
Change-Id: I2fcd1269facf24d509db0d90314e0d2545a2ad67
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add boundary checks for APR port received from ADSP.
Change-Id: Ia0a3859b30536bd6aa6030cdbd44c783c9558068
CRs-Fixed: 2143207
Bug: 72956842
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
The current implementation is using mutex lock to protect the Rx data
packet list but Glink core can notify the Rx data in atomic context
and the mutex lock is not used in some places.
Replace the mutex lock with spinlock to protect the Rx data packet list.
CRs-Fixed: 852949
Bug: 67713091
Change-Id: Ie7543a98e6589e8068b873a8bb4f49b9a195d881
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
Signed-off-by: Suyash Nahata <sunahata@codeaurora.org>
Merge 'android-msm-bullhead-3.10-nyc-mr2' into
'android-msm-bullhead-3.10'
July 2017.1
Bug: 38137577
Change-Id: Id2935b141bbaa52d6ec63648551ac5dec3e21487
Buffer overflow can occur if MBA firmware size exceeds 1MB.
So validate size before copying the firmware.
Bug: 34112490
Change-Id: Ifb7fe35ca22fb85f8b97834537b701851cea29cb
CRs-Fixed: 2001803
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Check for size_t overflow when calculating scm buffer size,
returning an error if the required buffer is too large.
Bug: 35401052
Change-Id: Ie3e13f90dd03444f702ede5ebf70867c72f96364
Signed-off-by: Andrew Chant <achant@google.com>
Add a mutex to prevent two threads from processing the same response
at the same time. This ensures responses are processed completely and
sequentially.
Bug: 34088848
CRs-Fixed: 1116015
Change-Id: Id2ef32edb939f8af2850b54bd6f6f447939c0732
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Siqi Lin <siqilin@google.com>
(am from https://source.codeaurora.org/quic/la/kernel/msm-4.4/commit/?id=d3237316314c3d6f75a58192971f66e3822cd250)
Currently we set CONFIG_CC_OPTIMIZE_FOR_SIZE which suppressed the compiler
warning of unused variables which can lead undefined behavior e.g. memory
corruption and panic. See https://lkml.org/lkml/2013/3/25/347.
This patch fixes all the uninitilized variables in kernel
Bug: 33353384
Test: On device
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I0ae1082f447b435d71156d471878ba71aa16c378
Add size checks to validate minimum size is met. Update log messages
to include only relevant information to ensure logs are accurate and
useful.
Bug: 31796345
Change-Id: Idf76a7d964ec6989a0474d49895e54103f17938b
CRs-fixed: 1073129
Signed-off-by: Siena Richard <sienar@codeaurora.org>
scm_call2 is printing the input arguments if TZ ret value is < 0
leading to information leak. Remove printing input arguments.
Bug: 31704078
Change-Id: I21dd6d83fa979aed2c79ebb2c9c8de63a247dded
CRs-Fixed: 1076407
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
Change format string to %pK instead of %p in the debug statements. This
change fixes kernel address leaks from the usage of %p.
Bug: 30312054
CRs-Fixed: 1052825
Change-Id: Ib95f691919a2977f5436cd4c6ac4a002d70dd729
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Array overflow can occur in firmware_name_store(), if the variable
buf contains the string larger than size of subsys->desc->fw_name
Bug: 28675151
Change-Id: Ice39d7a1eb0b5f53125cc5d528021a99b9f7ff90
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Reset master_cnt whenever file is closed and reopened.
The makes the driver to return data starting from the first
master(APSS) whenever the debugfs file is closed and reopened.
Bug: 26564574
Change-Id: I9c38f74da8fbed8205a41c8abc82e18d802067db
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Adding support to print the additional XO sleep related debug stats
the rpm maintains for each of the masters. The additional stats
include xo_count, xo_last_entered_at, xo_last_exited_at, and
xo_accumulated_duration.
Change-Id: I15a99bfc280a52990a39704a19cd3bcd9062c6ff
Signed-off-by: Ramakrishnan Ganesh <ramakris@codeaurora.org>
Signed-off-by: Veena Sambasivan <veenas@codeaurora.org>
Lower priority threads making rpm requests could block higher priority
threads attempting rpm communication. Raise the priority of the thread
waiting for ack by acquiring a RT Mutex.
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Change-Id: I9e970fc7733775728100dede3406df8814a20a55
Non-atomic scm call which could be interrupted, trustzone will store
the session id in a register(x6) which will be used when trustzone resumes
the call.
To avoid x6 being used by compiler, HLOS now uses it to send a zero before
making scm call.
This is the same change as in the 32bit scm call.
Change-Id: If7a3ee28bdbf22acf447531603819a6f4f1603ca
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
boot_shared_imem_cookie_type structure changed since Post-FC6.
Thus, The offset, which lge_handle_panic has been used mismatched.
Bug: 22963968
Change-Id: I7aa57408a8c15a29f7866af8b764a04d061434af
Signed-off-by: juya.kim <juya.kim@lge.com>
If any error happens during allocating memory or initializing cluster
structure then it returns error but it does not free already
allocated memory. This may cause memory leak in certain scenerios.
This change prevents memory leak by freeing memory when error
happens during initialization.
Change-Id: I820acd676dc5baff270c2093ca24a1014c25dabb
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Do not enter to crash handler in case when modem
needs to be restarted intentionally, ex. after
activation process, etc.
Bug: 21935954
Change-Id: I2d40db0734d270abf73a3945023d9e95e80a0b7f
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
There is a new secure world interface added to scm
library which is more aligned to the ARMv8 SCM calling
convention. Use the new API for APR driver while maintaining
backward compatibility.
CRs-fixed: 860055
Change-Id: I346b523ddd9b041c1593c2e688edc986cb101314
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
The default behavior for xpus is to zero out the protected region when
it is unlocked. Pass a flag to the scm call to leave the memory region
unchanged.
Change-Id: Ib714d6db93bed2940006f8c0196b59da3fbd3161
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
The cpaccess driver writes to the kernel text section during normal
operation. Add an API to disable any protection of this region by the
scm-mpu driver.
Protection is not reenabled after cpaccess operations since this is
expected to be an uncommon usecase.
Change-Id: I83caa906b94f4a522a203c1170f1d913681fc704
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
cpufreq governor tunables could be updated
only when cpu is online. Userspace might need
to apply and restore these tunables depending
on the power/perf need.
Provide sysfs node for userspace to poll over
and which gets notified on CPU_ONLINE and CPU_DEAD
events for any cpu. This mechanism could be
utilized to know when cpus come online
and then restoring or applying cpufreq governor
tunables. CPU_DEAD notification is also provided
for completeness.
Change-Id: I221a97c49a72da217e5e4b46a16a26042ef5c83f
Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org>
Add support for enter/exit cycle sysfs nodes for io detection
There are some usecases which may benefit from different enter/exit
cycle load criteria for IO load. This change adds support for
that.
Change-Id: Iff135ed11b92becc374ace4578e0efc212d2b731
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Add support for multi_enter_cycles/multi_exit_cycles per cluster
There are some usecases which may benefit from different enter/exit
cycle load criteria for multimode cpu load. This change adds support for
that.
Change-Id: I3408405307ca03b9bba3f03e216ef59b98f29832
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Certain governors may stop sending out notifications once CPUs enter
idle at min frequency.If governor's notifications stop then single mode
will not exit for long time. It can happen only if the exit conditions are
set in such a way that the time taken to exit single mode exceeds the time
for the governor to ramp down, idle out and hence stop sending
notifications leaving the system in single mode indefinitely.
This change adds seperate enter/exit cycle sysfs nodes along with a per
cluster non-deferrable timer for single mode exit. The timer is armed only
when the load starts falling below the exit load threshold and is
cancelled when either the load starts going up or SINGLE mode is exited
due to exceeding exit cycle count. On expiry the timer resets SINGLE mode
and the enter/exit cycle counts.
Change-Id: I02dd3fa8af39ca320e80da6391eb2b1ea635a433
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
If modem loading fails during pil_boot, the allocated mba region
is freed. But the region is still in locked state as the MBA does not
know about the modem loading failure. This leads to XPU violation,
when the locked mba region is accessed by other modules.
Hence, before freeing the MBA region, notify the MBA about the failure
so that MBA can remove memory protection.
Change-Id: Ib3489504f2aa49dc886ea9a5f2eae3da57fcf7d4
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
There is a memory leak in the error path when modem metadata
authentication fails. Free the MBA region to fix this.
Change-Id: I3b33af58bba6532c7714070a62dce1dd99c63601
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
When ion alloc fails for audio or system heap, an
error pointer is returned which gets dereferenced
causing a crash.
Get the error number from the error pointer returned
using the PTR_ERR api.
CRs-Fixed: 799946
Change-Id: Ic96738cdf8fe8fa8ef4767081846d77173fdd3b7
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Since there is no backlight on/off in charger mode,
force to control backlight by panel on/off when kernel
boot as charger mode.
Change-Id: Ifc4380942500186889786e68ec37422b13c74df0
Signed-off-by: soyoung.min <soyoung.min@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
userspace doesn't support for new /sys/devices/soc.0. It would be a specific
board support. So explicityly parent the /soc devices to the root node to
preserve the kernel ABI (sysfs structure).
Change-Id: I70271964bdd4d336a5d8c3df8fdc936920bd19a2
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>