Commit Graph

1000 Commits

Author SHA1 Message Date
Nathan Chancellor 2e3e24c54c qcom: mpm-of: Convert __bitmap_empty in preparation for removal
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2019-08-26 17:06:01 +02:00
Laxminath Kasam 4978e16166 ASoC: add rate limit for prints causing excessive logging
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>
2019-08-26 16:40:21 +02:00
franciscofranco 3c6c58a53d msm: mpm: disable debugging
Change-Id: Icd0c8a5d85b84cf6229e98ccfc0180aa44c0589e
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
2019-08-26 15:24:40 +02:00
Dorimanx 830c241e82 kernel: Convert a few critical drivers to use jiffies
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>
2019-08-26 15:21:32 +02:00
Aditya Bavanari 4036978c2e voice_svc: Avoid double free in voice_svc driver
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>
2018-07-12 16:40:40 -07:00
Banajit Goswami ecb46273d1 soc: q6dspv2: apr: fix client registration refcount
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>
2018-05-10 21:44:02 +00:00
Aditya Bavanari f6214fdc04 ASoC: apr: Add validity check to APR port
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>
2018-03-13 20:50:48 -07:00
Andrew Chant ea8aa8ca32 soc: qcom: glink_pkt: fix spinlock patch
Fix missing locking around rx data packet list,
correct work & wakeup source initialization.

Bug: 67713091
Change-Id: Ia8dcac71c370a902e960368d5bb3aa6016ab33d9
Signed-off-by: Andrew Chant <achant@google.com>
2017-11-07 17:11:21 +00:00
Arun Kumar Neelakantam 91f38952f1 soc: qcom: glink_pkt: Use spinlock to protect Rx data packet list
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>
2017-11-07 17:07:59 +00:00
Andrew Chant 69ff3a22bb Merge July 2017 security patches
Merge 'android-msm-bullhead-3.10-nyc-mr2' into
'android-msm-bullhead-3.10'

July 2017.1

Bug: 38137577
Change-Id: Id2935b141bbaa52d6ec63648551ac5dec3e21487
2017-05-17 23:07:26 -07:00
Nick Desaulniers 66869221d2 soc: qcom: pil: Avoid possible buffer overflow during Modem boot
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>
2017-05-16 20:16:45 +00:00
Nick Desaulniers bd015ed765 Merge branch msm-lge/android-msm-bullhead-3.10-nyc-mr2 into android-msm-bullhead-3.10
June 2017.1

Bug: 37156499
Change-Id: I0a6fb21fc83e5f4e417ccb0ba0667ee38f2c1880
2017-04-11 10:07:27 -07:00
Siena Richard 0da970f1aa FROMLIST: drivers: soc: add size check
Add size check to ensure the payload fits inside the declared payload
size to prevent loss of data when copying.

CRs-Fixed: 2009224
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Change-Id: I4275c626605272941143b54a7b8861b25f8e750a
Bug: 31796345
(am from
https://source.codeaurora.org/quic/la//kernel/msm-3.18/commit/?id=552714ed16b3ff6bf90be99d6d22ce5e6d298ac8)
Signed-off-by: Yueyao Zhu <yueyao@google.com>
2017-04-10 22:52:49 +00:00
Ecco Park b6ad97c61a Merge branch 'android-msm-bullhead-3.10-nyc-mr2' into android-msm-bullhead-3.10
May 2017.1

Bug:36138302
2017-03-15 20:37:51 -07:00
Andrew Chant a862b13b82 soc: qcom: scm: check for size_t overflow.
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>
2017-03-16 00:54:18 +00:00
Siena Richard 08e4cc8591 FROMLIST: drivers: soc: add mutex to prevent response being processed twice
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)
2017-03-16 00:53:55 +00:00
Wei Wang b5ea9943c4 ANDROID: fix uninitilized variable
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
2017-01-10 12:19:26 -08:00
Siena Richard ff01d8921d drivers: soc: add size checks and update log messages
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>
2016-12-07 07:37:07 +00:00
Josh Kirsch 62275da125 drivers: soc: Add buffer overflow check for svc send request
Add buffer overflow check in voice_svc_send_req.

CRs-fixed: 1010081

Bug: 31796345
Change-Id: Ice173a9f553022251bd58b0ac03c6fef2f4e0b40
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
2016-12-07 07:36:52 +00:00
Swetha Chikkaboraiah 75a96793a3 qcom: scm: remove printing input arguments
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>
2016-12-07 06:12:43 +00:00
Nick Desaulniers bba6dc33cf qdsp6v2: blacklist %p kptr_restrict
Bug: 31498403
Change-Id: Ie16da820fbbc1cc5815ef9e5a2566107d666a1bb
2016-10-18 07:01:42 +00:00
Karthikeyan Ramasubramanian 3eb6104a47 soc: qcom: smp2p: Fix kernel address leak
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>
2016-09-17 07:59:47 +00:00
Srinivasarao P db829fff1d qcom: ssr: Fix possible overflow when copying firmware name
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>
2016-07-15 04:25:35 +00:00
Badhri Jagan Sridharan 4e9369ec53 msm: rpm_stats: cleanup stats
Format rpm_stats.

