Commit graph

876,119 commits

Author SHA1 Message Date
Arun KS
d4dd236a95 arm64: Add fallback option during memory hot add
Section mapping is good for TLB. But sometimes, when
system is low on physically continuous memory, this can
cause memory allocation failures. Add a fallback option to
allocate vmemmap pages from discontinuous pages.

Change-Id: Ide921c36c1e8980a8af047e2c991310405804858
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[swatsrid@codeaurora.org: Fix merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: resolve build errors due to API changes]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:42 -08:00
Arun KS
46d635e8bd arm64: Honor limits set by bootloader
Introduce a variable to save bootloader enforced memory limits and
restricts adding beyond this boundary during a memory hotplug. Also,
export this symbol so that other kernel module have access to it.

Change-Id: I28c100644b7287ec4625c4c018b5fffc865e2e72
Signed-off-by: Arun KS <arunks@codeaurora.org>
[sudaraja@codeaurora.org: check limit with physical address of page]
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[swatsrid@codeaurora.org: Fix merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Fix merge conflicts/use generic page onlining]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:42 -08:00
Arun KS
e5198921dc mm/Kconfig: Enable MEMORY_HOTPLUG for arm64
Add arm64 to the list of architectures which supports
memory hotplug.

Change-Id: Iefeb8294bf06eaebb17a3b3aa8b33bb3b7133099
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:42 -08:00
Andrea Reale
791f0d4beb arm64: Add "remove" probe driver for memory hot-remove
Allows to remove sections of memory that have been previously offlined
from userspace.

This is symmetric to the "memory probe" interface, as described in
Documentation/memory-hotplug.txt. It can be used to manually notify the
OS that one memory section has been removed.

Please, remind that a memory section can only be removed after it has
been logically off-lined; trying to remove a section which has not been
previously off-lined is not supported and will have undefined (but most
likely very bad) behaviour.

To offline a section one can:

To use the remove interface to remove the section:

where 0xYYYYYY is the physical address of the memory section to remove.

Change-Id: I1ab2fafe17b2697a5c667feae25c4ac0655f394e
Signed-off-by: Andrea Reale <ar@linux.vnet.ibm.com>
Signed-off-by: Maciej Bielski <m.bielski@virtualopensystems.com>
Patch-mainline: linux-kernel @ 11 Apr 2017, 18:25
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[isaacm@codeaurora.org: resolved merge conflicts due to API changes]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:42 -08:00
Andrea Reale
ae1dba946a arm64: Hot-remove implementation for arm64
- arch_remove_memory interface
- kernel page tables cleanup
- vmemmap_free implementation for arm64

Change-Id: I8945b6b91ed7012abc1478de266302427ebeb639
Signed-off-by: Andrea Reale <ar@linux.vnet.ibm.com>
Signed-off-by: Maciej Bielski <m.bielski@virtualopensystems.com>
Patch-mainline: linux-kernel @ 11 Apr 2017, 18:25
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Arun KS <arunks@codeaurora.org>
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[swatsrid@codeaurora.org : Fix merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Resolved merge conflicts due to MHP code in mmu.c]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:41 -08:00
Maciej Bielski
63ab21d428 arm64: Memory hotplug support for arm64 platform
This is a second and improved version of the patch previously released
in [3].

It builds on the work by Scott Branden [2] and, henceforth,
it needs to be applied on top of Scott's patches [2].
Comments are very welcome.

Changes from the original patchset and known issues:

- Compared to Scott's original patchset, this work adds the mapping of
  the new hotplugged pages into the kernel page tables. This is done by
  copying the old swapper_pg_dir over a new page, adding the new mappings,
  and then switching to the newly built pg_dir (see `hotplug_paging` in
  arch/arm64/mmu.c). There might be better ways to to this: suggestions
  are more than welcome.

- The stub function for `arch_remove_memory` has been removed for now; we
  are working in parallel on memory hot remove, and we plan to contribute
  it as a separate patch.

- Corresponding Kconfig flags have been added;

- Note that this patch does not work when NUMA is enabled; in fact,
  the function `memory_add_physaddr_to_nid` does not have an
  implementation when the NUMA flag is on: this function is supposed to
  return the nid the hotplugged memory should be associated with. However
  it is not really clear to us  yet what the semantics of this function
  in the context of a NUMA system should be. A quick and dirty fix would
  be to always attach to the first available NUMA node.

