GPIOs that can be configured as wakeup are routed to the PDC wakeup
interrupt controller and from there to the GIC interrupt controller. On
some QCOM SoCs, the interface to the GIC for wakeup capable GPIOs have
additional hardware registers that need to be configured as well to
match the trigger type of the GPIO. This register interfaces the PDC to
the GIC and therefore updated from the PDC driver.
Typically, the firmware intializes the interface registers for the
wakeup capable GPIOs with commonly used GPIO trigger type, but it is
possible that a platform may want to use the GPIO differently. So, in
addition to configuring the PDC, configure the interface registers as
well.
Change-Id: Icab7d9eeb77b5dab9d6a5a8280ce568da40b6ca6
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Add irqchip calls to set/get interrupt state from the parent interrupt
controller. When GPIOs are renabled as interrupt lines, it is desirable
to clear the interrupt state at the GIC. This avoids any unwanted
interrupt as a result of stale pending state recorded when the line was
used as a GPIO.
Change-Id: Ibd551f84d8f6ae15b8d9702faeb585a69f283f6e
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Enable a check to see if devices with reserved memory regions allocate from
those regions, when using the DMA API for allocations. WARN_ON if check
doesn't pass.
Change-Id: Ic788dc4638d83cdf8a1e34f60efe678b9639d4b3
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
Inside of dma_alloc_attrs(), verify that devices with a reserved memory
region are actually using the region, in order to prevent wastage of
memory.
Change-Id: I56852a761d3253ec2a3a7db0f6501c73983e55c6
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
Add version check for FnR stats ioctl and error return,
since only IPA4.5+ HW will support this feature.
Change-Id: If5c5021d16bc1ee6af516d9e2200c3e6b5081d27
Signed-off-by: Bojun Pan <bojunp@codeaurora.org>
Add uc event ring to have ipa-uc monitor the
quota and bw-voting threshold to generate the
irq to ipa-driver to inform if quota or and bw
threshold is hit.
Change-Id: I7ce9c1a0048016fc6b6248a1632365f51717422c
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Access ipa3_ctx through ipa_utils.c instead of direct access
which is prohibited.
Change-Id: I1682037cf845d3d8553966551410ff5e8a833f84
Acked-by: Suhas Mallesh <smallesh@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Adding a function to check for dangling pointer using IPA IDR structure
to avoid use after free error.
Change-Id: I0bd3d733bf10403366abc643f89c3e5c5e6228e9
Acked-by: Suhas Mallesh <smallesh@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
The same QMI transaction data is synchronized using two mutex locks.
Remove ineffective transaction mutex lock because it is always
covered by QMI txn_lock with same purpose.
CRs-Fixed: 2470638
Change-Id: If53e006436c77d572b2d69507e1593e3d57e1cd4
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Mutex lock not released before function return in failure case.
Add mutex unlock in failure case.
CRs-Fixed: 2463072
Change-Id: I68b23364e8cb1001c0a65b1b831fd3b68894e1a9
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Add an api for clients to set the send timeout of the underlying qrtr
socket. QMI sets this timeout to 10 seconds by default but this is too
long for some clients in critical paths.
Change-Id: I4c892a2f034c87b6bf2f71664369140910e72383
Signed-off-by: Chris Lew <clew@codeaurora.org>
txn idr entry contains local pointer, which can go out of context
if the calling function exits. Qmi handle can be released from other
thread context(SSR), where iterating over pending transactions list
if txn idr entry is not removed it results in crash in next iteration
as the previous txn idr entry is not valid.
CR-Fixed: 2373541
Change-Id: I0c96a575fb198115532de9977095f2c056742b33
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Receiving data on a socket which is getting closed by client at same time
can cause invalid pointer access.
Use sk_callback_lock to sync between data_read callback and socket close.
CRs-Fixed: 2372711
Change-Id: I98951a86a6a53bf196026a342ec4fff726bedf92
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
of_parse_phandle() is used to deduce if a memory region is
associated with a particular device. The call to of_parse_phandle()
internally increments the reference count to the memory region's
of_node, and thus, the caller should reverse that action by
decrementing it via a call to of_node_put().
Change-Id: I80a0ed843312229f277c09fe107e407118a0a473
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Use rate-limited prints when an ION buffer should not be
mapped to userspace. This prevents the kernel logs from being
flooded by failures triggered by continuous userspace requests
to map a buffer that should not be mapped to it.
Change-Id: I5f4a1bc1fab7424588e68a55cb18aa28e969841c
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This reverts commit b0cbb06dd1.
This commit is no longer needed, since the ION core now allows
for dmabuf ops to be overridable.
Change-Id: I32def4db2d7de97f465a82531367c78eeae8a4a1
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Since the dmabuf portion of the ION core now allows for heaps
to specify their own dmabuf ops for cache maintenance, update
the heaps so that they specify the MSM ION dmabuf ops.
Change-Id: I98d9f2fa3e3ab8288e481c72e18e5d2f14a8a400
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Update the heap IDs as per the standard imposed by the ION
core (i.e.):
SYSTEM_HEAP: (1 << 0)
SYSTEM_CONTIG_HEAP: (1 << 1)
CARVEOUT_HEAPS: [(1 << 2), (1 << 6)]
CHUNK_HEAP: (1 << 7)
CMA_HEAPS: [(1 << 8), (1 << 15)]
VENDOR_HEAPS: [(1 << 16), (1 << 31)]
Since the heap IDs are now bitmasks, as opposed to offsets
within a bitmask, update the userspace ION_HEAP() macro/as
well as the heap ID treatment in the kernel to account for
this as well.
Change-Id: I6b7ca1caf89dda03dfb499a362db863168c2753c
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Add a reference to the MSM ION heap ID header as part of the
dt-bindings headers, so that the device-tree can reference
the heap IDs via the defined macros.
Change-Id: I7fd7e45e8a61908b037a421b08f4ba8b4ddebfbf
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The ION heap IDs are also needed by the device-tree to
provide the kernel with the heap ID for the heap that
a device-tree entry describes. Currently, these IDs are
hard-coded, which can be error-prone when updating the
heap IDs.
Thus, create a header that can also be accessed by the
device-tree and userspace, and move the heap IDs to that
header. This makes it so that the device-tree can now use
the constants defined in the header, instead of hard-coded
IDs, making updates significantly easier.
Change-Id: I58b1aae9924504f2b20e159b9be8da7a2ee8d248
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Introduce a new domain for wakeup capable GPIOs. The domain can be
requested using the bus token DOMAIN_BUS_WAKEUP. In the following
patches, we will specify PDC as the wakeup-parent for the TLMM GPIO
irqchip. Requesting a wakeup GPIO will setup the GPIO and the
corresponding PDC interrupt as its parent.
Change-Id: I13b206773e5f04452eed87ad1490da50b034ac4c
Co-developed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Change the if condition to be inclusive to allow remove_offload
ioctl to send the rmv_offload_request through qmi on the last
connection.
Change-Id: I6eec7799fd1a76ab168bc588b3e9c74dbfd215fd
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Remove code check-in not belonging to IPA driver.
Change-Id: I6f79d72d054c7c3b9d5448ae83150d5afaedacff
Signed-off-by: Bojun Pan <bojunp@codeaurora.org>
Remove the cpu affinity of ion pool refill kthreads which were
binded to min capability cpus, since there was no observable
power impact with when not affined.
Note: It was found that the code to create cpumask for min
capability cpus was broken and kthreads were free to run on
any cpus. No observable power impact was seen, hence better
off with removing this code entirely.
Change-Id: If6a32d9e4d3c576e63e3b0ec405be1fd4639a5e0
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Ratelimit warning messages to prevent unnecessary log spam.
Change-Id: I61f4a4b65f516650cd9324ccf087639d6ea27da1
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The less said about "~12UL" the better. Oh dear.
We get away with it due to calling constraints that mean IOVAs are
implicitly at least page-aligned to begin with, but still; oh dear.
Change-Id: I8e4ed0ccc1aae76988449895e6f7a9944d429af6
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Git-commit: 353b325047
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Instead of using a symlink to point to the MSM ION header,
place it directly in the include/uapi/linux path.
Change-Id: Id2a91adb4bdfc2c03e8eb535882734603ccd0f94
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The system secure heap relies on the existence of the system
heap. Thus, if the system heap is not available, do not create,
the system secure heap.
Change-Id: I7a99e0fda45ae02ed6e5c8a797d29e917e84f182
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
KW tool detect the potential NULL access and buffer
index overflow issue.
The change is to add the proper handle for NULL response
and prevent buffer index overflow.
Change-Id: I0bb1b45ba6e5b0abe6c3539d451f74e19028737c
Signed-off-by: Bojun Pan <bojunp@codeaurora.org>