Commit graph

875,546 commits

Author SHA1 Message Date
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
Saravana Kannan
93c29d1397 PM / devfreq: memlat: Look for min stall% in addition to ratio criteria
Some workloads doing memory access might appear memory latency bound even
though they might not actually be memory latency bound.

This error can happen when the core that's running the workload is very
parallelized or can do out of order executions, etc so not all memory
accesses would actually stall the core.

This can also happen when the the memory access monitoring capabilities
aren't ideal and end up counting more kinds of memory accesses than what
would be ideal. In this case, the IPM ratio can be lower than what it would
be if we had ideal monitoring capabilities.

To account for these errors, if the core has a stall cycle counting
capabilities, check for a minimum stall% before the workload is considered
memory latency bound. This would help reduce the inaccuracies, but is not a
replacement for IPM ratio scheme because the stall% method doesn't allow us
to detect which level of memory the workload is latency bound on, but the
IPM ratio does (based on which memory accesses we use for calculating the
ratio).

Change-Id: I4363d7848584e5562f6683b5ad6b0f99017ec71b
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[avajid@codeaurora.org: resolved minor merge conflicts and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:22:01 -08:00
Rohit Gupta
6b881f24a9 devfreq: simple-dev: Make the freq-table property optional
The call to devfreq_add_device() tries to initialize frequency tables
for simple-dev. This can be a more efficient way of setting up
frequency tables in case there are multiple tables for a single device
depending on hardware version.
Make 'freq-tbl-khz' property an optional one so that probe doesn't
fail in its absence and devfreq_add_device() also gets a chance to
set up the freq table for simple-dev.

Change-Id: I96b5c2d4aef2085512d94dc6792f5ba2711de64b
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:22:01 -08:00
Stephen Boyd
b89dc2a891 PM / devfreq: bw_hwmon: Add support for specifying count factor
Not all bandwidth monitors count in units of 1MB. Add a DT
property that indicates the number of bytes the monitor counts in
so we can properly scale the count we read from the hardware to
reflect the traffic. By default, we will assume 1MB units if the
property doesn't exist.

Change-Id: I1b581b2fffda04ba151df6e87221628368ff5b17
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:22:00 -08:00
Stephen Boyd
d6ee9c7aa6 PM / devfreq: bw_hwmon: Add support for configuring byte MID match
Add support to configure the byte MID match value from DT.

Change-Id: I5848aef98f15c6de9fe0fae0a1188a17810a5ef5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:59 -08:00
Stephen Boyd
0dd9e33079 PM / devfreq: bw_hwmon: Add support for BWMON5 monitors
Add support for the fifth type of bandwidth monitor. This monitor
is similar to the other types of monitors, but the register
offset is slightly different, and it doesn't have a global
interrupt base.

Change-Id: Ib05602832b6d4712b783ebaaa5aae9e60c00e30b
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:59 -08:00
Stephen Boyd
77d4c0bb9c PM / devfreq: bw_hwmon: Split out sw and hw paths
Let's split out the sw and hw counter configuration code paths
indicated by has_hw_sampling() into inline functions for the two
different types of monitors. This allows us to add different
types of monitors in the future with minimal changes.

Change-Id: I5cf6a1fe4d84ee0958fe68601cb1e76836d10256
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: minor change to check ret < 0]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:58 -08:00
Stephen Boyd
e1b5bffc44 PM / devfreq: bw_hwmon: Reflow some code
Fix up style in this driver probe routine to use newer mechanisms
like of_device_get_match_data() and to not use things like
addresses of functions to assign function pointers. This makes
the code more readable.

Change-Id: Ib07edc0051fe9319e9a40cda7ba79646ce59b7e4
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: resolved trivial merge conflict]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:58 -08:00
Stephen Boyd
9ff1db3cc7 PM / devfreq: bw_hwmon: irq can be negative
platform_get_irq() can return a negative number, but we assign it
to an unsigned integer, which can never be negative. Change the
type to int here so that we can detect irq errors.

Change-Id: I997063abfe5c9966f99014a099619e6bfe7aafe7
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:57 -08:00
Rohit Gupta
f30d9fbf4c PM / devfreq: bimc-bwmon: Add support for version 4
The version 4 of the BIMC BWMON hardware now has provisions for
counting bytes transferred at a high sampling rate.

Modify the existing driver and governor algorithm to
take advantage of that.

Change-Id: I5080297aef7e310d5c1a19098c177ddecb729c25
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:56 -08:00
Saravana Kannan
7236ae6387 PM / devfreq: bw_hwmon: Add HW offload support to governor
Some HW monitors can do a better job of the sampling and the threshold
checking than the SW implementation in the governor.  Update the governor's
API to add support for them.

