Commit graph

842,208 commits

Author SHA1 Message Date
qctecmdr
292a453226 Merge "ARM64: smp: Save CPU registers before IPI_CPU_STOP processing" 2019-07-31 18:47:33 -07:00
qctecmdr
349e716494 Merge "drivers: irq: Add debug information for irq type warnings" 2019-07-31 18:47:33 -07:00
qctecmdr
8e9118fc64 Merge "kernel: rcu: Panic on RCU stall" 2019-07-31 18:17:41 -07:00
qctecmdr
a522776264 Merge "arm64: msm: Add support for uncompressed kernel image" 2019-07-31 18:17:41 -07:00
qctecmdr
bcb0048ac7 Merge "ARM: arch_timer: force re-selection of the best clocksource" 2019-07-31 17:45:20 -07:00
qctecmdr
ae2bbf5551 Merge "timer: Add a global deferrable timer" 2019-07-31 17:00:01 -07:00
qctecmdr
1c2b772425 Merge "Revert "arm64: kill flush_cache_all()"" 2019-07-31 16:17:20 -07:00
qctecmdr
74494f2b3f Merge "dtc: add integer overflow checks in fdt header" 2019-07-31 15:47:19 -07:00
qctecmdr
1c2c7ce026 Merge "arm64: Apply erratum 1024718 to Cortex A55 r2p0" 2019-07-31 15:47:19 -07:00
qctecmdr
5f14502975 Merge "smp: Allow booting a specific subset of CPUs" 2019-07-31 15:17:23 -07:00
qctecmdr
5e70ff9768 Merge "Revert "arm64: Remove unused daif related functions/macros"" 2019-07-31 15:17:23 -07:00
Rohit Vaswani
a0f944eb08 ARM64: smp: Save CPU registers before IPI_CPU_STOP processing
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
processing the IPI) into a globally accessible structure and print them on
the dmesg/console to allow for easier post-mortem debugging.

[eberman@codeaurora.org: make regs_before_stop static]
Change-Id: Ifd7589af4327992540196c87f8b640045d7eaf19
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-31 14:52:38 -07:00
Atanas Filipov
c3e200ccaf arm64: msm: Add support for uncompressed kernel image
Add support for uncompressed kernel image

[eberman@codeaurora.org: Removed dtb-related changes]
[eberman@codeaurora.org: Add extra description to Kconfig]
Change-Id: I62229187e1f3e0ec11ff4b5a31c36dcee86dc8b7
Signed-off-by: Atanas Filipov <afilipov@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-31 14:45:17 -07:00
Se Wang (Patrick) Oh
4914b031a9 ARM: arch_timer: force re-selection of the best clocksource
As the best clocksource is not selected till core boot completion,
only periodic tick timer works and it increases jiffies by one at
every tick updates. If interrupt is disabled more than one tick(10ms),
timer interrupts are missed and jiffies can't be updated at every
10ms and It can be behind the real time. So make it possible to select
the best clocksource right after arm arch timer initialization, so that
jiffies can be increased by multiple counts since then.

Change-Id: Id8c4e3ce9b9e44061fef7ad7e678ca1c27d84bb1
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-31 14:16:43 -07:00
Se Wang (Patrick) Oh
f587015e88 clocksource: add API to force re-selection of the best clocksource
As the best clocksource is not selected till core boot completion,
only periodic tick timer works and it increases jiffies by one at
every tick updates. If interrupt is disabled more than one tick(10ms),
timer interrupts are missed and jiffies can't be updated at every
10ms and it can be behind the real time. So add API to force re-
selection of the best clocksource among registered clocksources so
that the best clocksource can be selected whenever it is available.

Change-Id: I481de3cdf1df8f0e35ed10aee7ab3882bf7a35b3
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-31 14:15:55 -07:00
Prakruthi Deepak Heragu
f7b837326b arm64: defconfig: Enable IPCC driver as a module
Enable IPCC driver as a loadable kernel module for Lahaina.

Change-Id: I186590a0d8e4206810e35d4c485f9f77a467a985
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2019-07-31 10:50:48 -07:00
qctecmdr
9fe2640572 Merge "soc: qcom: ipcc: Add snapshot of IPCC controller" 2019-07-30 20:11:24 -07:00
qctecmdr
be22176095 Merge "irqdomain: Implement and expose API to clear IRQ mapping for radix tree" 2019-07-30 19:29:09 -07:00
qctecmdr
ab1e36231e Merge "iommu/arm-smmu: Merge all IOMMU changes from msm-4.19 to msm-lahaina" 2019-07-30 18:53:17 -07:00
Channagoud Kadabi
8e647236ed kernel: rcu: Panic on RCU stall
Enable panic on RCU stalls if the RCU_PANIC_ON_STALL is enabled. This
helps collecting the cpu context for debugging.

