Commit graph

875,627 commits

Author SHA1 Message Date
Runmin Wang
86bb5dca4b scripts: Makefile: Remove flags which are not support by EXT_DTC
DTBO relies on external DTC compiler and there are certain flags which
are not supported by the external DTC compiler.
Add a check to remove those flags for now.

Change-Id: I318a1d110bd54a4a888ee8a5456d7c5a39bd9f6b
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2019-12-10 11:04:19 -08:00
Puja Gupta
d6db0c3818 scripts: Makefile: add support to use external DTC
Add support to use external DTC to compile device tree blobs.

Change-Id: I268d2332d5328c3b0050b35c96f91e8ef9e1f6f8
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
[eberman@codeaurora.org: Resolve merge conflicts]
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-12-10 11:04:19 -08:00
Maria Yu
5e63fbd85e scripts: Makefile: Add multi overlay dtbo-base apply verify
Current board device tree overlay verify only support
single soc device tree dtb. Add support overlay apply verify
for multi soc device tree dtb in dtbo-base.

Change-Id: Idca1c57969303f701be37550da23c117cbd90470
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
2019-12-10 11:04:18 -08:00
Kyle Yan
0d9f81fc43 scripts: Makefile: Change output overlay from .dtb to .tmp
If the output overlayed file has the .dtb extension, then the build system
may interpret the overlayed file as a SOC DTB file which will result
in the final kernel image including properties from the board files.

Change-Id: I857d5dc731b1bbcd880a7543a437e10f4f9bf912
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2019-12-10 11:04:18 -08:00
Puja Gupta
5d5044069e scripts: Makefile: add support to compile DT overlay blobs
Add support to compile device tree overlay blob.
'dtbo-y' target can be used to specify DT overlay blob.
'<target>-obj'  must be specified to list base and overlay blobs.

Change-Id: Ib5036c70ba46374619cc43f9f7b697e1a444aebf
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
[eberman@codeaurora.org: Resolve merge conflicts]
Signed-off-by: Elliot Bermna <eberman@codeaurora.org>
2019-12-10 11:04:18 -08:00
qctecmdr
d9f515c2b6 Merge "clk: qcom: gpucc: Voltage voting support for Lahaina" 2019-12-09 09:50:33 -08:00
qctecmdr
a0aff6fc73 Merge "msm: kgsl: Set up the adreno device at runtime" 2019-12-09 09:05:21 -08:00
qctecmdr
140cc17e9c Merge "msm: kgsl: Add dedicated boolean functions for adreno sysfs" 2019-12-09 08:32:40 -08:00
qctecmdr
9275751079 Merge "msm: kgsl: Cleanup the device tree probing for memory pools" 2019-12-09 07:59:44 -08:00
qctecmdr
721c41dd4c Merge "msm: kgsl: Make the a6xx mbox client static" 2019-12-09 07:20:52 -08:00
qctecmdr
babbe4d5d1 Merge "wil6210: fix QCA_WLAN_VENDOR_ATTR_FREQ attribute ID" 2019-12-09 03:56:44 -08:00
qctecmdr
905447de4c Merge "spi: spi-msm-geni: Add support to make SPI driver GKI compliant" 2019-12-09 03:26:45 -08:00
qctecmdr
a0d40ebe6f Merge "wil6210: initial support for FTM and AOA" 2019-12-09 02:57:35 -08:00
qctecmdr
eb7a9dce11 Merge "wil6210: add module parameter for alternate interface name" 2019-12-09 02:15:48 -08:00
qctecmdr
ecac8a0e7f Merge "msm: kgsl: Cleanup iommu device tree probe" 2019-12-09 00:39:40 -08:00
qctecmdr
2e952766ee Merge "firmware: qcom_scm: Check for NULL before dereferencing __scm" 2019-12-09 00:39:39 -08:00
qctecmdr
f9b86476cf Merge "iommu/arm-smmu: Reduce log spam from ECATS translation timeouts" 2019-12-09 00:39:39 -08:00
Vipin Deep Kaur
efebf52281 spi: spi-msm-geni: Add support to make SPI driver GKI compliant
Add support in SPI QUPv3 driver to make it a DLKM.

