Retain the latest user brightness request. This ensures
that when a max brightness limit is altered, the last
brightness request is taken into account, when restoring
the current brightness.
Change-Id: I6461e06f64abe336cabc27a3992d734f1fb745c6
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Add store interface for max_brightness to allow users
to change the maximum brightness to be supported by
the hardware.
Change-Id: I8b65debdc52ded24227483c4db21aaec63e27927
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Zcache could be ineffective if the compressed memory pool is full with
compressed inactive file pages and most of them will be never used again.
So we pick up pages from active file list only, those pages would probably
be accessed again. Compress them in memory can reduce the latency
significantly compared with rereading from disk.
When a file page is shrunk from active file list to inactive file list,
PageActive flag is also cleared.
So adding an extra WasActive page flag for zcache to know whether the
file page was shrunk from the active list.
Change-Id: Ida1f4db17075d1f6f825ef7ce2b3bae4eb799e3f
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Patch-mainline: linux-mm @ 2013-08-06 11:36:17
[vinmenon@codeaurora.org: trivial merge conflict fixes, checkpatch fixes,
fix the definitions of was_active page flag so that it does not create
compile time errors with CONFIG_CLEANCACHE disabled. Also remove the
unnecessary use of PG_was_active in PAGE_FLAGS_CHECK_AT_PREP. Since
was_active is a requirement for zcache, make the definitions dependent on
CONFIG_ZCACHE rather than CONFIG_CLEANCACHE.]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
IRQ of CSID is enabled when MSM_SD_NOTIFY_FREEZE is called.
It must be disabled in MSM_SD_UNNOTIFY_FREEZE and also
after few IRQs we disbale the debug IRQ.
This prevents excess logs.
Crs-Fixed: 1011965
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Change-Id: I10bf7ed20e7d5d29c6e5fff0ed7a8474c96acea5
There is a possibility of deadlock while doing late
memblock configuration as only preemption is disabled and
irq can be serviced while seqlock is held and in turn
memblock_is_memory can be called from irq context thus
trying to claim seqlock again. Following call stack was
observed,
[<c02136d4>] memblock_search+0x1c
[<c021487c>] memblock_is_memory+0x10
[<c01e4684>] free_kmem_pages+0x44
[<c0121c04>] free_task+0x28
[<c0178b30>] rcu_process_callbacks+0x488
[<c0127e30>] __do_softirq+0x150
[<c0128284>] irq_exit+0x84
[<c010c11c>] handle_IPI+0x12c
[<c0100588>] gic_handle_irq+0x70
[<c0e9efc0>] __irq_svc+0x40
[<c0214a8c>] memblock_region_resize_late_end+0xc
[<c057010c>] removed_alloc+0x110
[<c04ab2c4>] pil_boot+0x2b0
[<c04b7700>] __subsystem_get+0xe0
[<c04b79cc>] subsys_device_open+0x74
[<c0229f20>] chrdev_open+0x12c
[<c02246e4>] do_dentry_open+0x280
[<c0232698>] do_last+0x9a4
[<c0232b8c>] path_openat+0x23c
[<c0233bf0>] do_filp_open+0x2c
Fix it by disabling irqs during late memblock
configuration. It is a one time operation which changes
memblock related data structures and doesn't carry
performance impact.
CRs-Fixed: 1003890
Change-Id: I3ff1894f0c80580920b1971cda357915665b5054
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
zcache stores compressed file pages which should be
considered as reclaimable pages by lowmemorykiller
in calculating values to be compared against minfree.
Change-Id: Ia3e08bc14ba61c0a45ed54ba5cd525717a572060
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
It is expected that the 64 bit ion buffer address,
will be located on the request/response buffer at an offset
that is 64 bit aligned.
However, the user may pack the request/response on his own risk,
and the offset might not be 64 bit aligned.
Change-Id: I85e7644aa05d8c5249e2d204a61d03b5fb2f9220
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Check if ION buffer is locked based on comparing the kernel ion handle,
rather than comparing the user file descriptor.
Change-Id: I7a41df3eebf22de2cc6b14327978923bcdbb7142
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
ion handles associated with a client must be destroyed
under client->lock so as to prevent race where other path
use handle while being destroyed.
One such path is when user access heap details through
debugfs.
|rb_next()
|ion_debug_heap_total(inline)
|ion_debug_heap_show()
|seq_read()
CRs-Fixed: 1000492
Change-Id: I7bc7562400df0ae08b1aa232efe00b657339fcfb
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
The mm subsystem access page structs aligned to
pageblock_nr_pages and assumes that these are valid. We
must not free any memmap entries that it may inspect.
CRs-Fixed: 1000343
Change-Id: I73e0402ee72cad8df307ece1134f9e7304125cf6
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
The cnss platform driver compilation config flags
has been changed to CONFIG_CNSS_PCI to CONFIG_CNSS.
CRs-Fixed: 988871
Change-Id: Ie245ac4ad028b543916c27b015a7ba33e55958a9
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
For dual WiFi both cnss sdio and pcie platform needs to
be enabled. Added changes below to support dual platform
driver for dual WiFi.
Refactor the common api and data structure to avoid namespace
collision compilation error. Refactor sdio and pcie bus specific
kernel api and removed conditional compilation config flag.
The platform driver at run time identifies the wlan bus type
from the PHY device pointer passed by the wlan driver through
vos api and cnss platform driver redirects the cnss api according
the bus type.
Remove conditional compilation flag from cnss common api and
update cnss makefile for dual platform driver compilation
with single config flag.
CRs-Fixed: 988871
Change-Id: I8205c2979c857c2f3845ba2dc397d2f9dd1afa3b
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
Signed-off-by: Ryan Hsu <ryanhsu@codeaurora.org>
The cnss subsystem restart and pm qos export API has been
refactor in respective platform driver according to the bus
type SDIO/PCIe.
Remove redundant and dead code from platform driver to avoid
the namespace collision compilation error. Refactor the recovery
work handler according to bus type. This feature adds support for
dual cnss platform driver support for dual WiFi.
CRs-Fixed: 987560
Change-Id: I0e1b5ff0e9970a40ad9d0619dcb7f8cbae241656
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
Add cnss sdio platform driver support to vote for bus bandwidth
as per throughput requirement from wlan driver. The cnss sdio
platform driver export bus bandwidth api for wlan host driver.
CRs-Fixed: 990173
Change-Id: Ied2e5a78487b6f6076cd19f32c959a69050e055c
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
IRQ was disabled at suspend so system was not able to
wake up during CE transaction.
Even after irq was enabled we were not able to wake up in irq handler
because wakeup event was not going due to is_suspended condition.
Change-Id: I5a088230786ef780cca0a3b767ad80e7b0c69f9e
Signed-off-by: Gaurav Singhal <gsinghal@codeaurora.org>
DSI clamps need not be configured for msmcobalt since the lanes
will be maintained in ULPS or LP11 through the DSI PHY. As such,
the only required programming is to disable the propagation of
the reset signal from the ahb domain. Update the SW programming
accordingly.
CRs-Fixed: 1019289
Change-Id: I0ba4858015457c971a42233c5a5f3dec9ca25ea6
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Add the register offset and the corresponding clocks to support
configuring DSI clamps on msmcobalt.
CRs-Fixed: 1019289
Change-Id: I4f9ed290416f95957b0f17424c624530f7a6794d
Signed-off-by: Aravind Venkateswaran <aravindh@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: I05434cb559cc397c62d888e1c54c1f209765d92f
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
Add required settings for command mode and video
mode 4k sharp panels in msmcobalt CDP. Add panels
to the list of supported panels so they can be
selected at runtime from kernel command line.
CRs-Fixed: 1019289
Change-Id: I7e289168c04221e9e272a8c0543d66af0e233450
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Round robin ADC (RRADC) driver provides an interface to enable
clients to read ADC values from the RRADC controller. The ADC
values are updated in a round robin sequence among the enabled
channels.
Clients include reading voltage, current and temperature channels
such as battery ID, battery thermistors, skin temperature,
PMI die temperature, charger temperature, USB_IN and DCIN voltage
and current.
Change-Id: I927c0f6a7db654880d951729996a27310f6628cf
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
mnoc_ahb clock should be enabled prior to enabling the mdss_ahb
clock for any register access in the DSI domain.
Change-Id: I19bd72aebd9f82596dc04fe4b3179c81ab3c162d
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
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>