Change-Id: Ibc95799df995bf31053152ab9b3894710fcd9f43
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-30 14:07:37 -07:00
Prakruthi Deepak Heragu
524bc3b8a9 soc: qcom: ipcc: Add snapshot of IPCC controller
This is a snapshot of the IPCC controller driver as of msm-4.19 commit
<d3d6e9be4297471f88c2a14d31424c508a5b7174>. (Merge "cnss2: Add idle state
to bus voting").

Change-Id: I5b8a3b1e7f71d7cd7e59cf0271e8eac7549c5b6c
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2019-07-30 13:05:36 -07:00
Prakruthi Deepak Heragu
2fd144aa1b irqdomain: Implement and expose API to clear IRQ mapping for radix tree
The irq_domain_remove() API expects all the irqs of the domain be cleared
before it is called, else it throws a warning. A framework creating a
radix tree to map all the irqs used by its clients cannot be sure if all
the clients cleared their irqs. Thus to avoid this warning, we can use
this API irq_dispose_all_tree_mappings() to ensure that all irqs
belonging to the domain are cleared before the domain is itself removed.

Change-Id: Ied1f20c990aba9d4760091d9ed3d48c3e4f3d5d9
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2019-07-30 11:33:03 -07:00
Rishabh Bhatnagar
09d8f5f70a drivers: irq: Add debug information for irq type warnings
Add device node information that adds interrupts without specifying
IRQ type.

Change-Id: Ib475043af11bfb0dfc266a1b5c2f538d875d06d4
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-30 10:04:58 -07:00
Kyle Yan
489af2b126 timer: Add a global deferrable timer
Add a global deferrable timer in addition to the per-cpu deferrable timer
to allow deferrable timers without the TIMER_PINNED flag to run
on any active CPU.

[rishabhb@codeaurora.org: Resolved conflicts in kernel/time/timer.c]
Change-Id: I8e6b77cef972589912ad18f324c46c936fbbb96f
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-30 09:55:45 -07:00
Vijay Kumar Pendoti
ef95f6c3b1 dtc: add integer overflow checks in fdt header
Protect against integer overflows caused by malformed fdt headers.

[eberman@codeaurora.org: most of changes have been fixed in 
commit f858927fd6 ("scripts/dtc: Update to upstream version
v1.4.7-14-gc86da84d30e4"). The upstream was commit eb890c0f77dc
("libfdt: Make fdt_check_header() more thorough"))]
CRs-Fixed: 749977
Change-Id: I51d87038f520bc761b163d291b0138c513c69a33
Signed-off-by: Vijay Kumar Pendoti <vpendo@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-30 09:51:00 -07:00
qctecmdr
e99d705509 Merge "arm64: Dump stack for all CPUs on SMP CPU stop" 2019-07-30 08:37:22 -07:00
qctecmdr
0f59cfa453 Merge "cpu-hotplug: Always use real time scheduling when hotplugging a CPU" 2019-07-30 08:06:33 -07:00
qctecmdr
c8d728f738 Merge "cpu/hotplug: Add cpuhp_latency trace event" 2019-07-30 08:06:33 -07:00
qctecmdr
d142f00cbe Merge "workqueue: fix possible livelock with concurrent mod_delayed_work()" 2019-07-30 07:29:44 -07:00
qctecmdr
c4c9f665d8 Merge "irq-chip: gic-v3: remove print message in irq driver" 2019-07-30 07:29:44 -07:00
qctecmdr
f136543ed0 Merge "printk: Make the console flush configurable in hotplug path" 2019-07-30 06:50:41 -07:00
Isaac J. Manjarres
fb3f251037 iommu/arm-smmu: Merge all IOMMU changes from msm-4.19 to msm-lahaina
This patch merges all of the IOMMU/SMMU, DMA mapping, fast, and
lazy mapping changes from msm-4.19 into msm-lahaina.

Change-Id: If7c1f641a8c836dbb799e2f3439f443ff299b299
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-07-29 16:58:51 -07:00
Mohammed Khajapasha
29432c4eba printk: Make the console flush configurable in hotplug path
The thread which initiates the hot plug can get scheduled
out, while trying to acquire the console lock,
thus increasing the hot plug latency. This option
allows to selectively disable the console flush and
in turn reduce the hot plug latency.

Change-Id: I42507804d321b29b7761146a6c175d959bf79925
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-26 08:57:58 -07:00
Raghavendra Rao Ananta
b18bea500c arm64: defconfig: Enable LLCC driver
Enable the Last Level Cache Controller (LLCC) driver for
Lahaina platform.

Change-Id: I9cb4b1eaf16877bdb4fd7ea827888d4f980c99cc
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-07-25 17:48:11 -07:00
Raghavendra Rao Ananta
72e9584e19 drivers: llcc: Add LLCC driver for Lahaina
Add Last Level Cache Controller (LLCC) driver for Lahaina platform.

Change-Id: I4217c96287059a2621dc17c749381d5db16220d0
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-07-25 17:48:01 -07:00
qctecmdr
a3b9d216d6 Merge "drivers: llcc: Add new usecase IDs" 2019-07-25 14:11:47 -07:00
Rohit Vaswani
8e8907131b Revert "arm64: kill flush_cache_all()"
This reverts the upstream commit <68234df4ea>
("arm64: kill flush_cache_all()"). This is required internally
for certain use-cases like flushing cache before reboot to
ensure all the data is available in the ramdump.

Change-Id: I6dfd240603c05053b7d341faa613dd4866bb7f62
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 11:55:33 -07:00
Rohit Vaswani
93a6067a76 Revert "arm64: Remove unused macros from assembler.h"
This reverts commit <d3127afa71>
("arm64: Remove unused macros from assembler.h")
This is required for flush_cache_all to work.

Change-Id: I469602e2f35b15bf13667322f3ffbe61dab90f91
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 11:55:33 -07:00
Elliot Berman
8753004097 Revert "arm64: Remove unused daif related functions/macros"
This reverts commit a82785a953.
This is required for flush_cache_all to work.

Change-Id: I0c817ca02ff7f113d2058a81814b611342bc111a
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 10:40:32 -07:00
Syed Rameez Mustafa
8b7dde13b7 cpu-hotplug: Always use real time scheduling when hotplugging a CPU
CPU hotplug operations take place in preemptible context. This leaves
the hotplugging thread at the mercy of overall system load and CPU
availability. If the hotplugging thread does not get an opportunity
to execute after it has already begun a hotplug operation, CPUs can
end up being stuck in a quasi online state. In the worst case a CPU
can be stuck in a state where the migration thread is parked while
another task is executing and changing affinity in a loop. This
combination can result in unbounded execution time for the running
task until the hotplugging thread gets the chance to run to complete
the hotplug operation.

Fix the said problem by ensuring that hotplug can only occur from
threads belonging to the RT sched class. This allows the hotplugging
thread priority on the CPU no matter what the system load or the
number of available CPUs are. If a SCHED_NORMAL task attempts to
hotplug a CPU, we temporarily elevate it's scheduling policy to RT.
Furthermore, we disallow hotplugging operations to begin if the
calling task belongs to the idle and deadline classes or those that
use the SCHED_BATCH policy.

Change-Id: Idbb1384626e6ddff46c0d2ce752eee68396c78af
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[psodagud@codeaurora.org: Fixed compilation issues]
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 09:10:47 -07:00
Channagoud Kadabi
0e84930fa5 smp: Allow booting a specific subset of CPUs
In a heterogenous multiprocessor system, specifying the
'maxcpus' parameter on the kernel command line does not
provide sufficient control over which CPUs are brought
online at kernel boot time, since CPUs may have nonuniform
performance characteristics. Thus, we introduce a
'boot_cpus' command line argument, allowing the user to
explicitly specify the list of CPUs that shall be brought
online during kernel boot.

Change-Id: I7bf5efa94785bc6cf1236aa71f4d7364e859fc37
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 09:09:04 -07:00
Prasad Sodagudi
d49e1b840c cpu/hotplug: Add cpuhp_latency trace event
Add ftrace event trace_cpuhp_latency to track cpu
hotplug latency and this entry is useful in power,
performance and debug analysis.

Change-Id: Ie6b2a91027c665ccaf6325b0836bb629a4e91dd7
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 09:07:50 -07:00
Pavankumar Kondeti
82a4f9ff8b workqueue: fix possible livelock with concurrent mod_delayed_work()
When mod_delayed_work() is concurrently executed, there a potential
live lock scenario due to pool->lock contention.

Lets say both CPU#0 and CPU#4 calls mod_delayed_work() on the same
work item with 0 delay on a bounded workqueue. This workitem has
run on CPU#4 previously. CPU#0 wins the work item PENDING bit race
and proceeds to queueing. As this work has previously run on CPU#4,
it tries to acquire the corresponding pool->lock to check if it is
still running there. In the meantime, CPU#4 loops in
try_to_grab_pending() for the workitem to be linked with a pwq so
that it can steal it from pwq->pool->worklist. The CPU#4 essentially
acquires and releases the pool->lock in a busy loop and CPU#0 may
never gets this lock.

----------------                        --------------------
    CPU#0                                          CPU#4
---------------                         --------------------

blk_run_queue_async()

mod_delayed_work_on()                  queue_unplugged()

--> try_to_grab_pending() returns      blk_run_queue_async()
0 indicating PENDING bit is set
now.

__queue_delayed_work()                 mod_delayed_work_on()

__queue_work()                         try_to_grab_pending()

                                       {

--> waiting for the CPU#4's               acquire pool->lock()
pool->lock                                release pool->lock()

                                       }

Change-Id: I9aeab111f55a19478a9d045c8e3576bce3b7a7c5
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-25 09:06:41 -07:00
Sai Krishna Juturi
7f12131ecd usb : dwc3: Initialize kernel stack variables properly
If kernel stack variables are not initialized properly,
there  is a chance of kernel information disclosure.
So, initialize kernel stack variables with null characters.

CRs-fixed: 2042592
Change-Id: I213c0e5c7f67824c2cecace276ff2f8f81599d51
Signed-off-by: Sai Krishna Juturi <jsaikrishna@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
2019-07-25 04:23:05 -07:00
qctecmdr
243513a690 Merge "ABI: aarch64: Update the ABI snapshot for v5.2" 2019-07-24 18:15:23 -07:00
qctecmdr
4c1c9374e6 Merge "Merge remote-tracking branch 'remotes/origin/tmp-cf045d8' into msm-lahaina" 2019-07-24 17:31:49 -07:00
Kyle Yan
d5f3d7346a arm64: Dump stack for all CPUs on SMP CPU stop
Add the stack dump and printk of other CPUs when they are stopped
during an abnormal operation like a panic - This information is useful
for debugging to get a clear idea of what might have caused a crash.

Change-Id: I91a62cfc7cdb49b9cdbb247869b5ba799947ece5
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2019-07-24 16:24:34 -07:00
Raghavendra Rao Ananta
028e5b638f drivers: llcc: Add new usecase IDs
Add usecase IDs such as LLCC_MDMHW, LLCC_CVP, LLCC_MDMVPE,
LLCC_APTCM, LLCC_WRTCH, LLCC_CVPFW, and LLCC_CPUSS1 for the
respective clients.

Change-Id: I0b6666f3c17b9e880568f27782e967c5f9b587bf
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-07-23 16:49:51 -07:00
Avinash Philip
f4b56a15d1 drivers: llcc: Create child platform device for llcc_perfmon
llcc_perfmon driver can reuse register mappings from llcc driver,
hence creates child nod device qcom_lcc_perfmon.

Change-Id: Ic444b22faf2776e297b9c4c30051d69130d0a349
Signed-off-by: Avinash Philip <avinashp@codeaurora.org>
[rananta@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-07-23 16:49:51 -07:00
Venkata Narendra Kumar Gutta
8f8f5ba4da drivers: llcc: Support targets that can write to llcc registers
For older targets, it is possible that they are not allowed
to configure certain llcc registers, as that is handled by
the secure side. However, this is not the case for newer
targets, and as such, they must configure these registers
according to the contents of the SCT table, while keeping in
mind that older targets may not have these capabilities.
Allow configuration of registers to enable capacity based
allocation and power collapse retention for capable targets.

Squashed commit:
drivers: llcc: Check the return value after write

Check the return value after writing to power collapse and
capacity based allocation registers.

Change-Id: I2106f98812a9369f1fdb7e20453741f1375c0a58
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
[vgutta@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
[rananta@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2019-07-23 16:49:51 -07:00