Commit graph

883,834 commits

Author SHA1 Message Date
Charan Teja Reddy
bb7d10aa8e arm: make default iova alignment as 2mb
To get the 2MB aligned IOVA section mappings, set
ARM_DMA_IOMMU_ALIGNMENT to 9.

Change-Id: I3254c39e4864c32d6f25a4d416b1b7aec6756ecd
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:27:30 -07:00
Shiraz Hashim
61311e5672 arm: provision page alloc debug support
Equip arm to support ARCH_SUPPORTS_DEBUG_PAGEALLOC and
enable it by default.

Having this support means all pages freed at buddy level
would be marked as read-only and would help catch any
scribbling over free page area. Allocated pages mapping
attributes is restored to read/write.

ARCH_SUPPORTS_DEBUG_PAGEALLOC needs FORCE_PAGES which
ensures all kernel mapping are populated with page
granularity and it would ensure page level accesses  can
be rightly configured.

Change-Id: I9b23d1fb0b9594cc148b082c104da9a773c26057
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:26:24 -07:00
Shiraz Hashim
629471283e arm: mm: program ptes for access restriction
CONFIG_RODATA allows strict kernel mapping permissions to
be followed and accordingly maps regions as read-only,
not-executable etc. correspondingly. CONFIG_RODATA however
assumes all memory regions to be SECTION_SIZE aligned and
section mapped for performance reasons.

With CONFIG_FORCE_PAGES, we force all kernel mappings as
page mapped thus breaking CONFIG_RODATA.

Provide provision to apply permissions at page (pte)
level, if CONFIG_RODATA does not find section mapping.

Change-Id: I8dbf5c3741836bc63a231d8a471cf0306662993b
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:26:01 -07:00
Liam Mark
b4aefd26a7 arm: dma-mapping: handle IOVA address zero
The IOVA allocator used by these calls supports IOVA address
zero so properly handle IOVA address zero.

Change-Id: Iaaad45b42503f05f95d1333e010f6d8e3bdb1949
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:25:21 -07:00
Chintan Pandya
832decaf00 arm: dma-mapping: map sg lists into the SMMU as virtually contiguous
In arm_iommu_map_sg, currently we map each individual link in the given
scatterlist into the SMMU individually such that they may or may not be
virtually contiguous.  However, in most of our use cases we
actually want the entire sg list mapped into the SMMU as a single
contiguous range.

This was missing for arm 32bit, add it.

Change-Id: Ibf67f29a60b8d19e526c4719590f2f473ea9dca5
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:24:44 -07:00
Laura Abbott
de79fc71ee arm: dma: Expand the page protection attributes
Currently, the decision on which page protection to use
is limited to writecombine and coherent. Expand to include
non consistent memory.

Change-Id: I7585fe3ce804cf321a5585c3d93deb7a7c95045c
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:23:08 -07:00
Shiraz Hashim
ae9f381057 arm: keep address range pmd aligned while remap
During early init, all dma areas are remapped to PAGE_SIZE
granularity. Since full pmd regions are cleared to be
remapped into PAGE_SIZE, ensure that address range is pmd
size aligned while not crossing memory boundaries.

This would ensure that even if address region is not pmd
aligned, its mapping would not be cleared but factored in to
PAGE_SIZE regions.

Change-Id: Iad4ad7fd6169cdc693d532821aba453465addb7c
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:22:49 -07:00
Shiraz Hashim
dd1e256440 arm: mm: consider only lowmem regions while remap
Consider only those memory blocks with lowmem while
remapping into 4KB regions using CONFIG_FORCE_PAGES
feature.

Change-Id: Ie209fce6c310f911d8cf02d977e226660684a6ab
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:11:18 -07:00
Shiraz Hashim
848bfb6423 arm: mm: fix pte allocation with CONFIG_FORCE_PAGES feature
CONFIG_FORCE_PAGES introduces a debug option to mark free
pages as read only in order to trigger a fault if any code
attempts to write to a page on the buddy list.

In order to achieve this it splits all section mappings in
to PAGE_SIZE pages during boot. While doing this split, it
wrongly allocates a pte (of page size) for each pmd. Linux
however in armv7 short descriptor format, uses same second
level pte for 2 consecutive pmds offset by the actual second
level table size. Refer comments in kernel file
arch/arm/include/asm/pgtable-2level.h for details.

Fix this by allocating pte for a section mapped pmd while
providing required offset if pte already exists.

Change-Id: Iadbaa5e71e4b220208a7275bf039a2a413349e42
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:10:57 -07:00
Laura Abbott
cec36b1c9c arm: Allow remapping lowmem as 4K pages
Lowmem is currently mapped with sections (1MB/2MB) whenever
possible due to TLB performance boosts. Sections cannot easily
be changed at runtime however which makes implementing certain
features annoying. Add an option to map lowmem with 4K patches.
This is intended to be used as a debugging feature and should
NOT be used for performance testing.