- In arch/arm64/mm/init.c `arch_add_memory`, we are doing a hack with the
  nomap memory block flags to satisfy preconditions and postconditions of
  `__add_pages` and postconditions of `arch_add_memory`. Compared to
  memory hotplug implementation for other architectures, the "issue"
  seems to be in the implemenation of `pfn_valid`. Suggestions on how
  to cleanly avoid this hack are welcome.

This patchset can be tested by starting the kernel with the `mem=X` flag, where
X is less than the total available physical memory and has to be multiple of
MIN_MEMORY_BLOCK_SIZE. We also tested it on a customised version of QEMU
capable to emulate physical hotplug on arm64 platform.

To enable the feature the CONFIG_MEMORY_HOTPLUG compilation flag
needs to be set to true. Then, after memory is physically hotplugged,
the standard two steps to make it available (as also documented in
Documentation/memory-hotplug.txt) are:

(1) Notify memory hot-add
 	echo '0xYY000000' > /sys/devices/system/memory/probe

where 0xYY000000 is the first physical address of the new memory section.

(2) Online new memory block(s)
    echo online > /sys/devices/system/memory/memoryXXX/state
    -- or --
    echo online_movable > /sys/devices/system/memory/memoryXXX/state

where XXX corresponds to the ids of newly added blocks.

Onlining can optionally be automatic at hot-add notification by enabling
the global flag:
	echo online > /sys/devices/system/memory/auto_online_blocks
or by setting the corresponding config flag in the kernel build.

Again, any comment is highly appreciated.

[1] https://lkml.org/lkml/2016/11/17/49
[2] https://lkml.org/lkml/2016/12/1/811
[3] https://lkml.org/lkml/2016/12/14/188

Change-Id: I545807e3121c159aaa2f917ea914ee98f38fb296
Signed-off-by: Maciej Bielski <m.bielski@virtualopensystems.com>
Signed-off-by: Andrea Reale <ar@linux.vnet.ibm.com>
Patch-mainline: linux-kernel @ 11 Apr 2017, 18:25
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[arunks@codeaurora.org: fix to pass checker test]
Signed-off-by: Arun KS <arunks@codeaurora.org>
[sudaraja@codeaurora.org: fixed merge conflicts]
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[swatsrid@codeaurora.org: Fix merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Remove now unnecessary workarounds due to MHP changes]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:41 -08:00
Scott Branden
beb7d577e3 arm64: memory-hotplug: Add MEMORY_HOTPLUG, MEMORY_HOTREMOVE, MEMORY_PROBE
Add memory-hotplug support for ARM64 platform.

This requires addition of
ARCH_ENABLE_MEMORY_HOTPLUG and ARCH_ENABLE_MEMORY_HOTREMOVE config options.

MEMORY_PROBE config option is added to support
/sys/devices/system/memory/probe functionality.

In addition architecture specific arch_add_memory and
arch_remove memory management functions are added.

Change-Id: I1fc4e8c93cfe1b9722b2fc8d811390e6cdfa7995
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Patch-mainline: linux-kernel @ 11 Apr 2017, 18:24
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
[sudaraja@codeaurora.org: remove explicit zone calculation]
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[isaacm@codeaurora.org: remove duplicate hotplug/hot remove code in init.c]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-12-30 15:46:41 -08:00
qctecmdr
536ac75863 Merge "BACKPORT: FROMLIST: scsi: ufs: Export query request interfaces" 2019-12-30 15:00:18 -08:00
qctecmdr
ae8057b485 Merge "ASoC: compress: update snd_soc_platform to snd_soc_component" 2019-12-30 15:00:18 -08:00
qctecmdr
e22f3c6ca9 Merge "ASoC: Cold start latency reduction" 2019-12-30 15:00:17 -08:00
qctecmdr
82ed4665df Merge "clk: dt-bindings: Define clock IDs supported by bolero codec" 2019-12-30 14:12:30 -08:00
qctecmdr
ebb17abdf0 Merge "drivers: slimbus: Makefile: Correct makefile configuration" 2019-12-30 14:12:30 -08:00
qctecmdr
ee5466d8fb Merge "ASoC: msm: qdsp6v2: Support to configure clk recovery mode" 2019-12-30 14:12:29 -08:00
qctecmdr
fcd01ea326 Merge "SoC: pcm: Add delay_blk feature" 2019-12-30 13:08:31 -08:00
qctecmdr
1e5fdaeff7 Merge "uapi: sound: add new meta key to get DSP render position" 2019-12-30 13:08:31 -08:00
qctecmdr
86fcf02a59 Merge "msm: dt-binding: add snapshot of audio external clockfor Lahaina" 2019-12-30 13:08:30 -08:00
Surendar Karka
529de7c466 uapi: sound: add new meta key to get DSP render position
Add meta key to query presentation position from DSP
in system time domain.

