Current code doesn't restart perf after hotplug and power collapse
which makes monitoring in low power modes difficult. This patch adds
support for the hotplug notifier events and creates a common path for
the power collapse and hotplug events.
Change-Id: I52e6978b1c104fd78bc42e4600ceb111b47b3e11
Signed-off-by: Patrick Fay <pfay@codeaurora.org>
Allocating new secure pages has very high latency. Ensure that the page
pool is completely empty before allocating new pages, splitting large order
pages as required.
Change-Id: I1353c5d9bdfd5c525c0c781c524630577c84b95e
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Using GFP_COMP to create compound pages prevents split_pages from being
used to split an order > 0 page into order 0 pages.
Required for future changes to the system_heap allocation algorithm.
Change-Id: I5ab82f717bb003e074124e1ffae3f112c405bc2b
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
A separate heap will be used for the preallocation feature.
Also remove an associated ion_buffer private flag.
Change-Id: I8df74307d4c3461198de0a58f6b8ec7c8bef1f12
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
compat ioctl manages differences between the size of 'unsigned long'
between 32bit and 64bit userspace/kernel.
Change-Id: Ia9030bcb6b404b080cb8bebb91ca7bf03c5f3e05
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Enable clock gating of venus core, when the core is in idle
state. HLOS can do this using the Clock Gate 4.
CRs-Fixed: 1048319
Change-Id: Iaa1ed5c24f07b8e18efc35de4f6ae6edea3b9f55
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Clients may use dma_mmap_coherent to map buffers allocated through
dma_alloc_coherent() to userspace. Support this.
Change-Id: Ibf1f086be4c6692479c11cb4585954c5d3c91707
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Clients may have additional mappings in an iommu domain which are not
managed by arm_iommu_create_mapping. As such, it is important that
arm_iommu_create_mapping only use the iova region specified by the client.
However, the current implementation rounds the size of the region up to a
256K boundary (on arm64).
Change-Id: I88ddd98a76b39e3e9126d78da8e725491f2a5b32
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Enable CONSTRAINED_INTRA_PRED for all the following intra refresh mode
- CYCLIC, ADAPTIVE, CYCLIC_ADAPTIVE, RANDOM
and disbale when intra refresh mode is set to NONE.
Change-Id: Ifda5783f7bf33ba20a3ee3749410560f7864a4f3
CRs-Fixed: 1049420
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
These registers need to be set everytime ARM9 is powered up.
Some may need to be set before ARM9 begins execution.
Hence setting these, before the FW is loaded by PIL.
CRs-Fixed: 1048319
Change-Id: I1d207635b0dd516bbff2007b1a45f5cc038d350e
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Output buffer size will be finalized to driver at start streaming.
Hence set this value to FW in start streaming.
CRs-Fixed: 1049617
Change-Id: I1697139a0c7cf84e20d3a8c3747a1e96f765139a
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: Abdulla Anam <abdullahanam@codeaurora.org>
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
The quirk setting to enable source split always was added along
with the multirect changes from MDP rev 3.0. But there is no
special requirement for enabling it with multirect as the source
split behavior remains the same. Source split is required only
when the layer lies in both the LM. Enabling source split with
partial update, when updating only one LM causes MDP hang due to
invalid configuration. Fix the configs by removing the unnecessary
always source split quirk setting.
Change-Id: Iadaafa64d2c1908b04498d0a88dd612dbc36dae8
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
qusb2 phy programming sequence on msmcobalt v2 platform requires
one extra register write to initialize the phy.
Change-Id: Id2e764210e3ca9e12a3d8299bf0c585958bbd7c8
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Vote for AHB bandwidth after clocks are enabled. For bandwidth
voting clocks need to be on. Set the memory retention flags for
certain hardware clocks to save power, memory does not need to
be retained for these clocks since the driver reinitializes the
jpeg hardware whenever the clocks are turned on.
CRs-Fixed: 1044777 1044373
Change-Id: Ib8e0ede7e237eb6c43f67e98a3b335067a4a74fc
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Gautham Mayyuri <gmayyuri@codeaurora.org>
There is no point of checking whether a currently running task should be
migrated off this cpu if the task is pinned to the cpu.
Change-Id: I33e5ddb318200535c3563f5670059144e0f5eba8
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Rather than defining QoS clock references at the fab
which can create unwanted clock/gdsc toggles, define
QoS clocks at the affected node instead.
Change-Id: I15a01a772198e0383b1b73052e2d0c4160bf389f
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Create new 64-bit kernel defconfig for msmfalcon to have
target specific configs enabled.
While at it, also rename 32-bit defconfig to be consistent.
Change-Id: Ic4cb890a69aa208261c6cecd2db1cfe3275d1fe9
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Add the new clocks and update the clock ids for GCC, GPU, MMSS clock
controllers. Also add the RPM clocks which are supported and would be
used by the clients for all clock operations for RPM controlled clocks.
There are separate MMSS and GPU clock controllers, so add the dummy
controllers for the same.
Change-Id: I5a98b6128f5d54163ab5d03c4c023a748e6a4e95
Signed-off-by: Taniya Das <tdas@codeaurora.org>
In port de-allocate operation free the resources
only if port is connected as memory allocates while
connecting the port.
Change-Id: I743a27025e83f0f4bb8a47c20b2bb2d4cff80caa
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
The msm_stop_dma() is not exported from the driver, so make
it static to stop the following warning:
drivers/tty/serial/msm_serial.c:84:6: warning: symbol 'msm_stop_dma' was not declared. Should it be static?
CRs-Fixed: 1053499
Change-Id: Icea65c8df570eb4d8cb22a421b89fa03dc33f659
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 9a3f5bf275e68b6651a2bc935beaac938cf27adc
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
For dm uarts in pio mode tx data is transferred to the fifo register 4
bytes at a time, but care is not taken when these 4 bytes spans the end
of the xmit buffer so the loop might read up to 3 bytes past the buffer
and then skip the actual data at the beginning of the buffer.
Fix this by, analogous to the DMA case, make sure the chunk doesn't
wrap the xmit buffer.
CRs-Fixed: 1053499
Change-Id: Ia6127c3a18e8909171c4b24c633e361245d1ed72
Fixes: 3a878c430f ("tty: serial: msm: Add TX DMA support")
Cc: Ivan Ivanov <iivanov.xz@gmail.com>
Cc: stable@vger.kernel.org
Reported-by: Frank Rowand <frowand.list@gmail.com>
Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 30acf549ca1e81859a67590ab9ecfce3d1050a0b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Avoid data corruption issues that result in CRC errors during file
transfers over serial ports at higher baud rates.
The current msm_serial driver masks the FIFO Rx interrupts in
msm_start_rx_dma() since Rx FIFO interrupts are not required in DMA
mode. However, msm_complete_rx_dma() re-enables the Rx FIFO interrupts
which could cause RXSTALE event to be processed when a TXLEV interrupt
occurs.
The following is the sequence of events that could occur resulting in
data corruption.
msm_start_rx_dma -> msm_complete_rx_dma -->
spin_unlock_irqrestore(&port->lock) -->
msm_uart_irq()(For TXLEV interrupt) --> msm_handle_rx_dm() (Read from
FIFO resulting in data corruption)
The patch fixes the issue by not restoring the RXLEV and RXSTALE
interrupts in msm_complete_rx_dma(). These interrupts are required only
in FIFO mode.
CRs-Fixed: 1053499
Change-Id: Ib05d8a73a516d7591868c87fd60ff227835d8609
Signed-off-by: Charanya Venkatraman <charanya@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 002eb41f303e007011aecba25ea6de25a4ed475f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
The hrtimer include isn't used and neither is serial. Drop those
ones. The irq.h header really should be interrupt.h because this
is an interrupt user and not an interrupt chip. Finally add
wait.h for the wake_up*() usage in this driver and kernel.h for
container_of().
CRs-Fixed: 1053499
Change-Id: Ib6da8e064171dffe5a8652e49a51c9b7bed96170
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: e4276ff8a08116f22589b4f52974cf82cd3207db
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
The registers that msm_serial_set_mnd_regs() writes only exist on
the non-uartdm hardware, so let's return early here if this
function is called on uartdm hardware. This also prevents us from
messing up the uartclk variable if the uartclk rate happens to be
19.2 or 4.8 MHz.
CRs-Fixed: 1053499
Change-Id: I0a336cc928bbff5bba253281ff7deca52414ba9d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 2a31f094553125e0353b9f7e7b6e9aeea752fed3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This header file is only used by the driver, so let's merge the
two together to reduce files and make it easier to see the whole
driver without flipping through two files. This also makes it
easier to use the structures defined in msm_serial.c in the
functions that are defined in msm_serial.h by placing them in the
proper locations.
CRs-Fixed: 1053499
Change-Id: I1c54b6ab1c27c9b1a7601f809184d27b78ac6e8b
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 321737416c72dc3d3dd8753c3684c6eb86d0ea6c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
The msm_find_best_baud() function is written with the assumption
that the port->uartclk rate is fixed to a particular rate at boot
time, but now this driver changes that clk rate at runtime when
the baud is changed.
The way the hardware works is that an input clk rate comes from
the clk controller into the uart hw block. That rate is typically
1843200 or 3686400 Hz. That rate can then be divided by an
internal divider in the hw block to achieve a particular baud on
the serial wire. msm_find_best_baud() is looking for that divider
value.
A few things are wrong with the way the code is written. First,
it assumes that the maximum baud that the uart can support if the
clk rate is fixed at boot is 460800, which would correspond to an
input clk rate of 230400 * 16 == 3686400 Hz. Except some devices
have a boot rate of 1843200 Hz or max baud of 115200, so
achieving 230400 on those devices doesn't work at all because we
don't increase the clk rate unless max baud is 460800.
Second, we can't achieve bauds higher than 460800 that require
anything besides a divisor of 1, because we always call
msm_find_best_baud() with a fixed port->uartclk rate that will
eventually be changed after we calculate the divisor. So if we
need to get a baud of 500000, we'll just multiply that by 16 and
hope that the clk can give us 500000 * 16 == 8000000 Hz, which it
typically can't do. To really achieve 500000 baud, we need to get
an input clk rate of 24000000 Hz and then divide that by 3 inside
the uart hardware.
Finally, we return success for bauds even when we can't actually
achieve them. This means that when the user asks for 500000 baud,
we actually get 921600 right now, but the user doesn't know that.
Fix all of this by searching through the divisor and clk rate
space with a combination of clk_round_rate() and baud
calculations, keeping track of the best clk rate and divisor we
find if we can't get an exact match. Typically we can get an
exact match with a divisor of 1, but sometimes we need to keep
track and try more frequencies. On my msm8916 device, this
results in all standard bauds in baud_table being supported
except for 1800, 576000, 1152000, and 4000000.
CRs-Fixed: 1053499
Change-Id: Ic480a989bb65b1924f3bd6d38927d1fe54eaaeee
Fixes: 850b37a71b ("tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation")
Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
Cc: Matthew McClintock <mmcclint@codeaurora.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Cristian Prundeanu <cprundea@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 98952bf510d0c7cdfc284f098bbf4682dc47bc61
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
The issue with setting up a fixed clock rate at probe is that it would
overwrite the console rate set by the bootloader for its console device.
This would result in serial out corruption or missing log when we system
is booted with earlycon. This is not a issue if we boot system without
earlycon.
This setup is at least not required with the mainline driver, this code
used to be required because the clk_enable() call would fail if
clk_set_rate() wasn't called first.
Originally the issue was noticed on DB410c which is based on APQ8016
chipset.
Without this patch the console log with earlycon would look like:
...
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
����+HH��0.699378] console [ttyMSM0] enabled
[ 0.699378] console [ttyMSM0] enabled
[ 0.702003] bootconsole [uart0] disabled
[ 0.702003] bootconsole [uart0] disabled
...
with this patch I can see all the skipped lines on the console
CRs-Fixed: 1053499
Change-Id: I029ac3c7a20fdce9b5dfd0bbde8a049ff47dc4bd
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Tested-by: Pramod Gurav <gpramod@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 79c9473f115f99906b6ae443708b8ece480e2e88
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Use a single common table of struct earlycon_id for both command line
and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
unique earlycon declaration (the declaration is only guaranteed to be
unique within a compilation unit; separate compilation units must still
use unique earlycon names).
The semantics of OF_EARLYCON_DECLARE() is different; it declares an
earlycon which can matched either on the command line or by devicetree.
EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
which is matched by command line only. Remove redundant instances of
EARLYCON_DECLARE().
This enables all earlycons to properly initialize struct console
with the appropriate name and index, which improves diagnostics and
enables direct earlycon-to-console handoff.
CRs-Fixed: 1053499
Change-Id: I893ebd28a3e4e7afe8080bcc3e000970fe1fa36b
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 2eaa790989e03900298ad24f77f1086dbbc1aebd
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Add slimbus dai-link to send data from VI feedback path
to DSP for speaker protection usecase.
Change-Id: I34785a7dd2b141c521c3f2623966459b18a80364
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Speaker protection algorithm needs V(voltage) and I(current)
readings from speaker. Enable VI path on the codec to provide
readings to the speaker protection algorithm.
Change-Id: I741e7f3076a7db595297ad7a1ee551c46d5c8213
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add MSM External display node for msmcobalt which is needed
to manage the interaction between external displays (HDMI and
Display Port) and the audio and display frameworks.
CRs-Fixed: 1009284
Change-Id: I54c1eee7a3e1d8f481a9bc629e28f13c5849a3db
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Implement the external display class helper as a utility to
manage display interface and audio codec interactions
associated with the cable connect/disconnect events of the
display interfaces. The helper class is responsible for
routing operations called by the audio codec to a particular
display, updating the hdmi switch node, and updating the
audio switch node.
CRs-Fixed: 1009284
Change-Id: Ie8d1006d3f11091a861733485cb67939ad47fdfe
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>