Commit graph

858,579 commits

Author SHA1 Message Date
Isaac J. Manjarres
03bb3d6ddd ion: msm: Correct OF node refcount handling in error paths
The for_each_[available]_child_of_node iterators implicitly
increment the reference count on the current OF node at the
start of the iteration, and decrements it at the end of the
iteration.

However, if the control flow is such that the loop
can be broken out of prior to finishing an iteration, then
the reference count must be decremented in the subsequent
code path.

Thus, fix the error path in the MSM ION code to decrement the
reference on the current OF node when prematurely exiting
an of_node loop.

Change-Id: I5c2ec02a57eff416c04b1fe63c80d6e573a692d4
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-07 15:13:39 -07:00
Isaac J. Manjarres
583ca0fad1 ion: Allow the system heap to expose debug information
Allow the system heap to expose debug information about the pools
through debugfs.

Change-Id: Id11706648b32260f19dff8d3f5cced1733a05978
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:51 -07:00
Sudarshan Rajagopalan
016daf243e ion: msm: enable debugfs for ion heaps
Add debugfs node for ion which prints out the debug_show
of all the heaps within ion.

Change-Id: I8499967c8f202b079b6ccbe1c31cb38ee6a51374
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
[isaacm@codeaurora.org: Rework to move logic out of ION core]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:51 -07:00
Liam Mark
2b78a1e427 ion: msm: Expose ION API to query buffer VM information
Allow ION clients to be able to determine the VM information associated
with an ION buffer, such as the VMIDs it is assigned to as well as the
VM permissions.

Change-Id: Id0be0b505bc84beff373e4e2ae16b71ec4f09d43
Signed-off-by: Liam Mark <lmark@codeaurora.org>
[isaacm@codeaurora.org: Relocate changes to new header locations]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:51 -07:00
Patrick Daly
1b851a568a ion: msm: Assume devicetree support
Remove support for passing parameters via platform_data now that
relevant targets use devicetree.

Change-Id: I2d8398163b5a4f358e257f416fd0e0c325664154
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
[isaacm@codeaurora.org: Relocated changes to correct file]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:50 -07:00
Isaac J. Manjarres
b34178e823 ion: msm: Correct msm_ion_parse_dt() error propagation
If a device cannot be created for a child node, or the ID cannot
be retrieved for a heap, then msm_ion_parse_dt() will return ret.
However, under these circumstances, ret has not been updated to
reflect these failures, and as such, msm_ion_probe will erroneously
continue as if the call to msm_ion_parse_dt() had been successful.
Thus, ensure that ret is set before following the error path in
msm_ion_parse_dt().

Change-Id: I241805e2c169fb15bda68c2a375def04790aa20e
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:50 -07:00
Isaac J. Manjarres
daed90529d ion: msm: Upgrade the ION ABI version
Upgrade the ION ABI version from to 2 to 3 to help ION
clients decide what they need to do based on the target
version.

Change-Id: I3d37fb9abb237e432283eaa4e7ea52419c08a2df
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:27:49 -07:00
Isaac J. Manjarres
c93bc92639 ion: msm: Rename msm_ion_of.[c/h] to msm_ion.[c/h]
Rename msm_ion_of.[c/h] to msm_ion.[c/h], as the OF portion is
a bit of a misnomer, considering that the file supports
more than just the OF parsing machinery.

Change-Id: I013cbdb78cb031ab7521f55873ed9fb031cbbed5
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:25:19 -07:00
Isaac J. Manjarres
02c55808f3 ion: msm: Fix several errors in the MSM ION kernel header
ION clients that reside in the kernel may need information that is
present in the UAPI header, such as flags to specify memory
attributes, or IDs to allocate from different heaps, so include
the UAPI header in the kernel space header. Also, ensure that
drivers that use this header can still compile even when
CONFIG_ION_MSM_HEAPS is not set.

Change-Id: If030a58ce62b73b66b337b6dfc6a607bbc0ce193
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-03 23:06:51 -07:00
qctecmdr
7a21e4007b Merge "iommu: iommu-debug: check valid pfn before performing ATOS ops" 2019-10-03 13:17:48 -07:00
qctecmdr
03ea966837 Merge "iommu/arm-smmu: Adopt bitfield model for remaining SMMU registers" 2019-10-03 12:39:41 -07:00
qctecmdr
1578f1693e Merge "ARM: smp: export pending IPI state" 2019-10-03 11:51:41 -07:00
qctecmdr
0bd47772b8 Merge "iommu/arm-smmu: Add reset implementation hook" 2019-10-03 10:39:24 -07:00
qctecmdr
7da1ef4b30 Merge "iommu/arm-smmu: Move Secure access quirk to implementation" 2019-10-03 10:00:03 -07:00
qctecmdr
da9d4994d3 Merge "iommu/arm-smmu: Rename arm-smmu-regs.h" 2019-10-03 09:16:24 -07:00
qctecmdr
88623cbbdd Merge "usb: dwc3: qcom: Use GDSC regulator if available" 2019-10-03 08:31:49 -07:00
qctecmdr
b5d0ace88f Merge "regulator: add verbose error messages for invalid voltage requests" 2019-10-02 19:16:13 -07:00
David Collins
85a85aada0 regulator: add verbose error messages for invalid voltage requests
Add error messages into the regulator_check_voltage() and
regulator_check_consumers() functions which explain exactly what
is not correct about given voltage requests.  This makes
debugging regulator_set_voltage() errors easier.