Change-Id: I1b17bdc2c94b4d694f7d968cd513812e4136e209
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2019-12-26 09:42:59 +08:00
Meng Wang
d1eb1c2845 SoC: pcm: Add delay_blk feature
Add delay_blk() to pcm, platform and DAI ops.
The pcm delay_blk() op collects the audio DSP path
delay from the low-level drivers and sets the
runtime->delay field to their aggregate.

Change-Id: Ib7e10f44ab8ccb46dc2f5825081d0afef662d827
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-12-26 09:33:04 +08:00
Meng Wang
7c30bdfff1 dt-bindings: sound: Add snapshot of audio port types for soundwire
This is a snapshot of the audio codec port types in new header
required by soundwire interface as of commit<I2325b> (Add new
file of audio port types for soundwire).

Change-Id: I2325b3a8d04aaa5e204ab7e51041329700156154
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-12-25 08:33:25 +08:00
Meng Wang
e14865cb5c msm: dt-binding: add snapshot of audio external clockfor Lahaina
This is a snapshot of the external clock header file as of
msm-4.19 commit <Ib9cca> (add audio external clock header
file for Kona).

Change-Id: Ib9ccac4d28bb21e197cd3ea1563dce2601a0699e
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-12-24 16:11:21 +08:00
Meng Wang
b83ade287a ASoC: msm: qdsp6v2: Support to configure clk recovery mode
Update compress driver to support configuration of DSP clock
recovery mode. Supported modes are auto and none. In auto mode
DSP does clock recovery based on avtimer and device drift otherwise
it ignores drift.

CRs-Fixed: 1112258
Change-Id: I4b6b37c08be422e38b7f0bf625712d5e2b0dc0f3
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-12-24 15:09:06 +08:00
Meng Wang
7ba40c9e3f ASoC: msm: qdsp6v2: Support to configure render mode
Update compress driver to support configuration of
render mode.

CRs-Fixed: 1112258
Change-Id: Iac8c3a3d2df6180c9982c352b1c00ce7a624c167
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-12-24 15:05:50 +08:00
Meng Wang
7e80535774 ASoC: Cold start latency reduction
This patch parallelizes FE (front end) and BE (back end) when
playback/capture path is set up. FE's and BE's which can be
parallelized should be indicated in corresponding machine file.
All the operations can be started asynchronously provided the usecase
supports asynchronous operation.
Parallelizing reduces the startup latency as both FE and BE operations
run in parallel.

Change-Id: I17e7e1c3d406713cc728ec262cfe388f7251f7de
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-12-24 13:39:41 +08:00
Meng Wang
5b2776f6f3 ASoC: compress: update snd_soc_platform to snd_soc_component
snd_soc_platform is obsoleted in new kernel.
Update it to snd_soc_component.

Change-Id: I6de172cfe786fb77c0809664c0539ecb9219ee1d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-12-24 13:25:13 +08:00
Prudhvi Yarlagadda
2ca80f5c4c drivers: slimbus: Makefile: Correct makefile configuration
Correct slimbus driver makefile configuration for compilation
to happen in a proper sequence.

Change-Id: I41d662571829cd9430907ce92f53d1c7599e225b
Signed-off-by: Prudhvi Yarlagadda <pyarlaga@codeaurora.org>
2019-12-23 14:55:28 +05:30
Gopikrishnaiah Anand
f61bddd304 ASoC: pcm: Add support for compat mode
When kernel is compiled for 64 bit and userspace client
is in 32 bit mode compat ioctl path will be taken. If
platform driver supports compat mode asoc framework
should call compat function pointers.
Change adds support in asoc framework to support compat mode.