Change-Id: Ic251466331862eb9a6e72455cac8ac4388b01045
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2019-12-09 13:53:38 +05:30
qctecmdr
02b2c03252 Merge "arm64: defconfig: Enable Lazy DMA Mapping on Lahaina GKI" 2019-12-08 23:58:00 -08:00
Lior David
bcdbe43a38 wil6210: fix QCA_WLAN_VENDOR_ATTR_FREQ attribute ID
Fix QCA_WLAN_VENDOR_ATTR_FREQ attribute ID to match the official
value from the QCA vendor command definitions (qca-vendor.h).

Change-Id: I549752fe5c29de5346cf9263ccc16266cafbbecd
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
2019-12-08 10:40:03 +02:00
Lior David
abcaaf6443 wil6210: support FTM/AOA while unassociated
Prepare driver for FTM/AOA while unassociated.
1. Added attributes allowing user space to specify the frequency
where FTM/AOA peer is listening. When specified it will override
the entry in the kernel scan results cache. If not specified,
the kernel scan results cache will be used like today.
This gives user space location framework more flexibility - it
can maintain its own cache of peers, or perform scans less
often (since entries in the kernel scan results cache expire
quickly)
2. Remove associated check when starting FTM session, so session
can start even when unassociated.

Change-Id: Ib0ba52c506e1d8d59ab8c12043acd792405d69a0
CRs-Fixed: 1094147
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
2019-12-08 10:40:03 +02:00
Lior David
9adf4cf273 wil6210: initial support for FTM and AOA
Added initial support for fine timing measurement(FTM)
and angle of arrival (AOA). These features allow a station
to get an accurate indoor location by measuring
distance (FTM) and azimuth/elevation (AOA) to one or more
stations/APs with a known location.

The following APIs are supported:
1. Get FTM/AOA capabilities, currently hard-coded for a
single-shot measurement to an associated AP.
2. Start FTM session.
3. Receive FTM results.
4. Start standalone AOA measurement.
5. Receive AOA results.

Change-Id: I54ebc1bdff6ed7d91644165b16eb0a4240069321
CRs-Fixed: 1057307
Signed-off-by: Lior David <liord@codeaurora.org>
[merez@codeaurora.org: fix compilation errors]
Signed-off-by: Maya Erez <merez@codeaurora.org>
[ailizaro@codeaurora.org: trivial conflict fixes]
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
[liord@codeaurora.org: fix conflicts, SPDX license]
Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
2019-12-08 10:39:45 +02:00
qctecmdr
eda093d5ef Merge "dmaengine: gpi: Add support to make GPI driver GKI compliant" 2019-12-07 00:59:42 -08:00
qctecmdr
a2457c5ecd Merge "soc: qcom: ssr: Export find_subsys_device function" 2019-12-07 00:59:41 -08:00
qctecmdr
da62b770ad Merge "drivers: thermal: Add a snapshot of thermal framework" 2019-12-07 00:59:41 -08:00
qctecmdr
cdeb9b274f Merge "firmware: qcom_scm: Add MODULE_LICENSE" 2019-12-07 00:59:39 -08:00
qctecmdr
ebbf8cba46 Merge "devfreq: Do not allow tunable updates when device is suspended" 2019-12-06 18:04:42 -08:00
Raghavendra Rao Ananta
54e781e95b firmware: qcom_scm: Check for NULL before dereferencing __scm
The function qcom_scm_get_sec_dump_state dereferences __scm without
checking for NULL and could potentially lead to a NULL pointer exception.
This scenario can happen if the clinet calls qcom_scm_get_sec_dump_state
before qcom_scm driver is even probed. Hence, check for NULL before
dereferencing it.

