There is a race for clients that open sockets before the control port
is bound. If a client gets an idr that was allocated before the control
port is bound, there is a chance the previous address owner sent lookup
packets to the control port. The new address owner will get residual
responses to this the lookup packets.
Change the idr_alloc to idr_alloc_cyclic so new idr's are allocated
instead of trying to reuse the freed idrs.
Change-Id: Ie1bda7a818309503f80542e739bac646327296f7
Signed-off-by: Chris Lew <clew@codeaurora.org>
There is a chance for a remote processor to become unresponsive while
QRTR is trying to broadcast a control message. This results in the node
lock being held for an extended period of time and prevents node lookup
which is needed to send messages.
Change the mutex to a rw_semaphore to allow concurrency during node
lookups and broadcasts.
Change-Id: I2e3fdde22edaac64f164cf08900e9d09b16c380d
Signed-off-by: Chris Lew <clew@codeaurora.org>
A remote endpoint should not need to know when a client socket is freed
if the socket never established commnication with the endpoint. Add a
mode to keep track of which endpoints a socket communicates with.
There are three modes a socket can be in:
INIT - Socket has not sent anything or only local messages,
only send client close to local services.
SINGLE - Socket has sent messages to a single ept, send event
to this single ept.
MULTI - Socket has sent messages to multiple epts, broadcast
release of this socket.
Server state changes should be broadcast throughout the system. Change
the ipc state of a port when it sends a NEW SERVER control packet. This
ensures the DEL CLIENT control packet is propagated correctly for
servers.
This change squashes the following commits from msm-4.14:
commit 3373eb77cd6d ("net: qrtr: Add socket mode optimization")
commit d984a2d6f150 ("net: qrtr: Make servers multi state ports")
In addition, fix minor format issues.
Change-Id: I416742cff598bf7aa9da2baa2e86a53b18367870
Signed-off-by: Chris Lew <clew@codeaurora.org>
There is a race where broadcast packets can be sent to a node that has
not sent the hello message to the remote processor. This breaks the
protocol expectation. Add a status variable to track when the hello
packet has been sent.
An alternative solution attempted was to remove the nodes from the
broadcast list until the hello packet is sent. This is not a valid
solution because hello messages are broadcasted if the ns is restarted
or started late. There needs to be a status variable separate from the
broadcast list.
This change squashes the following commits from msm-4.14:
commit abd3961d05be ("qrtr: Only broadcast to initialized nodes")
commit 90cb0e473226 ("net: qrtr: Do not send packets before Hello
negotiation")
commit 07abd1abe803 ("net: qrtr: Fix hello packet drop memory leak")
In addition, fix minor format issues.
Change-Id: I2a55e587f324e64e2bde4ea634de66008f190de1
Signed-off-by: Chris Lew <clew@codeaurora.org>
Island IO can be assigned to Apps TLMM dynamically
if that island is not using the pin for any connectivity.
Add support for enabling EGPIO feature if the pin can
support it. EGPIO_PRESENT bit shows if EGPIO feature
is present or not for particular pin. Once EGPIO_ENABLE
bit is set the pin is now controlled by Apps TLMM.
When pinctrl properties are getting initialized by device
driver framework, pin functions select would call to
msm_pinmux_set_mux function to select pin function and
enable EGPIO.
Change-Id: I64514904096286f2a5df351880cd56d753f0658f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Lahaina uses different pipe endpoint mappings and group resources.
This change captures these configurations.
Change-Id: Ib45848bb52d9a6680b38b4305cbab38c0b00e7d2
Acked-by: Priyadarshini Rajagopal <prajagop@qti.qualcomm.com>
Signed-off-by: Bojun Pan <bojunp@codeaurora.org>
Remote IPC Router drivers expect the received packet to be aligned.
This case is only exposed using the MHI transport because it does not
ensure the packet will be received as one chunk like RPMSG GLINK.
Change-Id: I0e5c27e3c5896e6721c8bbbfcda29551f0968626
Signed-off-by: Chris Lew <clew@codeaurora.org>
Rather than enqueuing messages and scheduling a worker to deliver them
to the individual sockets we can now, thanks to the previous work, move
this directly into the endpoint callback.
This saves us a context switch per incoming message and removes the
possibility of an opportunistic suspend to happen between the message is
coming from the endpoint until it ends up in the socket's receive
buffer.
Change-Id: I7177fa36f9d7cc7e5de5f24975f15284ef1fcc80
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>
sk_user_data can be protected with RCU instead of calling the callback
rwlock. RCU will ensure the pointer obtained in qmi_data_ready is
formed properly and cleanup can synchronize before continuing in handle
release.
Change-Id: I6a687bd7b311fe169a89cb959ae755730b81a9f1
Signed-off-by: Chris Lew <clew@codeaurora.org>
Add a Kconfig flag to differentiate between a GKI and an Non GKI build.
CONFIG_QGKI is enabled if the build is a Non GKI variant (QGKI or debug).
This flag doesn't differentiate between QGKI and debug variants.
Change-Id: I6b53b1e0e4c071fc7d9b365ff374ffe4e8b3e8ba
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
The APIs fdt_path_offset() and fdt_getprop_w() are not exported.
As a result, drivers that are compiled as modules cannot directly
use them. Hence, switch to of_find_node_by_path() and
of_property_read_u32() to achive the same functionality while also
being module friendly.
Change-Id: I90b299c60b60a006d0932442549c5d5a20cf2ea0
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Ensure that the secure buffer device is set only if dma_set_mask()
occurs successfully.
Change-Id: I9b84692b2860bafd8fe645b95e05d6436698d840
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Fix the context fault interrupt test so that it can use
the abstracted context bank read/write routines.
Change-Id: I58ba80bd5e96b1cbcc68d5f8bc16150e9d335226
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Migrate to using bitfields for the TBU debug registers.
Change-Id: Iac1321784969018a3ad8757bcafbcb986c58be76
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This snapshot is taken as of msm-4.19 'commit <c01ec6b5c60a8>'
'("geni-qcom-se: Reduce the ab of QUP Core2x clock")'.
Change-Id: Ia40e9d48bca27bb253cbf73ad9fcde9d087820d3
Signed-off-by: Akash Asthana <akashast@codeaurora.org>
This snapshot taken as of msm-4.19 'commit <5d5df09fbdf5>'
'("qcom_geni_se: Add a check in QUP common driver to vote for BW")'
GENI serial engine driver provides common functionality used by
other serial bus drivers (such as I2c, SPI, UART), and does
resource management for those drivers. Add ICC API support also.
Change-Id: I088457bbfa654253f7afe797ea3f89f63d06e823
Signed-off-by: Akash Asthana <akashast@codeaurora.org>
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>
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>
Enable the refgen regulator driver so that consumers can manage
the south refgen state.
Change-Id: I136a6fb5911dd6cc9f1a89c47f27c42f4d7ec0fc
Signed-off-by: David Collins <collinsd@codeaurora.org>
Some Qualcomm Technologies, Inc. SoCs such as SDM845 utilize
reference bias generators for various internal PHY blocks. These
are called REFGENs. Add a driver to support REFGEN so that
consumers can vote based upon their runtime hardware needs.
Change-Id: I60681273cc1f9842844968bf4f0f682cdd28eb0d
Signed-off-by: David Collins <collinsd@codeaurora.org>