Change-Id: I9612a99b8e05a022f5ba7e568f21307cf66b5667
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-25 00:10:39 -07:00
Qingqing Zhou
85b0f9f9f7 arm: dma-mapping: add dma mapper for io-pgtable-fast for 32 bit
io-pgtable-fast was implemented to achieve
better performance for IOMMU map/un-map. Add
DMA API support that goes through io-pgtable-fast
for 32 bit targets.

Change-Id: I3d0560a4331f6b7b87c70d0885df11d12cb1d6ec
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
[qqzhou@codeaurora.org: Reorganize codes to be more clear]
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-24 23:59:04 -07:00
Qingqing Zhou
020939113f arm: dma_mapping: Support for DOMAIN_ATTR_S1_BYPASS attribute
For iommus which do not use stage1 translation, stage2 may not be aware
of the device's dma_mask requirements. Choose the dma_ops such that
allocations are made within the dma_mask region and bounce buffers are
used as necessary.

Change-Id: I63ae3ff9e5ab608892d12db7a813264d234699ee
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-24 23:58:32 -07:00
Qingqing Zhou
b1cce515d1 arm: dma-mapping: Use default iommu domain
When a device probes and arch_setup_dma_ops is called, check if the
device has an associated default iommu_domain. If it does, setup
a virtual address allocator of the type described by the
default domain's attributes.

Mark arm_iommu_create_mapping and arm_iommu_attach_device as
deprecated, since clients will no longer need to use them now that
the iommu framework will associate them with a default domain.

Change-Id: I0721c038c68f0f48b78d50f9a72418dbaed97172
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
2020-05-24 23:56:38 -07:00
qctecmdr
4a2732a964 Merge "Revert "SoC: soc-pcm: call pcm_new when creating new pcm"" 2020-05-24 07:08:37 -07:00
qctecmdr
bd555ae76a Merge "leds: qti-flash: Limit off_time of switch to a maximum of 1280 ms" 2020-05-23 16:46:19 -07:00
qctecmdr
e3e3bd297b Merge "mmc: Enable SD card clock scaling" 2020-05-23 00:47:17 -07:00
qctecmdr
e9ea3e9a6b Merge "dwc3: Remove check for HWO flag in dwc3_gadget_ep_reclaim_trb_sg()" 2020-05-22 20:32:57 -07:00
qctecmdr
f3ac7df1a8 Merge "haven: Fix compilation error when DEBUG_FS is disabled" 2020-05-22 20:32:57 -07:00
qctecmdr
928682665b Merge "soc: qcom: mem-buf: Limit the number of input ACL entries" 2020-05-22 20:32:57 -07:00
Bao D. Nguyen
ef59869dfe mmc: Enable SD card clock scaling
The SD card clock scaling feature has a dependency on the
MMC_SDHCI_MSM which is not defined. Remove this dependency
so that the SD card clock scaling feature can be enabled.
In addition, fix the SD cards 2.0 initialization caused
by the incorrect clock settings.

Change-Id: I3eaec3546f89b86643b1937764288b3f39578c0e
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
2020-05-22 16:30:56 -07:00
qctecmdr
c48bd2c6e7 Merge "Revert "ALSA: jack: Add support to report second microphone"" 2020-05-22 16:30:14 -07:00
qctecmdr
76eff845b4 Merge "firmware: qcom_scm: Pass arginfo for sec_wdog_trigger" 2020-05-22 16:30:13 -07:00
qctecmdr
aa259d599a Merge "trace: msm_low_power: update text description" 2020-05-22 16:30:13 -07:00
qctecmdr
07b4fed769 Merge "nvmem: core: Export nvmem cell info to userspace" 2020-05-22 16:30:12 -07:00
qctecmdr
32b9fcd606 Merge "usb: dwc3: gadget: Give back staled requests" 2020-05-22 16:30:12 -07:00
qctecmdr
fe64ebf9ac Merge "msm: adsprpc: Print and return appropriate error codes" 2020-05-22 16:30:11 -07:00
qctecmdr
3116e4c12a Merge "msm: kgsl: Add support for A619 GPU variant" 2020-05-22 16:30:10 -07:00
Isaac J. Manjarres
0d121e6dc3 soc: qcom: mem-buf: Limit the number of input ACL entries
The number of ACL entries is currently not sanitized, which
can allow for unreasonably large ACL to be allocated for
later processing. Allowing for this to happen doesn't make much
sense, as there aren't any valid usecases that require a large
ACL, so restrict the number of ACL entries to 16. Also, while we're
here, fix up some of the error handling in a few places.

Change-Id: I5d1371ed180608486bcde1e208a36782986313af
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-05-22 14:17:56 -07:00
Isaac J. Manjarres
75455dfc54 soc: qcom: mem-buf: Fix message queue registration check
The condition that determines if we print an error after
failing to register for the mem-buf message queue checks
the return code against EPROBE_DEFER. This is not correct, as
error codes are negative, so fix the check.

Change-Id: I4ed03bde56c6edf66e0ffed060ec23a87a46be54
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-05-22 14:12:13 -07:00
qctecmdr
c6886a4d66 Merge "Makefile: Add a check of CONFIG_TRIM_UNUSED_KSYMS before remaking vmlinux" 2020-05-22 12:06:22 -07:00
Isaac J. Manjarres
ca3e7ebe4f soc: qcom: mem-buf: Configure the mem-buf device's DMA mask
The mem-buf device can handle memory from anywhere in the
system. This includes memory with a physical address above
32 bits, so configure the DMA mask for the mem-buf device
based on the system configuration.