Change-Id: Ic6f7c2b2d616645ea69a8c594c90dc01d689637f
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-12-06 17:24:19 -08:00
qctecmdr
cf23d0036d Merge "PM / devfreq: memlat: Look for min stall% in addition to ratio criteria" 2019-12-06 11:10:36 -08:00
qctecmdr
ec6b9bfbe0 Merge "msm: ipa3: SRAM NAT, DDR NAT, back-and-forth NAT" 2019-12-06 10:38:46 -08:00
Rama Aparna Mallavarapu
5e33579a6a devfreq: Do not allow tunable updates when device is suspended
Tunables update accesses the monitor's registers for some devices.
When the device is suspended, the clocks for those devices are turned
off and updating the tunables of a suspended device causes the device
to crash. Fix this by checking the flag dev_suspended before allowing
the tunable updates.

Change-Id: I3a0938edf761a9ea6d39ffeec19f35c228d5c306
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: updated to utilize suspend_count from upstream and resolved minor merge conflicts]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:32 -08:00
Rama Aparna Mallavarapu
db4f4a0933 PM/devfreq: Do not switch governors from sysfs when device is suspended
There is a possibility to switch the governors from sysfs even when the
device is in suspended state. This can cause a NOC error at times when
trying to access the device's monitor registers in a suspended state. This
change fixes this issue. Utilize suspend_count to know if the device is in
suspended state or not. Check if the device is suspended before switching
the governor from sysfs.

Change-Id: I15055aa51daa35272be4667e5bafb8ccd7933098
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: updated to utilize suspend_count from upstream, resolved minor merge conflicts and updated commit text]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:32 -08:00
Rama Aparna Mallavarapu
96784c4520 PM / devfreq: Fix race condition between suspend/resume and governor_store
There is a race condition when the event governor_store is being executed
from sysfs and the device issues a suspend. The devfreq data structures
would become stale when the suspend tries to access them in the middle
of the governor_store operation. Fix this issue by taking a lock around
suspend and resume operations so that these operations are not concurrent
with the other events from sysfs.

Change-Id: Ifa0e93915a920cec3e0429966328a1128d61098b
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: updated to merge better with upstream changes and removed renaming since done in previous commit]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:31 -08:00
Jonathan Avila
9693b4d620 PM / devfreq: Introduce an event lock
Currently, concurrent writes to sysfs entries leave the	possibility
for race conditions within the devfreq framework.  For example,
concurrently executing max_freq_store and governor_store can result
in attempting to perform an update_devfreq() before the new governor's
start handler can be executed.

A more concrete case is a race between polling_interval_store and
governor_store.  Because no lock is used after calling into the event
handler of the old governor and there's nothing preventing work from
being queued after the monitor is stopped, it's possible to
accidentally cause delayed work to be queued on the governor being
switched to.  This can be seen if you create two threads, one which
changes a device's governor between simple_ondemand and performance,
and one which changes its polling interval between 45 and 50.

All of these races can be addressed with the introduction of a lock
that prevents sysfs operations from interleaving in this fashion.

Change-Id: Ia6887dcb2d69dc2576837a6c09fed55a28943abc
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
[avajid@codeaurora.org: renamed to event lock and only used when CONFIG_QCOM_DEVFREQ_ICC is enabled]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:30 -08:00
Jonathan Avila
52ab3535b2 Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"
This reverts commit 4585fbcb53. The change
to be reverted would add probe order-dependent numbers to the end of each
devfreq device, making our post boot script (among others) incredibly
brittle.

Change-Id: I8fdb679ae651d9f425ffd60e2141613ae20bb029
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
[avajid@codeaurora.org: resolved trival merge conflicts]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:30 -08:00
Amir Vajid
1bb4b043b3 PM / devfreq: qoslat: Update voting level definitions
Having OPP levels of 0 and 1 causes a minor error in OPP
debugfs since an OPP level of 0 causes the OPP index to be
used instead (1 in this case) which later clashes with an
actual OPP of 1. Update the qoslat OPP levels to avoid this.

Change-Id: I23c0e736c9f1bfe77a99af44ced180d488a52eeb
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:29 -08:00
Rama Aparna Mallavarapu
6b1a168b7e devfreq: Allow bw_hwmon resume with zero resume freq
Currently bw_hwmon governor does not allow the device
to be resume if the resume_freq is set to zero. But there
can be devices that vote for zero frequency when there is
no bandwidth on the device. This does not mean that the device
should not be resume from suspend. Remove the check with prevents
resume, instead add a check in the devfreq framework to check if
device is suspended or not before calling the governor resume.