Change-Id: Id4b5593a5ed3290684ba43ebebe2466ba0b730b6
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:56 -08:00
Rohit Gupta
a4e0d26f52 PM / devfreq: Introduce a memory-latency governor
Use performance counters to detect the memory latency sensitivity
of CPU workloads and vote for higher DDR frequency if required.

Change-Id: Ie77a3523bc5713fc0315bd0abc3913f485a96e0e
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
[avajid@codeaurora.org: updated attr definitions, removed exclude_idle flag and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:55 -08:00
Rohit Gupta
4fe3e2f242 PM / devfreq: bw_hwmon: Expose a throttle adjust tunable
Newer versions of bimc-bwmon counters have the capability to fake
higher byte count than what's actually transferred between a bus
master and DDR if the bus master is being throttled by QoS hardware
logic. Add support to set the throttle adjust field that comes with
this newer version of bimc-bwmon.

Change-Id: I33376c825fb11ab2e378f828b1d2ae46dd582836
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
[aparnam@codeaurora.org: Renamed throttle_adj functions]
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: resolved minor merge conflicts made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:55 -08:00
Junjie Wu
f4c2ac968a devfreq: devfreq_simple_dev: Add support for preparing device clock
For certain implementation, device clock needs to be prepared before
rate voting taking effect. Add support for preparing device clock
during initialization.

Change-Id: Ib22e83952187118342ff2546d4c79d3970a288f9
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:54 -08:00
Saravana Kannan
5121f0a5c3 PM / devfreq: bw_hwmon: Update to low latency, high sampling rate algorithm
The existing bw_hwmon governor samples the bandwidth every polling_interval
milliseconds and makes decisions. Polling interval of 50ms or even 10ms
gives a very low resolution picture of the DDR/bus traffic. Due to the
lower resolution picture, the existing governor algorithm has to be biased
aggressively towards performance to avoid any performance degradation
compared to using a static mapping between bus master (CPU, GPU, etc)
frequency to DDR/bus BW votes.

While the existing governor uses IRQ to get early notification of traffic
increase, even a 4x early notification for a 50ms polling interval still
takes 12.5ms. This kind of reaction time is still too slow for some bus
masters like CPU.

To take care of these limitations, rewrite the governor algorithm to take
multiple short samples of BW within a decision window (polling interval)
and use that higher resolution picture to make much better and faster
decisions. Doing so allows the governor to have the following features:
- Very low reaction time
- Over voting to stay ahead of increasing traffic
- Historic peak tracking to limit over voting
- Being power aware when doing over voting
- Pattern detection and intelligent hysteresis
- Detection low traffic modes and being less aggressive about BW votes.

Change-Id: I69886b7fbeea0b64d10b5a1fb23fcb5f3918f0ce
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[aparnam@codeaurora.org: Replaced snprintf with scnprintf]
Signed-off-by: Rama Aparna Mallavarapu <aparnam@codeaurora.org>
[avajid@codeaurora.org: updated attr definitions, made to_mbps_zone() static and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:54 -08:00
Junjie Wu
a3b03ca553 PM / devfreq: governor_cache_hwmon: Fix race in monitor start/stop
Some cache_hwmon devices can have interrupts firing at any time. The
interrupt handler would stop devfreq monitor, update its vote and
restart the monitor again. This introduces a race if
devfreq_supend/resume() or devfreq_interval_update() is called at
the same time. Since devfreq_monitor_start() re-initializes the work,
it could cause corruption while the work is being used elsewhere.

Protect governor monitor start/stops with a new lock.

Change-Id: I143aaaea86494b4c617df46e2c521a19b43861d5
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2019-12-05 21:21:53 -08:00
Hanumath Prasad
b0dfbcd1e9 PM / devfreq: bimc-bwmon: set a floor_mbps for irq threshold
Interrupt storm happens when bwmon is enabled for GPU. This is mainly
due to constant low traffic observed with GPU while doing memory
read/write. So as the data rates read from counters are low and so the
threshold set for triggering the interrupt also set as low, which in
turn causes huge number of interrupts. Avoid this by setting a minimum
floor for the irq threshold.

Change-Id: I190fad5108bc24afcb67bec5809485380ee3662e
Signed-off-by: Hanumath Prasad <hpprasad@codeaurora.org>
2019-12-05 21:21:52 -08:00
Junjie Wu
7123adfcc0 PM / devfreq: cache_hwmon: Use array for reporting monitor stats
Using an array to report monitor stats instead of hard coded variable
names would allow for cleaner implementations of some cache hwmon
device drivers.

Change-Id: I787bdc12f10a0c8ff3c4195ce229a2987acdfce7
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:52 -08:00
Junjie Wu
939d572b12 PM / devfreq: cache_hwmon: Move IRQ handling to device drivers
The cache monitoring devices might have more than one IRQ to handle
or might have notifications from other drivers instead of using actual
IRQs. So, refactor the governor to move the IRQ handling to the cache
monitoring device specific drivers and just provide an API that can be
used to request a re-evaluation.

The device specific driver can call this API to request an immediate
re-evaluation whenever the cache request has exceeded the previously
set limit instead of waiting for the periodic update.

Change-Id: Ib2e9f53f95749d659f440739a1b074b5a0d94fd8
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:51 -08:00
Junjie Wu
b29a2f00d3 PM / devfreq: Refactor Cache HWmon governor to be more generic
The refactor allows the governor to support multiple devfreq devices.
This is done by having different HW monitor instances register their
capability to monitor different devfreq devices and then picking the
right HW monitor based on which devfreq device is using this governor.

Change-Id: I72c0542ce97f3965e422df521e0ce86cad218d93
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
[avajid@codeaurora.org: resolved minor conflict and  made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:51 -08:00
Saravana Kannan
f482e49077 PM / devfreq: bimc-bwmon: Add support for version 2
The version 2 of the BIMC BWMON HW doesn't reset the counter to 0 when it
hits the threshold. It also has support for an overflow status register.

Change-Id: I9f18d2153a2e5e762ec9950f26e0e7601468a80a
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[avajid@codeaurora.org: made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-05 21:21:50 -08:00
qctecmdr
7531776c2b Merge "usb: gadget: ffs: Use local copy of descriptors for userspace copy" 2019-12-05 21:07:37 -08:00
qctecmdr
609f038c7d Merge "uio: msm_sharedmem: Fix format specifier to print resource_size_t" 2019-12-05 19:35:43 -08:00
qctecmdr
d4d0ed4fbc Merge "msm: kgsl: Make secure memory depend on QCOM_SECURE_BUFFER" 2019-12-05 19:00:04 -08:00
qctecmdr
9753b2fda8 Merge "usb: dwc3-msm: Add soft dependency on phy drivers" 2019-12-05 19:00:03 -08:00
qctecmdr
666a2266c1 Merge "msm:ipa: changing err prints to dbg prints" 2019-12-05 19:00:03 -08:00
Vamsi Krishna Samavedam
3a85476e48 usb: gadget: ffs: Use local copy of descriptors for userspace copy
USB cable can be disconnected (function disable) and function
descriptors can be freed while userspace daemon requesting for
descriptors copy to userspace. Avoid stale pointer copy by always
copying only local copy of desctiptors.

Change-Id: I16c01d22058e7148546f1ffbc5017520402eda97
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
2019-12-05 18:24:31 -08:00
qctecmdr
3045517e4c Merge "msm: kgsl: Replace the sorted dispatcher pending list" 2019-12-05 18:24:07 -08:00
qctecmdr
16a5189304 Merge "msm: kgsl: Make 'globals' a device level debugfs file" 2019-12-05 17:48:02 -08:00
qctecmdr
d92a6815ac Merge "PM / devfreq: icc: Add suspend/resume APIs" 2019-12-05 15:25:59 -08:00
Michael Adisumarta
92b1788390 msm:ipa: changing err prints to dbg prints
using debug prints instead of err prints

Change-Id: Iaf667ca33e47f867dbd118f4d839f2e8e955f557
Acked-by: Suhas Mallesh <smallesh@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
2019-12-05 12:46:24 -08:00
qctecmdr
ce549bfb36 Merge "serial: Add UART port for EUD" 2019-12-05 12:19:11 -08:00
qctecmdr
a051fe801d Merge "msm: adsprpc: Fix adsprpc info leak" 2019-12-05 11:16:20 -08:00
qctecmdr
909a087306 Merge "dmaengine: gpi: Add support for 32-bit kernel" 2019-12-05 10:36:59 -08:00
Raghavendra Rao Ananta
973373accb usb: dwc3-msm: Add soft dependency on phy drivers
dwc3-msm driver is functionally dependent on the phy-generic,
phy-msm-snps-hs, and phy-msm-ssusb-qmp drivers. Hence, explicitly
add a soft-dependency on it to avoid unnecessary re-probes
when built as a module.

Change-Id: I16d3a3fb72a968b0ae7935df74cff86697a97c32
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-12-05 09:45:58 -08:00
Perry Randise
0937f4a5b0 msm: ipa3: SRAM NAT, DDR NAT, back-and-forth NAT
NAT can be run out SRAM, then DDR, then back-and-forth all relative to
the number of connections the NAT can hold.

Change-Id: Id20d7087e4e84fec826c72e29e50cae97f43191d
CRs-Fixed: 2578986
Signed-off-by: Perry Randise <prandise@codeaurora.org>
2019-12-05 11:22:56 -05:00
Vipin Deep Kaur
f73e094379 dmaengine: gpi: Add support for 32-bit kernel
Add new macros in GSI driver to support 32-bit
architecture.

Change-Id: I7fd9867b19458ac962a87c03dfcf2ea570a4de69
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2019-12-05 04:35:28 -08:00
Vipin Deep Kaur
e3225c64c9 dmaengine: gpi: Capture GPI hardware status during GSI General interrupt
Debug patch to capture GPI hardware status when a GSI General interrupt
is triggered.

Change-Id: I81a5d3858bd295383cd1079394fb161930d63913
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
2019-12-05 04:33:45 -08:00
qctecmdr
f97b25d749 Merge "arm64: defconfig: Enable CONFIG_I2C_RTC6226_QCA on Lahaina" 2019-12-05 02:36:07 -08:00
qctecmdr
75bffc503f Merge "arm64: defconfig: Enable RPMh clock driver for Lahaina" 2019-12-05 02:36:06 -08:00
Nikhilesh Reddy
9e97a7be89 uio: msm_sharedmem: Fix format specifier to print resource_size_t
Use proper printk format specifier %pa to print resource_size_t
type variable.

Change-Id: I77b1f3ded0957d4a572c5c05996a3649a9b1fb45
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
[riteshh@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
Signed-off-by: Richard Patrick <richardp@codeaurora.org>
2019-12-05 00:01:57 -08:00
Prasad Sodagudi
5a12bcfdc2 uio: msm_sharedmem: Use proper format to print phys_addr_t
Use proper printk format specifier to print phys_addr_t
type variable.

Change-Id: I7c55e44e813d8d41e1ead03280044c8542a24922
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
[riteshh@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
Signed-off-by: Richard Patrick <richardp@codeaurora.org>
2019-12-05 00:01:10 -08:00
Nikhilesh Reddy
a9937c5125 uio: msm_sharedmem: Add support for HYP call
Add support for HYP call to setup the sharedmem permissions
for the MPSS client.

Change-Id: I3b48ae962865d8d0a0ea6e3fbb8e21278b59c690
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
[riteshh@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
Signed-off-by: Richard Patrick <richardp@codeaurora.org>
2019-12-05 00:00:32 -08:00
Nikhilesh Reddy
6ed8bf232a uio: Add snapshot of MSM sharedmem driver
This is a snapshot of the MSM sharedmem driver as of msm-3.14
commit:
commit <149717c0> ("uio: msm_sharedmem: Add custom mmap") +
sharedmem qmi logic is removed.

The following changes are included:
02d55287 uio: msm_sharedmem: Restrict debugfs write to root.
de961fc7 uio: msm_sharedmem: Return ENOMEM if the shared mem addr
	 is zero.
b974ce64 uio: msm_sharedmem: Add addtional information to debugfs
c46af547 uio: msm_sharedmem: Add support for dynamic shared memory
	 allocation

Change-Id: I49902f018bde1d59d41027b7e46268cc17231a3e
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
Signed-off-by: Richard Patrick <richardp@codeaurora.org>
2019-12-04 23:58:15 -08:00
qctecmdr
ad0c7ffd79 Merge "arm64: defconfig: Disable hvc console for lahaina SoC" 2019-12-04 16:37:28 -08:00
qctecmdr
f41050307f Merge "firmware: qcom-scm: Fix formatting errors in the trace string" 2019-12-04 14:57:36 -08:00
Prakruthi Deepak Heragu
d74757773f serial: Add UART port for EUD
This commit adds new UART port to support UART available on Embedded
USB Debugger (EUD).

Change-Id: Ib2bcf15df04875e5d9eb7ce3dc30f1d187236279
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2019-12-04 14:42:14 -08:00
Saravana Kannan
74a06b81ab PM / devfreq: icc: Add suspend/resume APIs
Absence of traffic is guaranteed when the device sitting behind a devbw
device is suspended. In such cases, it is a waste of power to make non-zero
bandwidth votes or to scale the devbw device. So, provide APIs to
suspend/resume the devbw device as needed.

Change-Id: Id58072aec7a9710eb917f248d9b9bd08d3a1ec6a
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[avajid@codeaurora.org: renamed devbw to icc and made minor styling change]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-04 12:04:25 -08:00
Saravana Kannan
2fa5f6f0b3 PM / devfreq: governor_bw_hwmon: Add suspend/resume support
Some devfreq devices using this governor might need suspend/resume support.
When suspended, those devices won't need any bandwidth votes and there is
no point in monitoring their bandwidth either.

Therefore, upon suspend, vote for zero bandwidth and stop the HW monitor.
Upon resume, vote for the previous bandwidth and start the HW monitor.

Change-Id: I318449995d714959f0ebfe91961bc23fa8edbd04
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[avajid@codeaurora.org: resolved trival merge conflicts and made minor styling changes]
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2019-12-04 12:04:24 -08:00