With this patch, anon pages of inactive tasks can be reclaimed,
depending on memory pressure. Memory pressure is detected
using vmpressure events. 'N' best tasks in terms of anon
size is selected and pages proportional to their tasksize
is reclaimed. The total number of pages reclaimed at each
run of the swap work, can be tuned from userspace, the
default being SWAP_CLUSTER_MAX * 32.
The patch also adds tracepoints to debug and tune the
feature.
echo 1 > /sys/module/process_reclaim/parameters/enable_process_reclaim
to enable the feature.
echo <pages> > /sys/module/process_reclaim/parameters/per_swap_size,
to set the number of pages reclaimed in each scan.
/sys/module/process_reclaim/parameters/reclaim_avg_efficiency, provides
the average efficiency (scan to reclaim ratio) of the algorithm.
/sys/module/process_reclaim/parameters/swap_eff_win, to set the window
period (in unit of number of times reclaim is triggered) to detect
low efficiency runs.
/sys/module/process_reclaim/parameters/swap_opt_eff, to set the optimal
efficiency threshold for low efficiency detection.
Change-Id: I895986f10c997d1715761eaaadc4bbbee60db9d2
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
dm-req-crypt based devices are capable of supporting discard option.
DM layer by default does not enable discard option for DM devices.
Since underlying device supports discard option, mapped target should
also allow it.
Change-Id: Ia540a814c3dcd91f573d1f25d637107a48309a58
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Backend DAIs are not enabled for low-latency-record
bt-sco. Update mixer control array of MultiMedia5
mixer to enable backend DAIs.
CRs-Fixed: 1029460
Change-Id: I8e01302baf2d78afca930ef1f251906a971a8234
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
This driver handles the Inter-Processor Communication(IPC) Interrupt(IRQ)
from remote subsystems directed towards Qualcomm Technologies, Inc. Secure
Execution Environment(QSEE) and notifies the QSEE listeners waiting in
the userspace.
CRs-Fixed: 1021749
Change-Id: Id0cab5773099e2f6267f8a5bd4fd5aeb3324e68b
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
The TLMM IRQ numbers were set incorrectly. This can prevent the UART
peer devices from waking up the core from sleep.
Change-Id: I11e725ac31f78f838ac9b8e1e08c384d11ea14a6
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
GPU will vote off gcc_gpu_iref_clk when going to low power modes.
CRs-Fixed: 1024948
Change-Id: I13b7a70f1fa748f2f4cdfb485dda2f7857e0b3d2
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
It is to be ensured that venus is in power on state before scaling
clocks. When venus goes to power collapse, a resume can happen
either when driver writes some command to the command queue or any
response comes from firmware. So when client requests a particular
perf_level, venus is not resumed and scale clocks is called.
CRs-Fixed: 1000809
Change-Id: I2ac46c481065ada2b62a5eb248fbdf18f2b1a91f
Signed-off-by: Abdulla Anam <abdullahanam@codeaurora.org>
msm_comm_kill_session is called in driver only in situations where
the driver state goes bad. session_abort is called on firmware
which may be honored. But still the session_error needs to be
communicated to the client or else client will operate oblivious
about the bad video driver state.
Change-Id: Iafb90cde31a985bf5377fdcdd1a9653a965c5600
Signed-off-by: Abdulla Anam <abdullahanam@codeaurora.org>
After reclaiming vmalloc and adjusting lowmem, the two
regions are no longer contiguous. Update the messages
printed during bootup to list all regions corresponding
to low memory and vmalloc respectively.
Change-Id: Ib3e25b530b3dfbd1f9796cdc580fb79da484e850
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
The unused virtual address space in low memory is given to
vmalloc for use. This reduces the low memory space and
increases vmalloc space. Adjust the vmalloc_min in order
to increase the low memory.
Change-Id: I0dbef5b6e5ec3d19f5f93f06ed03a4cf1215dc4d
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
If KTM get a trip threshold trigger notification and if the
temperature stays the same as the recent trip threshold, KTM will
re-activate the recently triggered threshold, resulting in back to
back interrupts. To avoid this add support in KTM to maintain the
recently triggered threshold state and then re-active the threshold
based on the last threshold trip.
This state is updated for mitigation features like VDD MX retention,
CX phase control, VDD restriction, OCR monitor and external clients
like CPR low temperature monitor etc.
CRs-Fixed: 969112 972634
Change-Id: I44c0a93e1507a9f0b8a65e5c2ce5a98962bb335b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Deep nap timer value was not calculated right when read from dts file.
CRs-Fixed: 973565
Change-Id: I11a70c61d408921edd89b1417b209c5c5a3ddf24
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
The GPU clocks on msm8996 have three dedicated PLLs, MMPLL2,
MMPLL8, and MMPLL9. We leave MMPLL9 at the maximum speed (624
MHz), and we use MMPLL2 and MMPLL8 for the other frequencies. To
make switching frequencies faster, we ping-pong between MMPLL2
and MMPLL8 when we're switching between frequencies that aren't
the maximum. Implement custom rcg clk ops for this type of
frequency switching.
Change-Id: Ia71dfc9947f858b485e7c7ea254d6f52de0e7f7d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Some gdscs might be controlled via voting registers and might not
really disable when the kernel intends to disable them (due to other
votes keeping them enabled)
Mark these gdscs with a flag for we do not check/wait on a disable
status for these gdscs within the kernel disable callback.
Also at boot, if these GDSCs are found to be ON, we make sure we
vote for them before we inform the genpd framework about their
status. If genpd gets no users, it then disables (removes the vote)
them as part of genpd_poweroff_unused()
Change-Id: Idd26e1460aea84834cccac15a86adf35681e511e
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Some gdsc power domains can have a gds_hw_controller block inside
to help ensure all slave devices within the power domain are idle
before the gdsc is actually switched off.
This is mainly useful in power domains which host a MMU, in which
case its necessary to make sure there are no outstanding MMU operations
or pending bus transactions before the power domain is turned off.
In gdscs with gds_hw_controller block, its necessary to check the
gds_hw_ctrl status bits instead of the ones in gdscr, to determine
the state of the powerdomain.
While at it, also move away from using jiffies and use ktime APIs
instead for busy looping on status bits.
Change-Id: I9e435ba071a9d1aa67bddc5d2c7cd7b66fb86c58
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Add a helper function devm_add_action_or_reset() which will internally
call devm_add_action(). But if devm_add_action() fails then it will
execute the action mentioned and return the error code.
Change-Id: I70562e95e0ef672db7dc9bd9f24d9a3b356bf89c
(cherry picked from commit a3499e9bf0fe ("devm: add helper
devm_add_action_or_reset()")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
This change enables logging of irq number and name which triggered
wake up of the system from deep sleep. This helps in debugging the
spurious wakeups due to interrupts from various subsystems.
CRs-Fixed: 1033023
Change-Id: Ieeec5959475740e2b0cc75871c1f7e10e1098fa4
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
This is a snapshot of drivers/irqchip/msm_show_resume_irq.c as of
msm-3.18 commit <e17a72ad7344065> ("Merge "ARM: dts: mdm: Adjust
memory region peripheral1_mem for MDM9640"").
CRs-Fixed: 1033023
Change-Id: Ia928cf5e23eebc7a0f80638f4be81beec7ed2878
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
In RESUMING state, WM is stopped causing skip in diverted buffers.
Add drop reporting for these frames, so that modules down stream can
be notified in case of reg_update miss.
CRs-Fixed: 1012335
Change-Id: I67d700c5c844fd6be3bf6ded756fb93e0ebfb537
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Currently vidc driver is not destroying the mutexes that it
used. This can cause mutex resources leak. This changes fixes
the same.
Change-Id: I293ad3c4c5ed46c692ae066e7188efe41e5dc482
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
During non-gapless transition, there is an indefinite wait in
drain until either eos_ack or cmd_interrupt is set. This results
in playback getting stuck and occurs because cmd_interrupt is
not set in TRIGGER_STOP as gapless_transition is set to 1 during
partial drain of earlier stream.
Fix the issue by setting gapless_transition to 0 when gapless
fails which ensures that cmd_interrupt is set in TRIGGER_STOP.
CRs-Fixed: 1027991
Change-Id: I47d2d45df8686f25e8170a84fcaf68e143f6e4f6
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Temperature sensor 13 tracks the GPU temperature closely. Update the
sensor alias for gpu to point to tsens 13 in MSMCobalt.
CRs-Fixed: 1034178
Change-Id: I8a644440eca0bc8996e777b76670f2aead601732
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
add HDMI node for 8996 mtp to enable audio over HDMI.
CRs-Fixed: 1028336
Change-Id: I1aade4b197b1705ac116db66168f73253b6ea04d
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE).
CRs-Fixed: 1011048
Change-Id: I5c49091d6bbff98ed8665446fffdba08446073cd
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Changes to support packed 24 bit (SNDRV_PCM_FORMAT_S24_3LE).
CRs-Fixed: 1011048
Change-Id: If81f3053629dc4f80a08392f392c7be735ad33c2
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Driver changes to use ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 command.
This command supports playback/record of both 32 bit
(24 bit data in 32 bit word) and 24 bit packed. Update platform
drivers to use this for SNDRV_PCM_FORMAT_S24_LE record and playback.
CRs-Fixed: 1011048
Change-Id: I6f98bf3402a737bc21daff33b13b137850a690ea
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
IPA Endpoint 16 is the one assigned to APPS for WAN data.
This pipe is connected when modem is up. Kernel-tests
framework should not use it for testing purposes as this
pipe is already allocated for APPS. Update the code
to use another IPA Endpoint.
Change-Id: Ia0ed2ad9041353def1b3055d394281bca2893f88
CRs-fixed: 1034319
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
Set LAB's precharge time to max 500us to optimize the precharge
behavior.
CRs-Fixed: 1028321
Change-Id: I13eaca8f50080457b95f4c88f9987df6ba0f05c5
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Change the threshold for resubmitting RX buffers to IPA in case
of allocation errors to a bigger number than 0.
In some corner cases a packet from IPA to AP might be larger than
the side of 1 buffer, which can result in IPA stall if threshold
is 0.
CRs-Fixed: 1027726
Change-Id: Ic841de25597c2cd4ce007823f9b9727e858a73cb
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Currently arm_dma_remap returns the offset value when it fails
because of reasons like unavailability of vmalloc space. This
is wrong as the caller expects NULL on failure, and can result
in kernel panic on dereferencing the returned pointer.
Change-Id: Ic851efecd1b5ff1c5e3105f28f392307857e63e3
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
In the event that the cpu needs to be rescheduled for another task
before it enters psci sleep, the stats and trace exit events are
considered without the enter events. Fix this issue by moving enter
events before the cpu gets scheduled.
Change-Id: I8e477c434d218960b48aab4e61cacf99476b607f
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
The %pK restrictions are used to eliminate exposing kernel addresses.
When kptr_restrict is set to "0" there are no restrictions. When
kptr_restrict is set to "1", kernel pointers printed using the %pK
format specifier will be replaced with 0's unless the user has
CAP_SYSLOG. When kptr_restrict is set to "2", kernel pointers printed
using %pK will be replaced with 0's regardless of privileges.
Change-Id: Iacd8f7b7cdafed3a111507d3da899be9261ff09f
Signed-off-by: Dibyendu Roy <dibyen@codeaurora.org>
Watchdog interrupts bark and snarl get triggered frequently, causing
flood messages when enabled in debug_mask. However, neither irq is
essentially being used in charger driver.
Remove both interrupts by setting their irq handlers to NULL, and
skipping irq registration in case of NULL handlers.
CRs-Fixed: 1033724
Change-Id: I9414f3238d1568ec29973a7ec74054c779a7a196
Signed-off-by: Harry Yang <harryy@codeaurora.org>
A recent change to regulator framework replaced the
regulator_set_optimum_mode API with regulator_set_load.
The regulator_set_load API does the following for regulators which have
not implemented set_load().
- determines the most optimal mode for the given load by calling
get_optimum_mode()
- gets the current mode by calling get_mode()
- calls set_mode() if the modes are different and expects the mode to be
committed to the hardware
The rpm-smd-regulator's get_optimum_mode() remembers the load and uses that
for the upcoming get_mode() call. This causes the framework to never call
the set_mode API, thereby causing rpm-smd-regulator to never send the load
to the RPM.
The set_load op was introduced for hardware which does not support the
set_mode op. This is convenient since the RPM sets the mode according to
the aggregated load requirements. In addition the RPM also supports forcing
certain modes which fits well with the set_mode op.
Implement the set_load op to send the aggregated load vote to RPM, and
repurpose the set_mode op to send the aggregated mode vote to RPM.
Remove the get_optimum_mode op since it is no longer required with this
change.
Repurposing of set_mode should not impact consumers since it has the same
effect as before. Instead of sending a load vote which would cause the RPM
to select the desired mode the mode will be sent directly.
Furthermore, the hpm-min-load device tree property is no longer required
since the mode is no longer set based on the hpm-min-load threshold.
Remove it.
Change-Id: I75cf0b4cfc7a6aec3e6d79da9172ce37ec9d91c1
CRs-Fixed: 1023326
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
RPM stat/logs provide stats about system sleep modes.
Change-Id: I10dc1bdb2fcfe216cdcf147eab936c2f92b5217a
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
RPM stat/logs provide stats about system sleep modes.
Change-Id: Idf7b30586d5e3c34929b348628f90e5d88f2a9ff
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
When cluster enters a low power mode, the mode entered is stored
in last_level. During LPM driver probe last_level is initialized
to default level, if a core in that cluster is online.
If all the cores in the cluster are hotplugged after initializing
the last_level and before the per cluster data structures are
initialized, cluster enters low power mode but does not update
last_level as the data structures are not available. In this case
when a core in this cluster is coming online and last_level indicates
default level, assumes cluster did not enter any low power mode,
the update of flags to reflect the cores as active for this cluster
does not happen. This makes driver to select system level low power
mode as if this cluster is in low power mode eventhough it is out
of low power mode.
To avoid this race, prevent cores hotplug during lpm probe.
Change-Id: I1d0c51c52e54ab30239b2fca11040f134315fe61
Signed-off-by: Anil Kumar Mamidala <amami@codeaurora.org>
V4l2 control framework mandates a qmenu entry for each control item.
Validate_new() function accesses the qmenu entry for control item,
and any missing qmenu entries causes a crash within this function.
This patch fixes those crashes.
CRs-Fixed: 1031156
Change-Id: Ie507b1de9ce08221678a730146164d6e970aac8a
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Return errors from the flush function including
the caller of the flush ioctl.
CRs-fixed: 1027784
Change-Id: I7ec578b42f50b6ce2f2738193c622c8a2f01ecd8
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
With single voice architecture, two new VSIDs are created to
support multimode voice call. Update host pcm driver to support
new VSIDs.
Change-Id: I42e33db7f3dca47c30b7dc5af59848eb6beef330
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
Create sysfs entry to control GPU clock throttling. When 0 is
written - all sources of clock throlling - ie LM, BCL, IDLE
are disabled.
CRs-Fixed: 973565
Change-Id: Iad588eb94861bd6b223715cc05354e3c39db9b24
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
Add option to select whether a fresh calibration
needs to be performed when performing the channel measurement.
If the property is not present the default value of
using calibration measurement collected from a timer
will be used. For most cases using a measurement collected
from a timer interval should suffice and the default value
can be used.
Change-Id: I632a9466f04d5d0712de436fc3e1251f7e2e7ad2
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
A new MDP LUT clock is added to msmcobalt, add code to set
the corresponding mdss_mdp_lut_cbcr register to support MDP
memory retention on msmcobalt.
Change-Id: Icf0890a6f2d3c44e426bd834b3c7943cc6766bae
Signed-off-by: Ping Li <pingli@codeaurora.org>
A new clock mdss_mdp_lut_clk has been added to mdss on msmcobalt,
this change adds this clock to the list of clocks for mdss mdp.
Change-Id: I94d0965c5e431613e37e2369d0f0572e083d0acd
Signed-off-by: Ping Li <pingli@codeaurora.org>
The OSM driver need not execute the Agera PLL setup sequences
now that the bootloaders are handling such requirement. Thus,
remove the qcom,osm-pll-setup flag from the OSM device node.
CRs-Fixed: 1033726
Change-Id: Icffa6b8e29c1a13c08c11980b9bfd70b25efd56c
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Remove voting on PLL regualtor for modem pil since it is not
required for MSMCOBALT. We already vote on XO.
CRs-Fixed: 1025447
Change-Id: I9f478194a1a6147a8312e232c6ca3fd1eeb01682
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Since 'qcom,vdd_pll' is optional property, change the flow so that pil
doesn't return if it is not present.
CRs-Fixed: 1025447
Change-Id: I530bbeb89f769afb188f28bcdc0230d32feed3dd
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Update msm gpio 89 pin control settings to pull down
in suspend to save power.
Change-Id: Ibd46ae4d6bebd40637a78a551984b4c16a693d79
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>