Change-Id: Ib82a6a36308aee52e8bb989fddca92265de6c4a4
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: removed suspended check in devfreq framework]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:28 -08:00
Rama Aparna Mallavarapu
6f5e9162ed devfreq: bwmon: Increase the IOPercentage limits to 400
The IO percentage limits the values to 100, increase it
since some devices might need a higher value.

Change-Id: I7f19017b426832d9a1a11bd02195a4d15634c041
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: resolved trivial merge conflict]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:28 -08:00
Rama Aparna Mallavarapu
b6d80a179b qcom-llcc-pmu: Update the LLCC PMU configurations for kona
Kona has new LLCC PMU version. This brought in changes in the
monitor enable, disable and configuration registers and hence
made code changes accordingly to read cache misses for multiple
CPUs.

Change-Id: I4d25487966a31f12143e2f99264a25d8c38f0188
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: updated version enum, fixed disable/clear masks and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:27 -08:00
Jonathan Avila
e43263bdea perf: Introduce a LLCC PMU
Some chips have hardware that can count misses for LLCC at a per-CPU level.
This PMU serves as an intermediary that allows us to retrieve these values
for use in other drivers.

Change-Id: I1dc3090a64ec7d5b12a36b0395c42930128287fe
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
[avajid@codeaurora.org: removed BEAC registers, unused variables and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:26 -08:00
Amir Vajid
71876da229 PM / devfreq: Add support for memory latency QoS voting
Add a devfreq device that has the ability to vote for a
QoS level to ensure better memory latency.

Change-Id: I33094b45ec250a58f244ecb1b7b8476df8791425
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:26 -08:00
Amir Vajid
3c55215ea5 PM / devfreq: memlat: optimize freq and stall_pct calculations
Currently, we calculate freq and stall_pct multiple times for
the same shared PMU counters. Calculate these once per cpu_grp
to prevent repeating the same calculation multiple times later.

Change-Id: I3b594e01ca50a583f45174e69a24f0b0eca32dde
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:25 -08:00
Jonathan Avila
74b58a68aa PM / devfreq: memlat: Aggregate memlat mons under a controller
Currently, each individual arm-memlat-mon instance separately reads from
a few shared PMUs, which leads to unnecessary IPI overhead. Tweak the
arm-memlat-mon design to allow multiple monitors to share certain event
counts, lowering overhead.

Change-Id: Ic3358afd1853efd84a4c3d5f3d66c3a86df6e5e7
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
[avajid@codeaurora.org: squashed minor fixes and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:51:17 -08:00
Rama Aparna Mallavarapu
c727848bb4 devfreq: detect ddr type and add frequency table accordingly
Some targets support different DDR types. Detect the DDR type
and populate the frequency table accordingly. OPP framework
supports opp-supported-hw bit map which allows the selected
frequencies to be added to the opp table based on the hardware
version check. Implement the same in the bandwidth monitor device
so that the right frequencies would be added to the opp table.
This patch also adds checks for the latency based device to detect
the DDR type at runtime and add the corresponding frequency map.

Change-Id: Ice5a0b14da67b3f2f07e98bc7349220da7d4efdb
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: resolved minor conflicts and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:50:43 -08:00
Santosh Mardi
b04e29f991 PM / devfreq: bw_hwmon: use unsigned parameter for bytes_to_mbps
In bytes_to_mbps function, the parameter is all unsigned,
so change the decleration of the function to include unsigned long
long to avoid compilation errors in 32 bit environment.
Also changed the return value as unsigned long to avoid
any data loss possible in 64 bit environment.

Change-Id: I90aebfe32e86ebc17c414d6f3c0c3cbd6dddb0bd
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2019-12-06 08:50:42 -08:00
Rama Aparna Mallavarapu
4b5e726869 devfreq: bimc_bwmon: Add support to enable BWMON clks
Some BWMON devices requires clocks to be enabled, hence
add necessary support in the bwmon driver to enable the
required clocks if any.

Change-Id: Ie06731f764ff24d602ae2a86dea4f39ce75df800
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:50:42 -08:00
Santosh Mardi
5310a38087 devfreq: return error code when governor start fails
If there is a failure in starting hw monitor required for
memlat governor, return the error code to devfreq framework
so that the framework  will make sure the governor is
switched back to previous governor.

Change-Id: I76705725fc8b94d5341b1b8af7c1bd2b79e7642a
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
[avajid@codeaurora.org: minor change to check ret < 0]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:50:41 -08:00
Rama Aparna Mallavarapu
2526ddbdbe devfreq: bw_mon: check for the return value of start_monitor
The BWMON governor start is returning success on GOV_START event
without checking for the return value of start_monitor.
The return value of start_monitor is not being returned to
ret variable. This would cause the governor to start successfully
even when the monitor failed to start causing a NULL pointer
derefence when accessing the device attributes. Fix it by checking
the return value of start_monitor.

Change-Id: I8c1f6933d44ae4533c6b81ccda8a5c4c0da3779c
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: minor change to check ret < 0]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:50:40 -08:00
Rama Aparna Mallavarapu
9170b2bc7b devfreq: Do not round up bandwidth on BWMON4 devices
Currently only BWMON5 devices increment the count for non-zero
bandwidth while BWMON4 devices increment the count all the time.
This results in a non-zero bandwidth report even when the count
is zero for BWMON4 devices leading to unnecessarily higher
bandwidth votes. Apply checks similar to BWMON5 devices for BWMON4
monitors as well.

Change-Id: I0a2d1c0ed979973966668391a32f63bf2711f981
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
2019-12-06 08:50:40 -08:00
Rama Aparna Mallavarapu
3f6460328d PM / devfreq: bw_hwmon: Fix a race condition in hwmon stop
Currently, the bw_hwmon governor handles DEVFREQ_GOV_STOP and
DEVFREQ_GOV_SUSPEND events by calling devfreq_monitor_stop
and devfreq_monitor_suspend respectively, prior to disabling
the bw_hwmon irq. Doing so allows for the following race condition:

	T0:  				   bw_hwmon irq thread:

/* df->governor == bw_hwmon
 * changing to
 * powersave governor
 */
governor_store()
 /* Calls bw_hwmon governor event
  * handler with DEVFREQ_GOV_STOP
  * event
  */
 df->governor->event_handler()
  gov_stop()
  stop_monitor()
                                        update_bw_hwmon()
                                        devfreq_monitor_stop()
   /* Cancels timer for future calls
    * to devfreq_monitor
    */
   devfreq_monitor_stop()
   /* Calls free_irq(), which waits
    * for the bw_hwmon IRQ thread
    * to finish.
    */
   hw->stop_hwmon()
                                        --finishes update_devfreq()--
                                        /* Incorrectly starts
					 * devfreq_monitoring
                                         */
                                        devfreq_monitor_start()
                                       --thread finishes execution--
   --finishes DEVFREQ_GOV_STOP
     handling--
 --switches governor to powersave--
/* devfreq monitor for this
 * instance. This will call
 * queue_delayed_work()
 * which internally queues
 * the timer for this devfreq
 * structure.
 */
devfreq_monitor()
/* df->governor == powersave
 * changing to bw_hwmon
 */
governor_store()
 /* powersave: DEVFREQ_GOV_STOP
  */
 df->governor->event_handler()
 /* bw_hwmon: DEVFREQ_GOV_START
  */
 df->governor->event_handler()
  gov_start()
   /* Will incorrectly adjust
    * the fields within the
    * timer and corrupt the
    * timer data structure
    */
   devfreq_monitor_start()

Since this corrupts the timer data structures, when the timer
gets expired, it will be expired twice. Fix this race condition
by introducing new lock to synchronize the access to the
mon_started variable, so that the irq thread does not restart
the devfreq monitor after it has been stopped.

Change-Id: I2dced21d5343afd6ec2e13876e26aeb5c83a4d12
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: made minor styling change]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-06 08:50:39 -08:00