Change-Id: I8b3ec8d6a78c94b436b57bd2228b8bd5c362cecd
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-10-02 18:22:14 -07:00
qctecmdr
c78315c521 Merge "defconfig: lahaina-gki: enable rpmh-regulator driver" 2019-10-02 18:08:32 -07:00
qctecmdr
0adc799684 Merge "iommu/arm-smmu: Abstract context bank accesses" 2019-10-02 17:32:25 -07:00
Jack Pham
ae9ad6b5c6 usb: dwc3: qcom: Use GDSC regulator if available
GDSC can be specified as a regulator in device tree as
'USB3_GDSC-supply'. If present, use it and enable it
prior to enabling the clocks.

Change-Id: I50c056dd920b457fe77fd364414657e98413f4d0
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-10-02 17:28:02 -07:00
qctecmdr
a75e17c39a Merge "iommu/arm-smmu: Get rid of weird "atomic" write" 2019-10-02 16:59:17 -07:00
qctecmdr
b39f25a096 Merge "iommu/arm-smmu: Rework cb_base handling" 2019-10-02 16:23:24 -07:00
qctecmdr
8063c4d617 Merge "net: qrtr: Make qrtr_port_lookup() use RCU" 2019-10-02 15:47:38 -07:00
qctecmdr
c415245873 Merge "iommu/arm-smmu: Convert GR1 registers to bitfields" 2019-10-02 15:14:20 -07:00
qctecmdr
d14393ebc7 Merge "net: qrtr: Implement outgoing flow control" 2019-10-02 14:38:38 -07:00
David Collins
df8ac4a79d defconfig: lahaina-gki: enable rpmh-regulator driver
Enable the rpmh-regulator driver so that consumers can manage
PMIC regulator states via RPMh.

Change-Id: Ia5ee73dc04d9fcbd6412d49fd82172ff7d006a47
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-10-02 14:07:31 -07:00
qctecmdr
5d0063a99b Merge "net: qrtr: Stop rx_worker before freeing node" 2019-10-02 14:02:31 -07:00
qctecmdr
566cdcacb2 Merge "iommu/arm-smmu: Convert GR0 registers to bitfields" 2019-10-02 13:29:25 -07:00
qctecmdr
027cf3c126 Merge "rpmsg: Add snapshot of RPMSG drivers for lahaina" 2019-10-02 12:41:22 -07:00
qctecmdr
edb7abf4fb Merge "msm: ipa3: SRAM NAT, DDR NAT, back-and-forth NAT" 2019-10-02 06:47:54 -07:00
qctecmdr
16ee17d4b6 Merge "regulator: add rpmh-regulator driver" 2019-10-01 23:35:15 -07:00
qctecmdr
5426c7c971 Merge "arm64: defconfig: Enable SSR, PIL, Sysmon, and PDR drivers" 2019-10-01 20:50:25 -07:00
qctecmdr
557352c895 Merge "drivers: qcom: rpmh-rsc: add IPC logging support for RSC driver" 2019-10-01 20:02:43 -07:00
qctecmdr
5c4d2e8fa3 Merge "drivers: clksource: add API to return cval" 2019-10-01 19:17:25 -07:00
qctecmdr
a49a3b4be7 Merge "soc: qcom: rpmh: Fix sending incorrect data during rpmh flush" 2019-10-01 19:17:25 -07:00
qctecmdr
97b5ab5509 Merge "iommu/arm-smmu: Fix SMMU derivation in arm_smmu_power_off_atomic" 2019-10-01 18:44:28 -07:00
qctecmdr
91dda46f8b Merge "iommu: iommu-debug: Add support for page table dump" 2019-10-01 18:08:24 -07:00
qctecmdr
bb93ad4d2b Merge "soc: qcom: Fix printk format warnings from subsystem restart" 2019-10-01 17:32:42 -07:00
qctecmdr
ecc7656ce7 Merge "msm: ipa4: Fix to add wake up handle for coalescing pipe" 2019-10-01 17:32:41 -07:00
qctecmdr
6484f51a25 Merge "of: reserved_mem: add missing of_node_put() for proper ref-counting" 2019-10-01 16:53:22 -07:00
qctecmdr
811cdc9fa1 Merge "iommu: iommu-debug: select IOMMU_DEBUGFS for iommu tests" 2019-10-01 16:53:21 -07:00
qctecmdr
bdb2791054 Merge "dt-bindings: regulator: rpmh-regulator: add new intermediate voltage levels" 2019-10-01 16:14:30 -07:00
qctecmdr
c58400efd6 Merge "dt-binding: regulator: rpmh-regulator: define RPMh sets and regulator modes" 2019-10-01 15:38:30 -07:00
Bjorn Andersson
8757d5ff17 net: qrtr: Make qrtr_port_lookup() use RCU
The important part of qrtr_port_lookup() wrt synchronization is that the
function returns a reference counted struct qrtr_sock, or fail.

