Add extra debug information to make it easier to both determine
why the lowmemorykiller killed a process and to help find the source
of memory leaks.
Also increase the debug level for "select" statements to help prevent
flooding the log.
Change-Id: I3b6876c5ecdf192ecc271aed3f37579f66d47a08
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Currenlty most memory reclaim is done through kswapd.
Since kswapd uses a gfp mask of GFP_KERNEL, and because
the lowmemorykiller is zone aware, the lowmemorykiller will
ignore highmem most of the time.
This results in the lowmemorykiller being overly aggressive.
The fix to this issue is to allow the lowmemorykiller to
count highmem when being called by the kswapd if the lowmem
watermarks are satisfied.
Change-Id: I938644584f374763d10d429d835e74daa4854a38
Signed-off-by: Liam Mark <lmark@codeaurora.org>
The lowmemorykiller relies on NR_FILE_PAGES when measuring
the amount of reclaimable memory in the system.
However when swap is enabled swap cache pages are counted
in NR_FILE_PAGES, and swap cache pages aren't as reclaimable
in low memory as file cache pages. Therefore a large swap
cache can result in the lowmemorykiller not running and
an OOM occurring.
In order to ensure the lowmemorykiller properly evaluates the
amount of reclaimable memory don't count the swap cache pages.
Change-Id: I38239283e572f814b277c718eaf6be7f92abacbb
Signed-off-by: Liam Mark <lmark@codeaurora.org>
In certain memory configurations there can be a large number of
CMA pages which are not suitable to satisfy certain memory
requests.
This large number of unsuitable pages can cause the
lowmemorykiller to not kill any tasks because the
lowmemorykiller counts all free pages.
In order to ensure the lowmemorykiller properly evaluates the
free memory only count the free CMA pages if they are suitable
for satisfying the memory request.
Change-Id: I7f06d53e2d8cfe7439e5561fe6e5209ce73b1c90
CRs-fixed: 437016
Signed-off-by: Liam Mark <lmark@codeaurora.org>
There are cases that LMK doesn't run, even when it must run.
It is due to LMK shrinker not considering memory status per zone.
So add LMK parameters(other_free, other_file) tunnig code to
consider target zone of LMK shrinker.
Change-Id: I6f1f8660d5da920a0e3af45a160499965032081d
Git-commit: 22d990a58fc17b3f0155e15eb2dc3efa037bea1c
Git-repo: https://android.googlesource.com/kernel/common/
[ohaugan@codeaurora.org: Fix compilation issues]
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Liam Mark <lmark@codeaurora.org>
A killed task can stay in the task list long after its
memory has been returned to the system, therefore
ignore any tasks whose mm struct has been freed.
Change-Id: I76394b203b4ab2312437c839976f0ecb7b6dde4e
CRs-fixed: 450383
Signed-off-by: Liam Mark <lmark@codeaurora.org>
This change enables CONFIG_USB_CONFIGFS_F_GSI required for
USB GSI (RMNET, RNDIS and DPL) related functionality.
CRs-Fixed: 1001469
Change-Id: I91b2531a2ce739613181f2e13c692263d9e2454a
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This change adds required .h files to resolve below seen
compilation errors.
In function ‘gsi_update_function_bind_params’:
error: implicit declaration of function ‘msm_ep_config’
warning: ‘enum ipa_usb_notify_event’ declared inside parameter list
CRs-Fixed: 1001469
Change-Id: Ic62b4dae798726055beb778509e6b65e69f4db34
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
f_gsi compilation is failing with below error:
fatal error: linux/usb/usb_ctrl_qti.h: No such file or directory
Hence add missing usb_ctrl_qti.h to resolve above error while
compiling f_gsi.c file.
This file's snapshot is taken from msm-3.18 kernel as
'commit 24b986908cc1 ("power: qpnp-fg: stop IMA transactions
during FG shutdown")'.
CRs-Fixed: 1001469
Change-Id: Ib7dce6b2ae1670554a29847e4381e71ba7b75edf
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
-Pmcobalt GPIO 9 belongs to GPIO_LV subtype, so update the voltage
selection value to 0 which is the allowed selection.
-Pull up/down is not needed for pmcobalt GPIOs, so update the pull
value to PULL_NO.
Change-Id: I7b9faf485dda6f450f6df4410e3ae25efa40aad1
Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
FastRPC migration to use GLINK from existing SMD driver for inter-
process communication. Updated FastRPC context bank details for
msmcobalt. Added "qcom,enable-glink" option in dtsi file for
using glink, uses smd if this flag is not defined.
Change-Id: I4a933c9b3355b0aa1b653719ec1ec7ded1f368dd
Acked-by: Viswanatham Paduchuri <vpaduchu@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
Implement the tag, swevent, and swentity message formats.
Additionally, abstract the actual scm call and error checking
into a separate shared function.
CRs-Fixed: 997749
Change-Id: Ie80846978a84a114b38d69b0bca86639bfab7e91
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Replace the previous format of a unique scm call id per function to
a buffer-based protocol.
CRs-Fixed: 997749
Change-Id: I7738b6369e095868fa6087aac94116f4767dc168
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
In case of deaggregation error in IPA, IPA HW will send
the deaggregation error frame as exception.
This change fixes a bug in this logic for large frames.
CRs-Fixed: 999351
Change-Id: I49ae94cea34dda039d03dbeeab2add2bdd1760bd
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Add smp2p entries to device tree to enable IPA driver
handshake with modem. This handshake is used to synchronize IPA clocks
vote with modem during apps or modem crash.
CRs-Fixed: 988881
Change-Id: Idc8ac5fc273d91035254c675c7cedefa9a92a5a5
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
MHI channel burst mode is used to reduce link activity by reducing the
frequency of host initiated doorbells and device initiated link accesses.
This change adds support for mhi burst mode in IPA MHI driver, according to
MHI v0.45 spec.
CRs-Fixed: 990856
Change-Id: Iae170042b70c6eaf5bc05ea2b4a1ccdb7dd6f946
Acked-by: Nadine Toledano <nadinet@codeaurora.org>
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
Unify IPA RM from ipa_v2 and ipa_v3 to common driver
under ipa folder
CRs-Fixed: 995821
Change-Id: I4a7d8c328af7cd5506b3fbbdc76b1bc5bb0de698
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Add a common internal header for ipa_v2 and ipa_v3.
Common definitions should go to this header.
CRs-Fixed: 995821
Change-Id: I39539cf661d9e0e0bb59236c92b169d3054485a9
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Add a library for a kernel client to register and be notified of
any state changes regarding a local or remote service which runs
on a remote processor on the SoC.
CRs-Fixed: 999530
Change-Id: Idd56140e11f4fdc48fd999a1e808f3263024f34d
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
To support Android need to set SELINUX as default security.
CRs-Fixed: 998858
Change-Id: Id6d18a67329abe5a89b4284fc5a3d1cf6a042dc4
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Allowing RPM to handshake allows RPM to switch to sleep set vote for
resources allowing the SOC to enter a lower power state.
Change-Id: I9d835cddc85c007bcc6b918b9dc4335b82b97306
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Drivers use event timer framework to programs timers with zero wakeup
latency
Change-Id: I991dfdc22936dba667110de338d0109c58e68bd5
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Some of the common irq data is moved into a irq_common_data structure
within irq_desc structure.
Change irq_data references to irq_common_data structure to fix
compilation issues.
Change-Id: I59c99348a44d364d74af6b67ccabdd2d8c5008b0
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
MPM driver is required to configure the hardware to wakeup from SoC
sleep. It is currently not enabled for cortex targets.
Enable MPM_OF config for cortex targets.
Change-Id: I09313d7809ec939a9d0440d0ab30a5992f512b96
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
MSM_PM enables sleep modes for CPU subsystem. It is not currently
enabled for msmcortex target.
Enable MSM_PM for cortex target.
Change-Id: I67244ff55690c164634e9233e2d0cec3388c5be8
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Rename vdda18-supply as core-supply with USB QMP PHY on msm8996
and msmcobalt. Also provides required voltage value with this
core ldo for msm8996.
CRs-Fixed: 1001463
Change-Id: Ia826e361d8259126a8168c07539ba4b4f6053f65
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
On newer platform USB QMP PHY needs different voltage supply as core
voltage. This change adds required support for the same.
CRs-Fixed: 1001463
Change-Id: If100d36bade241dedf28e3cea9e07be192bdfdc2
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
USB QMP PHY requires CML based refclock, otherwise USB QMP PHY
PLL may not lock. Hence select CML based refclock by programming
SYSCLK_EN_SEL register.
CRs-Fixed: 1001463
Change-Id: I4cc68a447d0cf3571a50b18d7eec5415430f9423
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Update USB3_PHY_SW_RESET register's offset on msmcobalt otherwise
USB QMP PHY is not released out of reset.
CRs-Fixed: 1001463
Change-Id: Idc71b0abb24cf8c103dfde893ba8c40d342a7fb8
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
As long as GPMU is enabled, DCVS has to handshake with firmware.
It is a new requirement of A540 power management.
CRs-Fixed: 973565
Change-Id: Ie6480fc3ba0e1b95aab40e31b09ff2bd798ff30f
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
A3XX doesn't have support for command batch profiling. Return
EOPNOTSUPP for a command batch profiling request on A3XX, so that
userspace code knows that this feature is not supported.
CRs-Fixed: 986169
Change-Id: I6dfcab462a933ef31e3bba6bef07f17016ae50b9
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Current code incorrectly specifies buffer size as 0 for mapping
gpuobj user memory. This causes the map to fail because buffer
size is expected to be a non zero value. Fix this by passing the
correct size of the buffer to be mapped.
CRs-Fixed: 995378
Change-Id: I1a9aeb3f1dd67f014847322e5b14cba8775a82a4
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
In adreno_remove() there is possibility of dereference of gpudev
without NULL check. Fix this by getting gpudev after adreno_dev
NULL check.
CRs-Fixed: 993267
Change-Id: I17d8b4ba2c74a787a065dbdb0ac88d065605fcb1
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
For user memory of type KGSL_USER_MEM_TYPE_ADDR mapped to GPU driver
verify permissions and map GPU permissions same as CPU permissions.
If elevated permissions are requested return an error to prevent
privilege escalation. Without this check user could map readonly
memory into GPU driver as readwrite and gain elevated privilege.
Write permissions check is currently inverted causing readonly
user pages to be mapped as readwrite in GPU driver. Fix this
check to map readonly pages as readonly.
CRs-Fixed: 988993
Change-Id: I0e097d7e4e4c414c0849e33bcc61a26fb94291ad
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
The kernel command buffer is not zeroed in the adreno ioctls,
and may contain garbage. The garbage value can lead to
unexpected results.
CRs-Fixed: 993518
Change-Id: I75033cdf4637881ecd6fa4dd31aea083b134e6d2
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Current order:
IB1 batch, timestamp writes, SRM=NULL, CP_YIELD_ENABLE,
CP_CONTEXT_SWITCH_YIELD
Correct order:
IB1 batch, SRM=NULL, CP_YIELD_ENABLE, timestamp writes,
CP_CONTEXT_SWITCH_YIELD
Reason:
if preemption is initiated after the last checkpoint but
before SET_RENDER_MODE == NULL is executed, all of the PM4s
starting at the preamble of the check point will be replayed
up to the SRM == NULL, including an attempt to re-timestamp/
re-retire the last batch of IBs.
If what was intended here was to make sure that the IB batch
would be retired once then the SET_RENDER_MODE == NULL and
CP_YIELD_ENABLE should be placed immediately after IB_PFE packets
and before the time stamping PM4 packets in the ring buffer.
CRs-Fixed: 990078
Change-Id: I04a1a44f12dd3a09c50b4fe39e14a2bd636b24de
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Currently, Rx an Tx is based on workqueue and it is taking significant
time to schedule a workqueue which is hampering performance.
Use tasklet if underlying transport supports atomic context, otherwise
kworker is used.
CRs-Fixed: 978296
Change-Id: I736d2b90730ec10f9dff21944c4ad50e4d87da5c
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
Lower the APM threshold voltage from 852 mV to 832 mV in agreement
with hardware guidelines. In addition, specify an APM hysteresis
voltage of 32 mV to help reduce the number of corners whose floor
voltages need to be raised to ensure stable operation with
manual APM switching.
Change-Id: Ida87a70395e8bfd1506166cfa02f5b48b1132269
CRs-Fixed: 1001346
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Adjust floor voltages based upon a configurable APM hysteresis voltage.
This reduces the number of corners whose floor voltages must be raised
to ensure stable operation with manual APM switching. In particular,
for corners with ceiling voltage greater than or equal to the APM
threshold voltage and floor voltage less than APM threshold voltage
set an adjusted floor of max(floor, APM threshold - APM hysteresis).
Change-Id: I65bebcfd8f4785bce9f65243987c05444aab14ee
CRs-Fixed: 1001346
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Increase the maximum floor to ceiling range of LowSVS and SVS
corners to 55 mV and Nominal and Turbo corners to 65 mV for
both VDD_APC0 and VDD_APC1 CPR devices. Also, increase the SVS
floor voltage to 572 mV in agreement with hardware guidelines.
Change-Id: Ida2a9ba842038ec2567344f1544e5b4f73794215
CRs-Fixed: 1001353
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Initialize the controller type before cpr3_parse_common_ctrl_data()
is called as this function performs initializations based upon
controller type.
Change-Id: I0cdcd6519338043e40acf9357f39a61ff6f43604
CRs-Fixed: 1001355
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Enable open-loop and target quotient interpolation for VDD_APC
CPR devices. Also, treat the scaled open-loop voltage as the
absolute ceiling for each corner. This ensures the CPR voltages
more closely track the silicon Vmin and prevents unnecessary
power consumption.
Change-Id: I8b1baad474a76553ac4094c09fc01b1ea0a4646a
CRs-Fixed: 1001350
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Currently, open-loop voltage interpolation is skipped for corners
mapping to the highest fused corner thus resulting in incorrect
open-loop voltages when open-loop interpolation is enabled. Fix this.
Change-Id: Iab5a2dadfec45efb08b9c45f956e9f102d2d2c55
CRs-Fixed: 1001350
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Read commands are currently assigning 64bit physical address
to 32bit token. There is a possibility that this physical address
may have same lower 32bit values which could cause errors. Fix
by assigning session id as the token value.
Change-Id: Ie704e34338201ecec191b2031d20552691aed3ea
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Use tokens to track all active no wait commands.
In ASM driver, certain commands are waited on to get response
from ADSP. There is a possibility that certain no-wait
commands can be improperly recognized and woken up leading
to time outs.
Change-Id: I2030a354493845b63cf92d35ca4eaadef38cfb79
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>