This is a snapshot of the scm driver as of
msm-3.14 commit:
3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")
Change-Id: Ida15e7da1a8c92e96b4f59feecb4d9dbaf667273
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
This reverts the upstream commit 68234df.
This is required internally for certain use-cases like flushing cache
before reboot to ensure all the data is available in the ramdump.
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Fix control register offsets for SDC1 and SDC2 pingroups
Change-Id: Ib373d17d512aeed64c16b5831ac20e03ab43ffe0
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
The GPLv2 copyright statement includes an attribution
to Sony which was accidentally copied from another file.
Since the 8996 pinctrl driver does not leverage code
from sources besides the Linux Foundation,
clean-up the copyright text accordingly.
Change-Id: I324088aea2abde4fe34769a63d4ab55b35e13b81
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Based on the upstream change add gpio functions and
pingroups to msm8996 soc file
Change-Id: Iffc92a84d31b02efe29319dbdbb65c870c959cfd
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
Use appropriate SOC name. Also replace all
instances of thulia with kryo.
Change-Id: Idd9acaae0688b7c125b85462bd99d01a3303fd09
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The APIs __dma_inv_range() and __dma_clean_range() were
not exported by the third party patch. Since the functions
starting with underscores are not to be directly used by drivers,
related functions without the underscores are provided
which have the same name and functionality as the 32 bit APIs.
Change-Id: Ie0e681614307d9d9a19e58cacfb9b5dff4528977
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
arm64: add defines for dmac_*_range for compatibility with arm32
An earlier patch created defines for dma_*_range APIs to be
compatible with arm 32 bit, however it appears
these API names have not (at least yet) appeared there, so
revise the names to dmac_*_range, which is defined
for arm 32 bit so that there is one name defined
for both architectures.
Change-Id: I6456c02bad73fb54a874dc9925d3d43d9b8be2f2
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 0930bab0db67cc0d91e52e385e3e061871c6be05)
This makes locating our files less convoluted, since the
arch/arm/boot/dts directory is now quite bloated. So
move the dts into a "qcom" subdirectory.
The dtb output objects will still remain in the usual place,
out/arch/arm/boot/dts.
Change-Id: I9147b76c5385d77b5e350e2daa623747034dc96e
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
(cherry picked from commit 850759efa7e7b99fed479c8875439bfcfa06a340)
Conflicts:
arch/arm/Makefile
arch/arm/boot/dts/Makefile
Allow CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES to specify
a space separated list of dtbs to append to the zImage,
and name the resulting file zImage-dtb
Change-Id: I36d9108a2349bdbb373e95076dcb1417d8c7dce6
Signed-off-by: Colin Cross <ccross@android.com>
(cherry picked from commit 1307afc31753a515832702ff17e788de4f6f5d7c)
Allows a defconfig to set a list of dtbs to concatenate with an
Image.gz to create a Image.gz-dtb.
Change-Id: I0dc3935e57f01b517aa64eda0c27b0101e9ea3b2
Signed-off-by: Alex Ray <aray@google.com>
(cherry picked from commit 082d89f7f2ae529e2d7b50f6259e4430472cf4ed)
Memory model feature register specifies the supported
page granules. Some ARM cpus may have support for
16KB granules.
However currently we donot support 16KB pages sizes.
Explicitly mask off that capability if advertised by
the cpu.
Change-Id: I7daf3f179a5ce103aec7cf103ac198cf64800543
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
The style used by 4fe343f94858 ("arm64: entry: add support for
CONFIG_ARM64_REG_REBALANCE_ON_CTX_SW") is inconsistent with other code
in the same file. Clean this up by using tabs instead of spaces, and
lower-case instead of upper-case instructions. No functional change
is expected.
Change-Id: Ia0d27e8b96fbde18f1c77f0728205a8e4109c114
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
When a process A unwind the stack frame of process B,
the stack of B can be modified and updated in other CPU
concurrently. So KASan could examine stack address with
out of date shadow mask value. To avoid this incorrect
KASan report, disable KASan during unwinding a frame of
a different task.
Following is the Kasan error log for the reference.
==================================================================
BUG: KASan: out of bounds access in unwind_frame+0x9c/0xf8 at addr ffffffc0462b76f0
Read of size 8 by task Signal Catcher/1282
page:ffffffbac7bdb260 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x0()
page dumped because: kasan: bad access detected
Call trace:
[<ffffffc00008c010>] dump_backtrace+0x0/0x250
[<ffffffc00008c270>] show_stack+0x10/0x1c
[<ffffffc001b6e628>] dump_stack+0x74/0xfc
[<ffffffc0002dd7c4>] kasan_report_error+0x2b0/0x408
[<ffffffc0002dd9f8>] kasan_report+0x34/0x40
[<ffffffc0002dda78>] __asan_report_load8_noabort+0x14/0x20
[<ffffffc00008b984>] unwind_frame+0x98/0xf8
[<ffffffc00008ba14>] walk_stackframe+0x30/0x48
[<ffffffc00008bba4>] save_stack_trace_tsk+0x178/0x254
[<ffffffc0003a5bc4>] proc_pid_stack+0xf0/0x198
[<ffffffc0003a11b0>] proc_single_show+0xe8/0x130
[<ffffffc000330e0c>] seq_read+0x524/0xaf0
[<ffffffc0002e9c74>] vfs_read+0x120/0x270
[<ffffffc0002eb208>] SyS_read+0xec/0x198
Memory state around the buggy address:
ffffffc0462b7580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0462b7600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc0462b7680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffffffc0462b7700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0462b7780: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00
==================================================================
Change-Id: I0e35e6721417fa7a5bffb41be67443cd906e256a
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
Add support for re-balancing register rename pools on context
switches, for a potential performance boost on some ARM64 targets.
Change-Id: I7577c11fac566ae91a210787c70b23591bfbd693
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
These message are printed every time a CPU in hotplugged out,
resulting in log noise and hurting hotplug latency. Silence them
by default, by dropping them to pr_debug.
Change-Id: I21632c1dbf54342b5980a82ab7389713e943bf6c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This message is printed every time a CPU in hotplugged in,
resulting in log noise and hurting hotplug latency. Silence
it by default, by dropping it to a pr_debug.
Change-Id: I05b643a90abc17e0134830874555e79138237261
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Move topology_init to postcore initcall to retrive
cpu frequency table early in boot from OPP.
Change-Id: I814a022f646878ee608f18ff740b5dc29c77a3c7
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Commit 02df19b422 ("ARM:
7424/1: update die handler from x86") refactored the ARM
die() logic to avoid a deadlock if a kernel oops happens
while holding a spinlock that may also be used in an IRQ
handler. Refactor the ARM64 die() handler in a similar way,
to avoid similar deadlocks, which would have otherwise
prevented the kernel from printing the full panic output
and properly completing the panic() path.
Change-Id: I217a8d719f64b54467fa88a583d83f72193d7580
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Define boot_reason and cold_boot variables in the arm64 version
of setup.c so that arm64 targets can export the boot_reason and
cold_boot sysctl entries.
This feature is required by the qpnp-power-on driver.
Change-Id: Id2d4ff5b8caa2e6a35d4ac61e338963d602c8b84
Signed-off-by: David Collins <collinsd@codeaurora.org>
[osvaldob: resolved trival merge conflicts]
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Nothing stops a process from hotplugging in a CPU concurrently
with a sys_reboot() call. In such a situation we could have
ipi_cpu_stop() mark a cpu as 'offline' and _cpu_up() ignore the
fact that the CPU is not really offline and call the
CPU_UP_PREPARE notifier. When this happens stop_machine code will
complain that the cpu thread already exists and BUG_ON().
CPU0 CPU1
sys_reboot()
kernel_restart()
machine_restart()
machine_shutdown()
smp_send_stop()
... ipi_cpu_stop()
set_cpu_online(1, false)
local_irq_disable()
while(1)
<PREEMPT>
cpu_up()
_cpu_up()
if (!cpu_online(1))
__cpu_notify(CPU_UP_PREPARE...)
cpu_stop_cpu_callback()
BUG_ON(stopper->thread)
This is easily reproducible by hotplugging in and out in a tight
loop while also rebooting.
Since the CPU is not really offline and hasn't gone through the
proper steps to be marked as such, let's mark the CPU as inactive.
This is just as easily testable as online and avoids any possibility
of _cpu_up() trying to bring the CPU back online when it never was
offline to begin with. Based on the similar patchset by for arm
targets 040c163( "ARM: smp: Fix cpu_up() racing with sys_reboot)"
CRs-fixed: 758395
Change-Id: Ia13a3aad8cd6616119a07b5114350591173a5d03
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Currently, CPU online messages are printed using printk(),
and CPU offline messages are printed using pr_notice().
It seems rather silly to have the (otherwise symmetric)
messages to be printed using different log levels. Change
both messages to be printed using pr_debug() to match the
ARM implementation, to avoid disparities in log spam on
ARM/ARM64 with otherwise identical loglevel settings.
Change-Id: I58ce95c5b76093ee27678de497cf5c4cab4ad3aa
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
With multiple CPUs online, these memory dumps may consume a very
large amount of log buffer space, pushing out useful information.
Drop the call to dump_mem() for stack memory. The actual string-
formatted call stack will still be printed, which should be sufficient
for identifying the context of a panic. Stack memory can be collected
from full memory ramdumps if needed.
Change-Id: I2d08b49217b3838d3d3e7f8deceb937bb90ffaf7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Due to the verbosity of printing, dumping memory regions for all
register when many CPUs are online may contribute to flooded kernel
logs. Spinlock lockups due to the printing have also been seen to
result, compounding the problem due to additional prints.
Change-Id: I7440b2d77f03fd34f36816f549588fa89322ce5f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
External modules may need to use caching APIs. Export the symbols
to allow their use.
Change-Id: I72a862608d37dedf0980ee2790ffb93a9de82221
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[stepanm@codeaurora.org: resolve minor conflicts]
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
When CPU idle is enabled, the idle call should also notifiy the
idle_notifier_call_chain of the change in status. Otherwise some
processes will think the CPU is always active.
CRs-Fixed: 677525
Change-Id: Iabd6f617d6835688cf8b482ac1321e5c1deafffd
Signed-off-by: Patrick Cain <pcain@codeaurora.org>
The change to refactor kernel/setup.c to use the common
of_flat_dt_get_machine_name() API has apparently removed
the line which prints the device tree model string during
boot. Having the model string in the kernel log is helpful,
so add it back in.
Change-Id: I7dccc3ab00f5b67753cdd256846a522596c5058f
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The dma_mask for a device structure is a pointer. This pointer
needs to be set up before the dma mask can actually be set. Most
frameworks in the kernel take care of setting this up properly but
platform devices that don't follow a regular bus structure may not
ever have this set. As a result, checks such as dma_capable will
always return false on a raw platform device and dma_set_mask will
always return -EIO. Fix this by adding a dma_mask in the
platform_device archdata and setting it to be the dma_mask. Devices
used in other frameworks can change this as needed.
Change-Id: I5bfd2aa75798dfdf49d3af70fdd95dfaf2126e8c
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The commit f3b4a40bc637a25c01c5ec66c825b4ddfc30328a introduced changes
to store CPU registers for all CPUs that handle IPI_CPU_STOP. The
structure to save the registers was intended to be a per-cpu variable.
However, the patch did not allocate a per-cpu structure and instead only
ended up providing a compiler per-cpu directive. Fix this bug by actually
defining a static per-cpu variable.
Change-Id: Iea7e52e91819f6f2c7f8d2c638545c0a68d2ef76
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Based on the commit 8b775be35e41b9ffa764411a632b52015d1e3d69
Sending an IPI_RESCHEDULE to an offline CPU is incorrect and potentially
bad for both power and stability. On some sub-architectures such as MSM,
if a power-collapsed CPU is unexpectedly woken up by an IPI, it will be
begin executing without the preparations that would normally happen as
part of CPU_UP_PREPARE. If clocks, voltage regulators, or other hardware
configuration are not performed, the booting CPU may cause general
instability or (at best) poor power performance since the CPU would be
powered up but not utilized.
One common cause for such issues is misuse of add_timer_on() or APIs
such as queue_work_on() which call it. If proper precautions are not
taken to block hotplug while these APIs are called then a race may
result in IPIs being sent to CPUs that are already offline.
This same argument could be applied to other IPIs (with the exception
of IPI_WAKEUP), but the others are already restricted to only online
CPUs by existing mechanisms, so an explicit assertion is not useful.
Change-Id: I2607082719b4cb216e53fb354649ea4c5c875b1e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
When a kernel panic occurs on one CPU, other CPUs are instructed to stop
execution via the IPI_CPU_STOP message. These other CPUs dump their stack,
which may not be good enough to reconstruct their context to perform
post-mortem analysis. Dump each CPU's context (before it started
procesing the IPI) into a globally accessible structure and print them on
the dmesg/console to allow for easier post-mortem debugging.
Change-Id: Ifd7589af4327992540196c87f8b640045d7eaf19
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
[abhimany: resolve trivial merge conflic]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Modify the kernel code section with fixmap to handle the case where
the kernel text section is readonly.
Change-Id: I3f81fcbfe917ef42783e55b107289ad97e1c02c3
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Lorenzo reported that we could not properly find v4mapped sockets
in inet_diag_find_one_icsk(). This patch fixes the issue.
[cherry-pick of fc439d9489479411fbf9bbbec2c768df89e85503]
Change-Id: I13515e83fb76d4729f00047f9eb142c929390fb2
Reported-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
When closing a listen socket, tcp_abort currently calls
tcp_done without clearing the request queue. If the socket has a
child socket that is established but not yet accepted, the child
socket is then left without a parent, causing a leak.
Fix this by setting the socket state to TCP_CLOSE and calling
inet_csk_listen_stop with the socket lock held, like tcp_close
does.
Tested using net_test. With this patch, calling SOCK_DESTROY on a
listen socket that has an established but not yet accepted child
socket results in the parent and the child being closed, such
that they no longer appear in sock_diag dumps.
[cherry-pick of net-next 2010b93e9317cc12acd20c4aed385af7f9d1681e]
Change-Id: I0555a142f11d8b36362ffd7c8ef4a5ecae8987c9
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Adding support for SYN_RECV request sockets to tcp_abort()
is quite easy after our tcp listener rewrite.
Note that we also need to better handle listeners, or we might
leak not yet accepted children, because of a missing
inet_csk_listen_stop() call.
[cherry-pick of net-next 07f6f4a31e5a8dee67960fc07bb0b37c5f879d4d]
Change-Id: I8ec6b2e6ec24f330a69595abf1d5469ace79b3fd
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Tested-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This implements SOCK_DESTROY for TCP sockets. It causes all
blocking calls on the socket to fail fast with ECONNABORTED and
causes a protocol close of the socket. It informs the other end
of the connection by sending a RST, i.e., initiating a TCP ABORT
as per RFC 793. ECONNABORTED was chosen for consistency with
FreeBSD.
[cherry-pick of net-next c1e64e298b8cad309091b95d8436a0255c84f54a]
Change-Id: I728a01ef03f2ccfb9016a3f3051ef00975980e49
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This passes the SOCK_DESTROY operation to the underlying protocol
diag handler, or returns -EOPNOTSUPP if that handler does not
define a destroy operation.
Most of this patch is just renaming functions. This is not
strictly necessary, but it would be fairly counterintuitive to
have the code to destroy inet sockets be in a function whose name
starts with inet_diag_get.
[backport of net-next 6eb5d2e08f071c05ecbe135369c9ad418826cab2]
Change-Id: Idc13a7def20f492a5323ad2f8de105426293bd37
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds a SOCK_DESTROY operation, a destroy function
pointer to sock_diag_handler, and a diag_destroy function
pointer. It does not include any implementation code.
[backport of net-next 64be0aed59ad519d6f2160868734f7e278290ac1]
Change-Id: Ic5327ff14b39dd268083ee4c1dc2c934b2820df5
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Currently, inet_diag_dump_one_icsk finds a socket and then dumps
its information to userspace. Split it into a part that finds the
socket and a part that dumps the information.
[cherry-pick of net-next b613f56ec9baf30edf5d9d607b822532a273dad7]
Change-Id: I144765afb6ff1cd66eb4757c9418112fb0b08a6f
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 011e507b413393eab8279dac8b778ad9b6e9971b)
Running mmcqd as a prio 120 thread forces it to compete with standard
user processes for IO performance, especially when the system is under
severe CPU load. Move it to a SCHED_FIFO thread to reduce the impact of
load on IO performance.
Signed-off-by: Tim Murray <timmurray@google.com>
Bug: 25392275
Change-Id: I1edfe73baa25e181367c30c1f40fee886e92b60d
Android SELinux policies block SysV IPC. New kernels should not be
built with it.
Bug: 22300191
Change-Id: Ia4bcb179ff71825cab19eed603d4064a8d061a93
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Now that Android is moving towards ConfigFS based USB gadgets,
lets enable USB_CONFIGFS and relevant Android gadget functions
instead of obsolete USB_G_ANDROID composite driver which doesn't
exist now.
Enabled following ConfigFS gadget functions:
F_FS for ADB
F_MTP/PTP for MTP/PTP
F_ACC for Android USB Accessory
F_AUDIO_SRC for USB Audio Source
F_MIDI for MIDI, and
CONFIGFS_UEVENT for communicating USB state change notifications to userspace.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>