As such we need only to ensure that an decrement of the object's
refcount happens inbetween the finding of the object in the idr and
qrtr_port_lookup()'s own increment of the object.

By using RCU and putting a synchronization point after we remove the
mapping from the idr, but before it can be released we achieve this -
with the benefit of not having to hold the mutex in qrtr_port_lookup().

Change-Id: Ia9907a9c97a29e92a92e67afa988207f501a2f48
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Patch-mainline: linux-arm-kernel @ 07/05/19, 23:06
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-01 15:32:25 -07:00
Bjorn Andersson
332849c5f7 net: qrtr: Implement outgoing flow control
In order to prevent overconsumption of resources on the remote side QRTR
implements a flow control mechanism.

The mechanism works by the sender keeping track of the number of
outstanding unconfirmed messages that has been transmitted to a
particular node/port pair.

Upon count reaching a low watermark (L) the confirm_rx bit is set in the
outgoing message and when the count reaching a high watermark (H)
transmission will be blocked upon the reception of a resume_tx message
from the remote, that resets the counter to 0.

This guarantees that there will be at most 2H - L messages in flight.
Values chosen for L and H are 5 and 10 respectively.

Change-Id: Ifa3c0c5821d31e385c34428d0bd4f5b5eec2fb77
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Patch-mainline: linux-arm-kernel @ 07/05/19, 23:06
[clew@codeaurora.org: Fix uninitialized qrtr_tx_lock mutex]
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-01 15:32:25 -07:00
Bjorn Andersson
83e68efe5b net: qrtr: Migrate node lookup tree to spinlock
Move operations on the qrtr_nodes radix tree under a separate spinlock
and make the qrtr_nodes tree GFP_ATOMIC, to allow operation from atomic
context in a subsequent patch.

Change-Id: I8f5ce15edf6043e5b27ef280f1c09f4c64ebe3bb
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Patch-mainline: linux-arm-kernel @ 07/05/19, 23:06
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-01 15:32:25 -07:00
Bjorn Andersson
549c20c91a net: qrtr: Move resume-tx transmission to recvmsg
The confirm-rx bit is used to implement a per port flow control, in
order to make sure that no messages are dropped due to resource
exhaustion. Move the resume-tx transmission to recvmsg to only confirm
messages as they are consumed by the application.

Change-Id: Icd990ef9dc46c983c9231fe1e72ba9dcbef5a0c3
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Patch-mainline: linux-arm-kernel @ 07/05/19, 23:06
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-01 15:32:25 -07:00
Bjorn Andersson
a1811128de net: qrtr: Stop rx_worker before freeing node
As the endpoint is unregistered there might still be work pending to
handle incoming messages, which will result in a use after free
scenario. The plan is to remove the rx_worker, but until then (and for
stable@) ensure that the work is stopped before the node is freed.

Change-Id: Ic35d1c0f5e5e4f297c7c05dd09c7c8a4d8b23cf4
Fixes: bdabad3e36 ("net: Add Qualcomm IPC router")
Cc: stable@vger.kernel.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Git-commit: 73f0c11d11
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-01 15:28:09 -07:00
Jay Jayanna
f1d8e56eb5 rpmsg: Add snapshot of RPMSG drivers for lahaina
This snapshot is taken as of msm-4.19 'commit <d2f41beab007i>
("Merge "msm: npu: Add bandwidth monitor support"")'.

This change brings the rpmsg and rpmsg glink drivers up to date with
the fixes from msm-4.19. In addition, change the copyrights to SPDX format.

Also, irq_set_affinity and sched_setaffinity can not be used when compiling
a driver as a module. Hence, moving to module-friendly APIs.

Change-Id: Id8c0bd13535c91cbecb11445bf798be44083abb6
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
2019-10-01 15:16:41 -07:00