It is pointless to calculate the swap ratio when there is only
one swap device in the group. Moreover the existing code would
result in a spinlock recursion because of not taking this into
consideration. Interestingly, this check is already performed
in swap_ratio_slow by this piece of code
if (&(*si)->avail_list == plist_last(&swap_avail_head)) {
/* just to make skip work */
n = *si;
ret = -ENODEV;
goto skip;
}
But there is window where we drop the swap_avail_lock before
invoking swap_ratio() and take it back again in swap_ratio_slow.
In this period the si can get removed from swap_avail_head,
resulting in the failure of above logic. So recheck again.
Similarly, bail out from swap_ratio() if the sysctl is disabled,
and thus avoiding overhead of taking unnecessary locks.
Change-Id: I81a9dd61d24b7da55d5341c48a1f71d2b4b1978d
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
It is observed that sometimes multiple tasks get blocked in
the congestion_wait loop below, in shrink_inactive_list.
(__schedule) from [<c0a03328>]
(schedule_timeout) from [<c0a04940>]
(io_schedule_timeout) from [<c01d585c>]
(congestion_wait) from [<c01cc9d8>]
(shrink_inactive_list) from [<c01cd034>]
(shrink_zone) from [<c01cdd08>]
(try_to_free_pages) from [<c01c442c>]
(__alloc_pages_nodemask) from [<c01f1884>]
(new_slab) from [<c09fcf60>]
(__slab_alloc) from [<c01f1a6c>]
In one such instance, zone_page_state(zone, NR_ISOLATED_FILE)
had returned 14, zone_page_state(zone, NR_INACTIVE_FILE)
returned 92, and the gfp_flag was GFP_KERNEL which resulted
in too_many_isolated to return true. But one of the CPU pageset
vmstat diff had NR_ISOLATED_FILE as -14. As there weren't any more
update to per cpu pageset, the threshold wasn't met, and the
tasks were blocked in the congestion wait.
This patch uses zone_page_state_snapshot instead, but restricts
its usage to avoid performance penalty.
Change-Id: Iec767a548e524729c7ed79a92fe4718cdd08ce69
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
The Secure Processor Subsystem (SPSS) shall use its own ION heap
for allocation of memory shared between HLOS Applications
and SPSS Applications.
Change-Id: I4345d14dc22ddbdc34ff98b7b16719ba760951df
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Disable unnecessary options like KSM, ATA, VIRTUALIZATION etc.,
and enable options like IRQ_TIME_ACCOUNTING, CGROUPS, ZRAM etc.,
to match with msm_defconfig.
CRs-Fixed: 1021169
Change-Id: I11143ca9beae526c80c8b94a81c2369a7c489d11
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
MMMS mnoc_ahb clock needs to be enabled prior to enabling the mdss_ahb
clock on msmcobalt as there is a core fsm dependency between these
clocks.
Change-Id: I475b44619b68e731abc8b1a91a214c6cdf8cfc5e
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
This module provides support to userspace entity for hotplugging
and setting cpufreq policy min/max limits. It can also detect
cpu/io workload and notify userspace via sysfs nodes.
A userspace entity can specify a CPU mask and the number of CPUs
it wants online within that mask and this module will try to make
a best effort to keep those many CPUs online. Userspace can also
specify the min and max limits on CPUs instead of writing to the
scaling_min/max nodes from sysfs so that if any CPU is offline
this module maintains a vote for it which is applied
once the CPU comes back online.
A userspace entity can also set threshold value in sysfs nodes of
this module for cpu/io workload detection and this module can notify
userspace entity when that crietia is met via sysfs nodes.
Change-Id: I2c92b689ae49af85489dbf9a6aef196f4f6abf4b
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Add support for SMMU fast path configuration to allow
efficient buffer DMA mapping/unmapping.
CRs-Fixed: 1014404
Change-Id: Iaaa373db29d8b53e93ae1d3bf455ee066ed90dfd
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Enable the QPNP temperature alarm driver so that software can
monitor the PMIC die temperature of the PMICs found on MSMCOBALT
boards.
Change-Id: I5c9e0bcb5bb7646a720c32af0b15ca5fa2e36b8f
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add a temperature alarm device for the PM8005 PMIC in order to
monitor the PMIC die temperature.
Change-Id: If0a02f211243a6c8f9c771f20590c0251726425b
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add an array of unsigned integers representing addresses and sizes which
are used by the IPA driver to access IPA RAM.
Signed-off-by: Gilad Landau <glandau@codeaurora.org>
Change-Id: I02b72e8c16416ea08b143609e9b16196fb3a2879
Add dummy Coresight source driver. This driver can be used for devices
that are controlled by other subsystems but rely on Linux drivers to
configure rest of the trace path.
Change-Id: I7b68202fc6d7958fcf7ff933d7eed7e19c958ab0
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Add a temperature alarm device for the PMICOBALT PMIC in order
to monitor the PMIC die temperature.
Change-Id: I494af44d5107603b94fb06a282246c091ebd429f
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add a temperature alarm device for the PMCOBALT PMIC in order
to monitor the PMIC die temperature.
Change-Id: Ifaf2980cfc38083f450fa383d9c91777d2297415
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for the TEMP_ALARM GEN2 PMIC peripheral subtype. The
GEN2 subtype adds clock rate control and defines an over
temperature state with hysteresis instead of stage in the status
register. There are two GEN2 states corresponding to stages 1
and 2.
Change-Id: Ic4ad048259eb3a356333e0529d52f39c39fc915f
CRs-Fixed: 1019272
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add module parameter oob_mode. Takes effect the next time
the interface is brought up and FW is loaded. Puts the FW
in special "out of the box" (OOB) mode which is used for
diagnostics and certification.
Change-Id: I561e4ab26c8ac74d6fbcf19492b01751033b64d9
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 1f1a361abf73edfb94ca010c51587de378bc7c68
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
Signed-off-by: Maya Erez <merez@codeaurora.org>
When starting a PCP, pass the is_go flag to firmware in
wmi_pcp_start. This flag indicates whether we started
a PCP which is also a GO(P2P group owner) or just a regular
PCP.
Change-Id: I619abba9ef6e6fda3ea5fecd5ee87652b8ef37a5
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: b4944f2c081ea0e2fa7bc8bb510e1e6e5667f30b
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
Signed-off-by: Maya Erez <merez@codeaurora.org>
When FW crashed with no_fw_recovery mode enabled, user space
could still call wil_cfg80211_change_iface quickly to change
interface type, and this would cause recovery to proceed and
FW crash logs may be lost.
Fix this problem by not resetting the FW in case no_fw_recovery
is enabled.
Change-Id: I139a5e846555e30666f96675400c6db6e1999e05
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
git-commit: 375a173fc1524eb569c7e8f9cf331126a9d29033
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
Signed-off-by: Maya Erez <merez@codeaurora.org>
Fix a debug message related to IOCTL that was incorrectly logged
with the MISC category, and move it inside wil_ioctl so it will
always be logged even if we call wil_ioctl from other places.
Change-Id: I3cf69b18f195e5db01a1f5832013342c9f481286
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 6777e71ca91ea488488362a919900488e0ade3f2
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
[merez@codeaurora.org: fixed conflict due to android private ioctl]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Fix 2 race conditions found during test runs of P2P discovery:
1. Because wil_p2p_cancel_listen was not protected, user space
could start a new P2P listen/search before wmi_stop_discovery
completed. This caused a crash in the firmware.
2. In P2P listen, when listen timer expires and user space calls
cancel_remain_on_channel at the same time, code could send the
cfg80211_remain_on_channel_expired notification twice.
Added protections with wil->mutex to several places that call
wmi_stop_discovery.
Change-Id: I692113c222f278d6c4d4c282b4df0e28b0933556
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 280ab987ef21d1c196acb3af4663a99f94d9da00
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
Signed-off-by: Maya Erez <merez@codeaurora.org>
Added support for the P2P_DEVICE virtual interface. This interface
is intended for P2P management operations such as discovery and
GO negotiation. Normally it is implemented by drivers to allow
a separate interface for P2P management with its own MAC address,
but for 11ad drivers it is needed to support P2P search, since it
cannot otherwise be separated from normal scan.
Since we only support a single interface/MAC address, we can't
easily separate between primary and P2P_DEVICE interfaces.
For example when a management packet arrives we can't tell for
which interface it is intended. To work around this, we store
a pointer to the interface where the last "radio operation" was
triggered such as scan or remain on channel, and we forward
management packets and scan results to this interface.
Change-Id: Ief04b007c0507f9240d8f0b02b98fe7712213a0e
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 4332cac17b5c0cb80d8b99fda33a0faad3238b0e
Git-repo: https://github.com/kvalo/ath.git
CRs-Fixed: 982931
[merez@codeaurora.org: conflict in wil_cfg80211_add_iface definition]
Signed-off-by: Maya Erez <merez@codeaurora.org>
This change provides the below updates:
- Current DP PLL driver uses the pll_base and the base
address for the TXn registers instead of phy_base address.
Fix this by using the correct base address.
- Disable handoff for vco_divided_clk
by implementing handoff function for this clock.
- Update the PLL settings to fix PLL locking issues.
CRs-Fixed: 1009740
Change-Id: Iea46c5b0482bceb841309175ede42ec3be3e20fd
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
The DP link clock path in the DSI PLL has a mux clock (dp_link_2x_clk_mux)
which allows the pixel clock to be either sourced out two divider clocks.
In the current code, the ops for this mux clock is overloaded
incorrectly which results in the link clock being always sourced
out of the first divider clock. Fix this by using
the default mux clock ops for this clock.
CRs-Fixed: 1009740
Change-Id: Ie12d5ab272dbd79fe97225864c2360fdde7325a7
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
The video subcore RCGs should be force enabled during rate
scaling to workaround video firmware potentially disabling
the branch clock at the same time on MSMCOBALT.
CRs-Fixed: 1020896
Change-Id: I45a119591efc36fa05ee7009d938e596b015e70c
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Make sure that the RCG parents are turned on before force enabling
it and changing its configuration.
CRs-Fixed: 1020896
Change-Id: Ia633c4dcbab62fc6a4407c5896e36a7bbef48579
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
update config options for msm_defconfig to match with options on 3.18.
CRs-Fixed: 1020931
Change-Id: I3223c1f335e2f0e2b2401a5cd4b961fd5279ac8d
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Enable the LMH hardware and the LMH interface driver for msm8996.
LMH hardware driver interacts with the LMH hardware and
uses the interface driver to register with thermal core.
CRs-Fixed: 1019086
Change-Id: I2d1ed8aa618c4ba8780f55fcc47add10edea3ba9
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Enable kernel thermal driver for msm8996.
kernel thermal driver can monitor, mitigate and
provide interface to thermal-engine to mitigate.
CRs-Fixed: 1019086
Change-Id: Ifb47f300c4e73f7816f96c061ac5c1829bcd5491
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Newer I2C slaves have 3bytes read address.
Add support to read the data from slaves that
support 3 byte address.
CRs-Fixed: 1013787
Change-Id: Ieb0a7aa1b1b5f23220854092dcc2119d29c57146
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Following stack trace was seen while doing a data transfer
Unable to handle kernel paging request at virtual address
6b6b6b6b6b6b6ef3
pgd = ffffffc01c7c5000 [6b6b6b6b6b6b6ef3] *pgd=0000000000000000,
*pud=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Call trace:
[<ffffffc000f669ac>] rmnet_map_command+0x19c/0x238
[<ffffffc000f6504c>] _rmnet_map_ingress_handler+0x3c/0x264
[<ffffffc000f65500>] rmnet_ingress_handler+0x1b4/0x3a4
[<ffffffc000f65704>] rmnet_rx_handler+0x14/0x2c
[<ffffffc000d8b5ac>] __netif_receive_skb_core+0x514/0x71c
[<ffffffc000d8c270>] __netif_receive_skb+0x30/0x98
[<ffffffc000d8d3bc>] process_backlog+0xb0/0x184
[<ffffffc000d8d1f8>] net_rx_action+0xfc/0x210
[<ffffffc00016a2e0>] __do_softirq+0x1c0/0x39c
[<ffffffc00016a824>] irq_exit+0x88/0xf4
[<ffffffc0001565e8>] handle_IPI+0x340/0x4b4
[<ffffffc0001455e8>] gic_handle_irq+0xc4/0xec
This is because an invalid MAP command was received and was freed
and rmnet_data was trying to send the freed skb as an ACK. Fix this
by returning if an invalid MAP command is detected.
CRs-Fixed: 1019188
Change-Id: Ib52e6551ac67215dab2bc5770ddcf037568f8b77
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Fix wrong calculation for the amortized prefill
parameters to use destination coordiates as well
as adjust ts_count denominators for the correct
units, also make sure vsync clock is enabled.
It was causing problem when feature was enabled.
Change-Id: I62a3bd31997be05181de98307089e2a69d98ab7b
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Use u64 variables to store intermediate results while calculating
mdp clock for qseed3 scaling scenarios, using u32, results in overflow
and incorrect mdp clock setting.
Change-Id: I4fbc9aa1f30d36d35a9ad181185761e697cbbef7
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Add mdss_rotator node with smmu subnodes.
Change mdss_mdp to interrupt controller so rotator can receive interrupt
routed by mdp handler.
Also, reserve control 4 and writeback 0/1 and their associated mixers
for v4l2 rotator driver.
CRs-Fixed: 1017182
Change-Id: I32f312f11fcbebbff0799120448d6e8f0d9ec98d
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
Fix register offsets for top, ctl_path, qseed3 in reg-dumps for
capture of these registers in ram dump.
Change-Id: I312444176373f73f02aa0ceddf5e114a39702641
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Adding support in mdss and pll drivers for such hardwares where
mdss part is not functional.
CRs-Fixed: 993024
Change-Id: I32b0e57c8e958b7e5f1d647e37e46fda052b3d1e
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Related threads in a group could execute on different CPUs and hence
present a split-demand picture to cpufreq governor. IOW the governor
fails to see the net cpu demand of all related threads in a given
window if the threads's execution were to be split across CPUs. That
could result in sub-optimal frequency chosen in comparison to the
ideal frequency at which the aggregate work (taken up by related
threads) needs to be run.
This patch aggregates cpu execution stats in a window for all related
threads in a group. This helps present cpu busy time to governor as if
all related threads were part of the same thread and thus help select
the right frequency required by related threads. This aggregation
is done per-cluster.
Change-Id: I71e6047620066323721c6d542034ddd4b2950e7f
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[joonwoop@codeaurora.org: Fixed notify_migration() to hold rcu read
lock as this version of Linux doesn't hold p->pi_lock when the
function gets called while keeping use of rcu_access_pointer() since
we never dereference return value.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
The USB power_supply now allows PROP_TYPE to be modified. Update it
to 'USB_PD' only after PD communication has been established. This
can happen only in a couple places:
- in sink mode, when a source capabilities message is received
- in source mode, when GoodCRC is received after sending the
source capabilities message successfully
Since PD_ACTIVE=1 is required to be set, also update it in source
mode prior to sending out the capabilities, and clear it if all the
attempts fail. Remove the unreachable/dead code found there as well.
Change-Id: I77c5875ee8514395a82fac0109b7cff1d507250b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
The POWER_SUPPLY_PROP_PD_ACTIVE property is intended to be a flag
set whenever the PD PHY is in use. But this includes attempts to
establish communication, which may involve trying to perform a hard
reset to see if the port partner responds. Thus updating the
psy_desc.type field to 'USB_PD' right when PD_ACTIVE=1 is premature
as the port partner may not be PD-capable and it could be un-set.
Instead allow the PD driver to directly update POWER_SUPPLY_PROP_TYPE
only after it is sure PD communication has succeeded.
Change-Id: Iae6804bcb3121e0852ec5d14d0939623b97a6e67
Signed-off-by: Jack Pham <jackp@codeaurora.org>
API retrieves the IRQ number for the CE ID passed.
Change-Id: I87cca1215134e6d406f60d54f6d0430978eeae9c
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
If we add the mem entry pointer in the process mem_idr too early
other threads can do operations on the entry by guessing the ID
or GPU address before the object gets returned by the creating
operation.
Allocate an ID for the object but don't assign the pointer until
right before the creating function returns ensuring that another
operation can't access it until it is ready.
CRs-Fixed: 1002974
Change-Id: Ic0dedbadc0dd2125bd2a7bcc152972c0555e07f8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Existing rotator block is serviced by fbdev rotator driver.
This change enables usermode to use external v4l2 rotator driver by
exporting rotator interrupts (WB0 & WB1) thru interrupt domain,
and share smmu access for writeback and rotator.
mdp_irq_export is only set if has_separate_rotator is specified
in device tree and MDSS version is prior to 2.0.
mdp_irq_export is set to zero otherwise, and will effectively
disable mdp irq export and will introduce only minimal overhead
to interrupt processing. This is the default behaviour for
MDSS newer than 2.0.
CRs-Fixed: 1017182
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
Change-Id: If634894768b02d124ceab071a9eca1c36f258600
Currently, while setting the voltage on LAB and IBB regulators,
slew rate is always calculated based on the difference between
user specified minimum voltage(min_uV) and the minimum voltage
(min_volt) that can be supported on the regulator based on the
mode it is operating.
However, it should be really calculated based upon the difference
between current voltage and new voltage which will be set. Fix
it. Also, add the missing return -EINVAL to set_voltage of LAB
regulator if min_uV is less than min_volt.
While at it, remove the redundant function name added to the
pr_err() statements in set_voltage callbacks.
CRs-Fixed: 1013913
Change-Id: I9a17c83d6613ff37cede4a7bb52612465e4d0101
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This support is needed to enable GSO (Generic Segmentation
Offload) on msmcobalt.
Change-Id: Id9949bef91835318a7b344753983eea0aeab7bdc
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Update IPA node to not not use IPA channel 20 due to hardware limitation.
Change-Id: Id849055526bf70e0cc8161239b4530a7fc575744
CRs-Fixed: 1005061
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Fix a bug in IPA ODU where debugfs directory was deleted after
creation.
CRs-Fixed: 1015545
Change-Id: I5aad7032f3f8048216a41765f1cf91fde98f6ade
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
This change in a software workaround for a hardware limitation
to not use GSI channel 20.
CRs-Fixed: 1005061
Change-Id: I4ed9f1c6ad089f80dcd19762fda151ce1572f471
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>