The Contiguous Memory Allocator is a set of helper functions for DMA
mapping framework that improves allocations of contiguous memory chunks.
CMA grabs memory on system boot, marks it with MIGRATE_CMA migrate type
and gives back to the system. Kernel is allowed to allocate only movable
pages within CMA's managed memory so that it can be used for example for
page cache when DMA mapping do not use it. On
dma_alloc_from_contiguous() request such pages are migrated out of CMA
area to free required contiguous block and fulfill the request. This
allows to allocate large contiguous chunks of memory at any time
assuming that there is enough free memory available in the system.
This code is heavily based on earlier works by Michal Nazarewicz.
Change-Id: I8a04c58b0d39ee7343ac0b58b6dad9d57912c91d
[lauraa: fixed Kconfig conflict]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
alloc_contig_range() performs memory allocation so it also should keep
track on keeping the correct level of memory watermarks. This commit adds
a call to *_slowpath style reclaim to grab enough pages to make sure that
the final collection of contiguous pages from freelists will not starve
the system.
Change-Id: I2d68d9ac2cfcd32ca6f515fc7e44e8d9d850dff1
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
After regulator_get call for HDMI PLL footswitch purpose, set
output voltage to 1.8 V to ensure proper state while enabling and
disabling regulator.
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ifdd0cdbf614524b53038074b943cca65b71bbd24
If due to timing issues out of our control, an outbound ATT Indicate
is delayed to the point that user space code does not receive
confirmation within it time-out period, both Client and Server
sockets must be torn down. We also must always respond to incoming
ATT Indicate pkt with a Confirmation, as the Error Response is an
illegal response for Indicate.
CRs-Fixed: 363355
Change-Id: I4003a59e1a731a08818f18d5b79db537e2aa2619
Signed-off-by: Brian Gix <bgix@codeaurora.org>
Performance issue is observed with 60fps content as the vcodec clock
set based on number of macroblocks and framerate is not sufficient.
This fix checks for the framerate and sets max performance level if
fps is more than 60 (59 to be more precise)
Change-Id: I5d41643a32ec895565406fadec04dc95e04655a4
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>
Pass the correct mipi_dsi device pointer to the regulator_get()
calls based on whether the target is 7x27A EVB or 8x25 EVB.
Change-Id: If1d7432a733dd54dc6273b91cfea2e6949493ee0
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Add TLB flush for each submit to prevent target freeze
in case of 8x25/7x27a/7x25a targets.
Change-Id: I350e72e4f71fef86c7cf9da0954ef65d5765b88f
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
If the PCIE feature is disabled in hardware, then the software
should not turn on the associated regulators and clocks. Do not
add PCIE platform device if PCIE efuse status bit is set(disabled).
Change-Id: I1b07129e43888e1e4fd3c20d794e275e713c18ef
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
Currently, qseecom user-space library does not have a way to
verify if a particular secure application is loaded in the
qsee or not. This new ioctl solves this issue.
Change-Id: Ia96459f3b8aadee2f6a3af564bb1cc83695759b5
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
WCD9304 supports 4 gain values for Earpiece PA. Only 2 of them are
exposed through the mixer control. Fix to add ability to program
all of the available gain levels
Change-Id: Ie768dc3aebb476ac47dd739654703f7e3cccfd5a
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
If mbhc polling is active, enable mbhc path to avoid polling noise.
CRs-fixed: 347090
Change-Id: I3d9d1d6ec64620e24244091d735ef71c605c64fd
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
If the pcm clock is not handed off via clock handoff the rate of
pcm is set to 0. In this case, clk_set_rate() of zero would not
program the hardware to select the external input. Therefore set
the rate of the clock to some large initial value so that
clk_set_rate(0) will work properly.
Change-Id: I2555cf2bd1984e8ede5a2b537a3a7dd60034fcf5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
On some targets, bootloaders may configure the SD
card detect GPIO as pull-down. Explicitly enable
pull-up for so we can detect card insertion and
removal.
CRs-Fixed: 371313
Change-Id: I98be563858df163e970dc26b37eb394977522772
Signed-off-by: Oluwafemi Adeyemi <aadeyemi@codeaurora.org>
Currently, the Root Port class code is fixed in header fixup stage.
This is causing the PCIE framework to throw an error message.
Move fixing the Root Port class code to early fixup stage.
Change-Id: Ie37ed555e9602d8441961c44b48e69f8b9daf6e5
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
Only modify the PPSS_PAUSE register if the apps processor controls
the DSPS power state. The Linux kernel shouldn't modify the register
if the DSPS is in control of its own power state.
Also move the definition of the PPSS_PAUSE_REG address to the devices
file, since it may be different on different platforms.
Change-Id: I58d108515806085357c66a5165ba71bb930302fa
CRs-Fixed: 370236
Acked-by: John Larkin <jlarkin@qualcomm.com>
Signed-off-by: Karthik Karuppasamy <kkaruppa@codeaurora.org>
Move MSM IDs incorrectly added for 7127A and 7125A
to 7127AA and 7125AB respectively.
Change-Id: Ifd8cd65bd7c40505068b16e7ca0ed316fb8888ee
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
In WHCK loopback test, data transfer stall is observed on DL
where A2 could not send data to USB due to hardware buffer.
Currently the pipe event threshold of A2 BAM is 16 bytes. So
A2 BAM will notify USB BAM almost as soon as it has any new
data. But the pipe event threshold of USB BAM was 512 bytes.
Change the usb bam pipe threshold to 16 bytes, so USB BAM
can tell A2 BAM as soon as USB BAM consumes a descriptor with
even small data trunk.
Change-Id: I2703b8fab4260d5da5366d0a0d9b5a309d11a7a4
CRs-Fixed: 374584
Acked-by: Amit Blay <ablay@codeaurora.org>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Upgrade perf periodic to use the v3.4 perfevents API.
Change-Id: I822300e0efe405353db2d8526bb61110c0697f1f
Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
Adding new usb_core_id property which is used to match an instance
of struct usb_gadget to an instance of struct usb_gadget_driver.
This will allow constructing more then one usb periheral stack.
This new property is optional and if not specified in both the gadget
and gadget driver then it will have the default value of zero.
Change-Id: Idbab46ed76267ab4827319f2f9efe67c91b50dbd
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
PM8941_S2 is the parent of PM8941_L12, which supplies the HFPLLs.
Because the rpm_regulator_*() APIs do not manage this relationship,
it is necessary to enable both from acpuclock when the HFPLLs are
needed.
Change-Id: I1f60934f1cdfc7acfdf3dec5a793754896c8d33f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
New voltage corner enums have been introduced in the RPM regulator
driver for msm8974's vdd_dig rail. Update acpuclock accordingly.
Change-Id: Id4d316b25cdc61d7a0ee330f6423f242881fca0b
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Bandwidth requests were created to hit Apps Fabrics nominal and
SVS voltages. They need to be updated to also hit the right
values for the MM Fabric. This will allow the default power
level to be at nominal voltage rather than turbo voltage.
CRs-Fixed: 374734
Change-Id: I80cebd64bf62d8a40d95242f5c187dd902bb0f6a
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Switch control of most PMIC PM8941 and PM8841 regulators from
direct native control via qpnp-regulator to indirect RPM control
via rpm-regulator-smd for MSM8974.
Also select MSM_RPM_REGULATOR_SMD for MSM8974 in the MSM8974
Kconfig file. This is necessary because acpuclock-krait requires
that either CONFIG_MSM_RPM_REGULATOR_SMD not be defined or that
it be defined and that the rpm-regulator-smd devices are
available. This requires that the switch from qpnp-regulator to
rpm-regulator-smd devices happen at the same time as
CONFIG_MSM_RPM_REGULATOR_SMD is defined.
Add more supply bindings in msm8974.dtsi so that the
acpuclock-krait driver may be able to successfully call
rpm_regulator_get().
Specify a qcom,consumer-supplies binding in the pm8841_s2_corner
device node for clock-8974.
Modify the voltage ranges for PM8841 SMPS 1 and SMPS 2. The
ranges when using qpnp-regulator control were:
S1 - 900000 to 1150000 uV
S2 - 900000 to 1150000 uV
Change these ranges to:
S1 - 675000 to 1050000 uV
S2 - 500000 to 1050000 uV
When using RPM control, it is safe to allow requests all the way
down to retention voltage levels. The max_uV change is a
correction. 1.15 V is not a supported voltage for S1 or S2.
Change-Id: I6dee530ebc20466ec740cbb07773d13912b7a728
Signed-off-by: David Collins <collinsd@codeaurora.org>
When ANC is enabled it's needed to enable mbhc's micbias to avoid mbhc
polling noise.
Change-Id: Ib9ddf28800c7c2d993089fecb20371f3d3444a52
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Section mismatch shouldn't be enabled in any production builds
because it sets single use functions to be no-inline. Disable
this option. We still get section mismatch analysis, just not as
fine grained.
Change-Id: I8fc96cf8876d11a61ad067e1b75b81be307969e1
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Currently, if a client tries to load a secure app
in QSEE and another client tries to send a message to
another secure app, it results in a crash. Instead
of using 2 different mutex's - one for sending
messages and another for rest of the operations, now
only one mutex is used for all operations.
Change-Id: I8e1ad9ddf84cca602c6159a6f50b1abaff427b7c
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
Currently the code does not have a mechanism to remember the soc
reported just before shutting down and upon restarting the new
soc reported is off from the previous soc value reported.
This change introduces
- a method to save soc in an unused coincell back register: ssbi address
0x107 is not used on 8921 and serves the purpose of storing the soc.
The driver reads this value and uses it to scale the reported soc.
- a method to detect that a battery was removed and perhaps replaced by a
different one. If the battery is found replaced the driver is notified
of the change and it disregards the soc value it read from the backup
register. The charger driver has a battery backed bit (force vref
therm) which it sets in its initialization sequence. Once set the
value remains between restarts, unless the battery is removed. The
default value of this bit is 0. Hence if a zero is detected before
writing to it, battery was removed between restarts - this mechanism
is used to notify the BMS to disregard the soc read from the backup
register.
Note that for this to work correctly the bootloader needs to be updated to
not overwrite register 0x107 upon restart.
CRs-Fixed: 370287
Change-Id: If7d098552d36eb27a396ee7d37f78d3629861f6e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
qseecom device is not registered on msm8x60 and this change helps
register qseecom device on msm8x60 targets.
Change-Id: I06ed6e5a327028694185c39eefda886c65e070e3
Signed-off-by: Riaz Ur Rahaman <riazr@codeaurora.org>
cdiv clocks treat the zero rate as a special rate indicating 'use
the external source'. The initial rate of a clock's rate field is
typically zero. Combine the two facts with the addition of code
to check if the rate has changed between the last clk_set_rate()
call and you find that clk_set_rate(cdiv, 0) will not do what is
advertised (namely switch to the external source).
To solve this dilemma set the rate of the cdiv clock to ULONG_MAX so
that the check for the same rate doesn't trigger.
Change-Id: Ic6e9ed8b3cbf3d6c68ec431ad8ec077e39a175b4
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
- Remove codec dai shutdown under cpu dai check
- Don't shutdown codec dai when it's still used by
other capture stream
Change-Id: I1b9eae17ee95d05a8feb07b2369db3936b783e3f
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
There is a race between the min_free_kbytes sysctl, memory hotplug
and transparent hugepage support enablement. Memory hotplug uses a
zonelists_mutex to avoid a race when building zonelists. Reuse it to
serialise watermark updates.
Change-Id: I31786592a8cc03e579ee01d99d7eba76e926263f
[a.p.zijlstra@chello.nl: Older patch fixed the race with spinlock]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
The runtime power management of sdcc can be controlled by
userspace with auto/on modes by writing into
/sys/devices/platform/msm_sdcc.1/power/control entry.
"auto" mode allows runtime pm suspend to happen.
"on" mode forbids runtime suspend of sdcc and also take care
of resuming the device if already suspended. During this resume
process there is a deadlock as described below:
o User writes "on" into control parameter.
o The sysfs write triggers a rpm_resume() (assume sdcc is
already suspended, hence rpm_resume() tries to wake it up).
o rpm_resume() -> msmsdcc_runtime_resume() -> mmc_claim_host()
-> msmsdcc_enable() -> pm_runtime_get_sync() -> rpm_resume()
-> wait for previous rpm_resume() completion which cause deadlock.
CRs-Fixed: 372071
Change-Id: I0f666b56b6db98b182b8fc828588b476fd4eef6a
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Add support for multiple ispif interfaces streaming concurrently.
PIX abd RDI interface can stream at same time or two RDI interfaces
may stream at one time depending on usecase
Change-Id: Ib3cef418cd2816bc19891c1855e1dcae5a2a55a1
Signed-off-by: Nishant Pandit <npandit@codeaurora.org>
The official name for copper is MSM8974.
Switch to it.
Change-Id: Ifb241232111139912477bf7b5f2e9cf5d38d0f9e
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The MIGRATE_CMA migration type has two main characteristics:
(i) only movable pages can be allocated from MIGRATE_CMA
pageblocks and (ii) page allocator will never change migration
type of MIGRATE_CMA pageblocks.
This guarantees (to some degree) that page in a MIGRATE_CMA page
block can always be migrated somewhere else (unless there's no
memory left in the system).
It is designed to be used for allocating big chunks (eg. 10MiB)
of physically contiguous memory. Once driver requests
contiguous memory, pages from MIGRATE_CMA pageblocks may be
migrated away to create a contiguous block.
To minimise number of migrations, MIGRATE_CMA migration type
is the last type tried when page allocator falls back to other
migration types when requested.
Change-Id: I2bb0954de8be4f212b03dea0e5a508048684bda2
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit adds a row for MIGRATE_ISOLATE type to the fallbacks array
which was missing from it. It also, changes the array traversal logic
a little making MIGRATE_RESERVE an end marker. The letter change,
removes the implicit MIGRATE_UNMOVABLE from the end of each row which
was read by __rmqueue_fallback() function.
Change-Id: Icdbbebb9eece2468c0b963964be9a4c579cbc775
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit adds the alloc_contig_range() function which tries
to allocate given range of pages. It tries to migrate all
already allocated pages that fall in the range thus freeing them.
Once all pages in the range are freed they are removed from the
buddy system thus allocated for the caller to use.
Change-Id: I659b133b1c9991568bfb6bd09c7792e15f2a2bfb
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit exports some of the functions from compaction.c file
outside of it adding their declaration into internal.h header
file so that other mm related code can use them.
This forced compaction.c to always be compiled (as opposed to being
compiled only if CONFIG_COMPACTION is defined) but as to avoid
introducing code that user did not ask for, part of the compaction.c
is now wrapped in on #ifdef.
Change-Id: Id51bc882d1befd5afef2c8d1e5dcc7993496893c
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Rob Clark <rob.clark@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit creates a map_pages() function which map pages freed
using split_free_pages(). This merely moves some code from
isolate_freepages() so that it can be reused in other places.
Change-Id: Ia67eaee00ca88a402f21a651de409bd93ae00312
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Due to some reason, user can decide to abort a live
snapshot while it is in progress. Add support to stop
the VFE write masters right away so that the VFE
stops writing on the buffers allocated by the user.
Also send an ACK message to userspace once we get
confirmation from VFE that it has stopped using
the buffers.
CRs-Fixed: 373080
Change-Id: Ia4d9134298dd3a1a51f5829f9bcc2b80d6f21d0f
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
Add the ability to specify the ramdump collection timeout on a per target
basis. Some targets require more than the one minute default value.
CRs-Fixed: 370177
Change-Id: Ic3c52817f61c338942d75624a6cb9a1ab9338801
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
Add primary and secondary PCM RX and TX to the routing
table to support AUX PCM over primary and secondary
audio interface.
Change-Id: Ieca8f0af6479087d86625bec1a38e6357bb5faa3
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
msm_gic_save/restore APIs were added to save the context of the
GIC across the apps. power collapse since 8625 PM framework
doesn't use the CPUIdle framework of the kernel. If the CPUIdle
framework was in use then we could have used the GIC driver provided
notification mechanism which takes of calling appropriate functions.
There is no need to protect these APIs using this #ifdef since there
is nothing specific to 8625 inside, also add empty functions for save
and restore since not all targets have CPU_PM defined.
Change-Id: I02bb4e4021c31caf7ab1282fb675d45ffba42a66
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
For Mixer 2, register flush need not be called. Flushing is done
only for pipes on mixer 0 and 1.
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: I54758f79552790de2ad936703ba6140ac57b76c4