Bug: 26564574
Change-Id: I658cd6efd56bb1d3c65fbbf715fa2bb7e165f95a
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
2016-04-27 20:29:34 +00:00
Badhri Jagan Sridharan 9d435777a6 msm: rpm_master_stats: reset master_cnt
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>
2016-04-27 20:29:14 +00:00
Veena Sambasivan 0eafcbb8f2 soc: qcom: rpm_master_stat: Add additional debug stats
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>
2016-03-27 00:15:29 +00:00
mohamed.khadri 1dcbd4538a power: store reboot reasons in pmic register
- select hard/soft reset based on module param
- enables reboot reason retention across hard resets

Bug: 25742233

Change-Id: I64e2ef1c02d51ceb20508775ddb420da06d7228a
Signed-off-by: Mohamed Khadri <mohamed.khadri@lge.com>
2015-12-14 13:58:56 -08:00
Karthik Parsha 77707f4288 rpm-smd: Raise priority of thread waiting for ack using RT mutex
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
2015-09-03 16:05:49 -07:00
Se Wang (Patrick) Oh fe74f20b3b qcom: scm: Support register x6 to pass the session id
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>
2015-08-15 12:03:56 -07:00
juya.kim 3b5034975d bullhead: lge_handle_panic: rearrange the offset in imem.
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>
2015-08-05 07:06:54 +00:00
Tapas Kumar Kundu 7f885bc168 soc: qcom: msm_perf: free allocated memory if error happens
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>
2015-07-29 16:32:59 -07:00
Jongrak Kwon 10a306d424 bullhead: lge_handle_panic: no crash for intentional modem restart
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>
2015-07-29 15:46:21 -07:00
Tapas Kumar Kundu dc4ff16c20 soc: qcom: msm_perf: prevent cpumask bits to be NULL
This changes fixes NULL pointer derefence issue for
cpumask variabls for clusters.

Change-Id: Ifa73a43213b6afdfde57285393f9729a954acfc3
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
2015-07-21 16:55:40 -07:00
Banajit Goswami 5fbd90b507 ASoC: msm: qdsp6v2: add support for new scm_call2 API
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>
2015-07-21 16:55:38 -07:00
kyungyoon.kim 7c558dc8d1 soc: qcom: watchdog_v2: remove pet_watchdog log
Change-Id: I31accb52d409017de3969b995721a892a60058b2
Signed-off-by: kyungyoon.kim <kyungyoon.kim@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
2015-06-17 17:02:15 +00:00
Patrick Daly 8a2688629c soc: qcom: scm-mpu: Fix bug in unlock code path
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>
2015-06-09 16:40:39 -07:00
Patrick Daly 87f495f61a soc: qcom: scm-mpu: Add an API to unlock the kernel text region
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>
2015-06-09 16:40:37 -07:00
Omprakash Dhyade 6c29646f57 soc: qcom: msm_perf: Add sysfs node to report cpu hotplug events
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>
2015-05-28 12:17:01 -07:00
Tapas Kumar Kundu fe4d8d7626 soc: qcom: msm_perf: Add support for enter/exit cycle for io detection
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>
2015-05-28 12:16:55 -07:00
Tapas Kumar Kundu caa42222f6 soc: qcom: msm_perf: Add support for multi_cycle entry/exit nodes
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>
2015-05-28 12:16:55 -07:00
Tapas Kumar Kundu ffd172c612 soc: qcom: msm_perf: Add timers to exit SINGLE mode
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>
2015-05-28 12:16:48 -07:00
choongryeol.lee c9b85f93b5 ARM64: bullhead: Add initial LGE Crash Handler
Change-Id: Ida38a2fafea95017dae95fbad72b69c709bd3b2c
Signed-off-by: kyuyoung.lee <kyuyoung.lee@lge.com>
Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com>
2015-05-20 21:28:36 +00:00
Rajkumar Raghupathy d313830bb9 soc: qcom: pil-msa: Notify MBA about PIL loading failure
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>
2015-05-19 16:40:57 -07:00
Rajkumar Raghupathy 316ae3f33a soc: qcom: pil-msa: Free mba region if metadata authentication fails
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>
2015-05-19 16:40:57 -07:00
Aravind Kumar 8672c546a2 ASoC: qdsp6v2: handle ion alloc failure correctly
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>
2015-05-04 22:44:44 -07:00
Sungmin Choi 4441a3446a Revert "ARM64: bullhead: populate dt to preserve the Kernel ABI"
This reverts commit 2846edefe9.

Signed-off-by: Sungmin Choi <sungmin.choi@lge.com>
2015-04-29 08:50:13 +09:00
choongryeol.lee 0317aa330c ARM64: bullhead: set backlight control in charger mode
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>
2015-04-23 06:19:29 +00:00
Jongrak Kwon 5084dae21f Merge branch 'LA.BF64.1.2.1_rb2.6' into android-msm-bullhead-3.10
Conflicts:
	arch/arm/boot/dts/qcom/msm8992-regulator.dtsi
	arch/arm/boot/dts/qcom/msm8992.dtsi
	drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
	drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
	drivers/power/bcl_peripheral.c
	drivers/power/qpnp-smbcharger.c
	drivers/video/msm/mdss/mdss_mdp_overlay.c
	drivers/video/msm/mdss/mdss_panel.h
2015-04-01 11:39:33 -07:00
Devin Kim 2846edefe9 ARM64: bullhead: populate dt to preserve the Kernel ABI
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>
2015-03-20 21:33:55 -07:00
Linux Build Service Account d80e1b107b Merge "qcom: peripheral-loader: Introduce an API to free relocatable memory" 2015-03-18 16:02:37 -07:00