Change-Id: I4929bc89c2ad467cdc83f5a00fe9d38e425c3ca2
Signed-off-by: Gopikrishnaiah Anand <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2019-12-23 15:37:52 +08:00
qctecmdr
567264c6cb Merge "hwrng: Add QRNG driver snapshot for kona" 2019-12-20 12:22:28 -08:00
qctecmdr
3772937d31 Merge "scsi: ufs-qti: Fix overwriting model name" 2019-12-20 12:22:28 -08:00
qctecmdr
bbafe8b1bc Merge "ALSA: compress: Add support to send codec specific data" 2019-12-20 12:22:27 -08:00
qctecmdr
28a2fba4a4 Merge "Asoc: Add audio backend to hwdep interface" 2019-12-20 12:22:27 -08:00
qctecmdr
d679dc78ae Merge "cpufreq: qcom-cpufreq-hw: Fix incorrect type warning from sparse" 2019-12-20 12:22:26 -08:00
qctecmdr
ac139a5c03 Merge "arm64: defconfig: Enable SPS driver for Lahaina" 2019-12-20 12:22:25 -08:00
qctecmdr
20d0b27b23 Merge "net: cnss2: Remove unsupported symbol references" 2019-12-20 12:22:25 -08:00
qctecmdr
d91fc2d48a Merge "phy: qcom-ufs: add UFS HS-G4 support" 2019-12-20 05:45:47 -08:00
qctecmdr
7aa352277d Merge "coresight: tmc: Fix mem_lock dead lock" 2019-12-20 05:45:47 -08:00
qctecmdr
fae584c712 Merge "arm64: defconfig: Enable debug features on Lahaina" 2019-12-20 05:45:46 -08:00
qctecmdr
1b35a503ba Merge "ASoC: compress: propagate the error code from the compress framework" 2019-12-20 05:45:45 -08:00
qctecmdr
bb76c8d330 Merge "phy: qcom-ufs: don't error out if vddp-ref-clk-supply is absent" 2019-12-20 05:02:09 -08:00
qctecmdr
fff4fc5622 Merge "ASoC: dapm: Avoid static route b/w cpu and codec dai" 2019-12-20 04:21:40 -08:00
qctecmdr
45eb6cbf7f Merge "ASoC: msm: qdsp6v2: Cleanup of compress offload drivers" 2019-12-20 04:21:40 -08:00
qctecmdr
f961f15dcd Merge "ALSA: pcm: fix blocking while loop in snd_pcm_update_hw_ptr0()" 2019-12-20 04:21:39 -08:00
qctecmdr
4c74fa0896 Merge "ASoC: Compress: Check and set pcm_new driver op" 2019-12-20 03:41:13 -08:00
qctecmdr
1493beb27a Merge "ASoC: msm: Update the encode option and sample rate" 2019-12-20 03:07:58 -08:00
qctecmdr
e84e857754 Merge "ALSA: core: Handle user defined ioctls" 2019-12-20 02:33:00 -08:00
qctecmdr
45d9ac1a86 Merge "ALSA: PCM: User control API implementation" 2019-12-20 02:33:00 -08:00
qctecmdr
d4d87ace97 Merge "interconnect: qcom: Build icc-rpmh with qnoc-lahaina" 2019-12-20 01:46:19 -08:00
qctecmdr
324dcd65f4 Merge "Bluetooth: Re-initialize regulator to NULL on error" 2019-12-20 01:46:18 -08:00
qctecmdr
4283a88d93 Merge "soc: mem_dump: fix physical address mapping issue" 2019-12-20 01:46:18 -08:00
qctecmdr
670b451abd Merge "shmbridge: get bridge mem pool's DMA address with dma_map_single" 2019-12-20 01:46:18 -08:00
Naveen Yadav
ef18527db3 cpufreq: qcom-cpufreq-hw: Fix incorrect type warning from sparse
The implicit typecast from void * to __iomem cause sparse to complain
about incorrect type in initializer, so fix the same.

Change-Id: I9690d76a9991667496011894f0a1fd83a7e23c1f
Signed-off-by: Naveen Yadav <naveenky@codeaurora.org>
2019-12-20 14:07:56 +05:30