Add initial pinctrl driver to support pin configuration with
pinctrl framework for SM6150. This driver is a snapshot of
pinctrl-sm6150.c from msm-4.14 at commit-id "69d710e4".
Change-Id: I208418d59378550f049fb905151939fc4b73480e
Signed-off-by: Shreyas K K <shrekk@codeaurora.org>
If virtual address is not passed during ramdump collection,
the CMA region gets remapped during ioremap call. By passing
the virtual address in the do_ramdump_elf call, the CMA
doesn't get remapped.
Change-Id: Ice98e7947b977c5edffcbf9f3c5b0d3c6a34ef52
Acked-by: Vishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>
This patch contain changes for supporting new
BT chip moselle.
Change-Id: Ib5aaa4b7dde7accf186593df93bf65e475177f1f
Signed-off-by: priyankar <prigup@codeaurora.org>
During high embedded throughput workloads having ADPL enabled
may impact performance as it becomes a bottleneck for IPA if
log packets are not drained quickly enough. To alleviate this,
increase the number of buffers allocated for the ADPL GSI pipe
to 30 allow for the USB host to consume log packets from the
ADPL endpoint as fast as possible.
Change-Id: I33102608367e71a4e75837f8d2a396f20f386b7a
Signed-off-by: Jack Pham <jackp@codeaurora.org>
In the Scudo memory allocator [1] we would like to be able to detect
use-after-free vulnerabilities involving large allocations by issuing
mprotect(PROT_NONE) on the memory region used for the allocation when it
is deallocated. Later on, after the memory region has been "quarantined"
for a sufficient period of time we would like to be able to use it for
another allocation by issuing mprotect(PROT_READ|PROT_WRITE).
Before this patch, after removing the write protection, any writes to the
memory region would result in page faults and entering the copy-on-write
code path, even in the usual case where the pages are only referenced by a
single PTE, harming performance unnecessarily. Make it so that any pages
in anonymous mappings that are only referenced by a single PTE are
immediately made writable during the mprotect so that we can avoid the
page faults.
This program shows the critical syscall sequence that we intend to use in
the allocator:
#include <string.h>
#include <sys/mman.h>
enum { kSize = 131072 };
int main(int argc, char **argv) {
char *addr = (char *)mmap(0, kSize, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
for (int i = 0; i != 100000; ++i) {
memset(addr, i, kSize);
mprotect((void *)addr, kSize, PROT_NONE);
mprotect((void *)addr, kSize, PROT_READ | PROT_WRITE);
}
}
The effect of this patch on the above program was measured on a
DragonBoard 845c by taking the median real time execution time of 10 runs.
Before: 3.19s
After: 0.79s
The effect was also measured using one of the microbenchmarks that
we normally use to benchmark the allocator [2], after modifying it
to make the appropriate mprotect calls [3]. With an allocation size
of 131072 bytes to trigger the allocator's "large allocation" code
path the per-iteration time was measured as follows:
Before: 33364ns
After: 6886ns
This patch means that we do more work during the mprotect call itself
in exchange for less work when the pages are accessed. In the worst
case, the pages are not accessed at all. The effect of this patch in
such cases was measured using the following program:
#include <string.h>
#include <sys/mman.h>
enum { kSize = 131072 };
int main(int argc, char **argv) {
char *addr = (char *)mmap(0, kSize, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
memset(addr, 1, kSize);
for (int i = 0; i != 100000; ++i) {
#ifdef PAGE_FAULT
memset(addr + (i * 4096) % kSize, i, 4096);
#endif
mprotect((void *)addr, kSize, PROT_NONE);
mprotect((void *)addr, kSize, PROT_READ | PROT_WRITE);
}
}
With PAGE_FAULT undefined (0 pages touched after removing write
protection) the median real time execution time of 100 runs was measured
as follows:
Before: 0.325928s
After: 0.365493s
With PAGE_FAULT defined (1 page touched) the measurements were
as follows:
Before: 0.441516s
After: 0.380251s
So it seems that even with a single page fault the new approach is faster.
I saw similar results if I adjusted the programs to use a larger mapping
size. With kSize = 1048576 I get these numbers with PAGE_FAULT undefined:
Before: 1.563078s
After: 1.607476s
i.e. around 3%.
And these with PAGE_FAULT defined:
Before: 1.684663s
After: 1.683272s
i.e. about the same.
What I think we may conclude from these results is that for smaller
mappings the advantage of the previous approach, although measurable, is
wiped out by a single page fault. I think we may expect that there should
be at least one access resulting in a page fault (under the previous
approach) after making the pages writable, since the program presumably
made the pages writable for a reason.
For larger mappings we may guesstimate that the new approach wins if the
density of future page faults is > 0.4%. But for the mappings that are
large enough for density to matter (not just the absolute number of page
faults) it doesn't seem like the increase in mprotect latency would be
very large relative to the total mprotect execution time.
Link: https://lkml.kernel.org/r/20201230004134.1185017-1-pcc@google.com
Link: https://linux-review.googlesource.com/id/I98d75ef90e20330c578871c87494d64b1df3f1b8
Link: [1] https://source.android.com/devices/tech/debug/scudo
Link: [2] https://cs.android.com/android/platform/superproject/+/master:bionic/benchmarks/stdlib_benchmark.cpp;l=53;drc=e8693e78711e8f45ccd2b610e4dbe0b94d551cc9
Link: [3] https://github.com/pcc/llvm-project/commit/scudo-mprotect-secondary
Signed-off-by: Peter Collingbourne <pcc@google.com>
[pcc: resolved minor conflict]
Cc: Kostya Kortchinsky <kostyak@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
(cherry picked from commit 2a9e75c907fa2de626d77dd4051fc038f0dbaf52
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm)
Bug: 135772972
Change-Id: I98d75ef90e20330c578871c87494d64b1df3f1b8
Unsuspend USB power path (turn off USB-path front-porch FET) before
enabling, and suspend it upon disabling SMB1398.
Change-Id: I319c215861f82cb2fb96504c38993c6eb03c38a7
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Vendor hooks required explicitly defining macros or inline functions
to handle the non-GKI build case (!CONFIG_ANDROID_VENDOR_HOOKS). Added
support for generating them automatically so the macros are no longer
required.
Both models are now supported so we can transition.
Bug: 177416721
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I01acc389d315a5d509b0c48116854342a42e1058
Add code to do PCIe L2 suspend/resume during link down recovery.
Change-Id: I495d63b6cd7d826e7fbff627b3fe74af51c56099
Signed-off-by: Mohammed Siddiq <msiddiq@codeaurora.org>
Platform driver sends QMI message to get device status,
after it receives response, it will suspend device,
but at that time QRTR might been sending some flow control packets,
so mhi layer will reject suspend because packets are still pending,
platform driver retry suspend to cover this corner case.
Change-Id: I1c2e4a490e525199929095579cc6c6e975f88736
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
HBoost is required to be in disabled state before triggering the play.
Check this through DTEST1 signal and ensure the HBoost is ready before
serving a new vibration request.
Change-Id: I0d4b73fef39aa6da15abbb832369579221665d07
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Enable QCOM-specific clock debug features required for testing on both
perf and debug builds.
Change-Id: Ib13e4003e8a80ed00973095c65dacf9bb169e19d
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add support for dumping GPU snapshot in minidump. Register
snapshot region with minidump table.
Change-Id: I1ccf0a0b7f6f8f57b3e4b034f28ce3575b63001c
Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
Fix false warning for RX abort command. Abort command sets abort
interrupt bit in s_irq_status register. Separate it from dma_rx_stat
block to handle it independently.
Interrupts generated for RX abort:
sirq:0x21 mirq:0x80000000 dma_txirq:0x0 dma_rxirq:0x0.
Change-Id: I927de3924f7527068807fadcd4f83742638ae802
Signed-off-by: Akash Asthana <akashast@codeaurora.org>
Currently when device enters lpm, runtime resume is called on dev
instead of its parent sys dev in ep_disable. Since dev is in
suspended state during ep_disable it is leading to a warning
from runtime.c when trying to perform a runtime resume. Also it
is not correct to resume dev in ep_disable as sys dev which is
associated with dwc3_msm is responsible to bring the clocks into
active state and perform a runtime resume. Hence replace dev here
with sys dev.
Change-Id: If9515e73129f4607adb8fa7d41ce7165efca3782
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
Currently driver is voting for active/sleep state configuration
during BT disconnect. Since this state contains UART functionality,
GPIO pins remains high which consumes power. This change is added
to vote for the shutdown pinctrl state during BT disconnect and
configure GPIO's in gpio functionality. This is a requirement
from BT SOC team.
Change-Id: I09f7a4a1dbc197c2bfd443a0b546a1ff283134ed
Signed-off-by: Paras Sharma <parashar@codeaurora.org>
When invalid heap id is passed through DT, ion probe fails for all ion
heaps. Dumping heap id will help identify the erroneous heap.
Trigger panic in case of ion dt parse failure.
Change-Id: I60a84e23b415c464b16af25072638a7efd7ffeae
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
In kgsl_process_private_close, debugfs directory is removed after mutex
is unlocked. Considering this, a race can be created between
kgsl_process_private_close and kgsl_process_init_debugfs. Fix it by
moving debugfs directory removal inside lock.
Change-Id: Ida65ab8a3825d8c695c56556860495cce853117c
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>