Change-Id: If91bb6d8044e8e6f47994acd7e50633b46596808
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-05-22 11:10:58 -07:00
Prakruthi Deepak Heragu
ef9fb88a64 haven: Fix compilation error when DEBUG_FS is disabled
Return proper value when DEBUG_FS is disabled.

Change-Id: I6d46dcac6c6321e1a19468a81906e5f98976d29b
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2020-05-22 09:09:08 -07:00
Hareesh Gundu
d195b2ce1a msm: kgsl: Add support for A619 GPU variant
Add A619 GPU variant support to deal with different
feature set of A619 GPU.

Change-Id: I4df945af138d03868fc0b26d915145e564d056ad
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2020-05-21 23:07:02 -07:00
qctecmdr
4def047588 Merge "cnss2: Assert for recovery if there is already a recovery going on" 2020-05-21 20:58:09 -07:00
qctecmdr
cd64d72587 Merge "cnss2: Add build type info to wlfw_cap_req_msg" 2020-05-21 20:58:08 -07:00
qctecmdr
291fbc8b8f Merge "thermal: core: Add appropriate error checks" 2020-05-21 20:58:08 -07:00
qctecmdr
bf3bfdb120 Merge "msm: cvp: Treat DME stream corrupt as warning" 2020-05-21 20:58:08 -07:00
qctecmdr
9f8ad4f985 Merge "dwc3: core: Add ssp u3 u0 link state related quirk" 2020-05-21 20:58:07 -07:00
qctecmdr
c98a527df5 Merge "dwc3: gadget: Add handling of bus resume and L1 resume functionality" 2020-05-21 20:58:06 -07:00
qctecmdr
626e105a1d Merge "scsi: ufshcd-qti: Invoke sysfs node creation" 2020-05-21 20:58:05 -07:00
Thinh Nguyen
b5d521a3df usb: dwc3: gadget: Give back staled requests
If a request is dequeued, the transfer is cancelled. Give back all
the started requests.

In most scenarios, the function driver dequeues all requests of a
transfer when there's a failure. If the function driver follows this,
then it's fine. If not, then we'd be skipping TRBs at different points
within the dequeue and enqueue pointers, making dequeue/enqueue pointers
useless. To enforce and make sure that we're properly skipping TRBs,
cancel all the started requests and give back all the cancelled requests
to the function drivers.

Change-Id: Ia344a480048383f3fd7c16afbc9f7b0062492879
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Patch-mainline: linux-usb @ 05/03/20, 13:24
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2020-05-21 20:12:36 -07:00
Lina Iyer
bf921e5e8a trace: msm_low_power: update text description
The value printed on cpu idle exit is a return value from the PSCI call.
To avoid confusion, let's change the text to match the return value.

Change-Id: I8938287fb4d2887aa190af835618d1d0e9f18a99
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2020-05-21 18:35:19 -07:00
qctecmdr
66aef21f38 Merge "drivers: rpm-smd: Add support to make rpm-smd as module" 2020-05-21 18:18:22 -07:00
qctecmdr
09fd506f88 Merge "msm: kgsl: Add kobject sysfs ops for the /sys/kernel/gpu directory" 2020-05-21 18:18:22 -07:00
qctecmdr
484e534439 Merge "build.config.common: Revert the compiler back to clang-r370808" 2020-05-21 18:18:21 -07:00
qctecmdr
23d0cc5e97 Merge "soc: qcom: pil: allow subsystem to allocate extra memory" 2020-05-21 18:18:20 -07:00
qctecmdr
4834018094 Merge "net: qrtr: Remove rcu logic for port lookup/remove" 2020-05-21 18:18:19 -07:00
Asutosh Das
9c0dff45b9 scsi: ufshcd-qti: Invoke sysfs node creation
Creates host specific sysfs nodes for UFS.

Change-Id: I8a2023aa9164216de7ba720fe469a73899c448d0
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2020-05-21 14:01:07 -07:00
Nitin Rawat
59c76b3648 scsi: ufs: Resume ufs host before accessing ufs device
As a part of sysfs reading of descriptors/attributes/flags,
query commands should only be executed when hba's
power runtime status is active.
To guarantee this, add pm_runtime_get/put_sync()
to those paths where query commands are sent.

Change-Id: Ieb924efd3159c7422e50bb69ecf70b369ec72d89
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2020-05-21 14:00:30 -07:00
Prakruthi Deepak Heragu
36a8a2affe Makefile: Add a check of CONFIG_TRIM_UNUSED_KSYMS before remaking vmlinux
Gaurd the rule to re generate vmlinux only when CONFIG_TRIM_UNUSED_KSYMS
is set. Without this change, the vmlinux was generated twice as opposed to
Image generating only once.

Change-Id: I8370f64553b0ed7cb6536aabb1c68d77e5b58bf1
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2020-05-21 12:53:35 -07:00