summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/qcom_smd.c
AgeCommit message (Collapse)Author
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-05Merge tag 'rpmsg-v4.16' of git://github.com/andersson/remoteprocLinus Torvalds
Pull rpmsg updates from Bjorn Andersson: "This fixes a few issues found in the SMD and GLINK drivers and corrects the handling of SMD channels that are found in an (previously) unexpected state" * tag 'rpmsg-v4.16' of git://github.com/andersson/remoteproc: rpmsg: smd: Fix double unlock in __qcom_smd_send() rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel() rpmsg: smd: Don't hold the tx lock during wait rpmsg: smd: Fail send on a closed channel rpmsg: smd: Wake up all waiters rpmsg: smd: Create device for all channels rpmsg: smd: Perform handshake during open rpmsg: glink: smem: Ensure ordering during tx drivers: rpmsg: remove duplicate includes remoteproc: qcom: Use PTR_ERR_OR_ZERO() in glink prob
2018-01-19rpmsg: smd: Fix double unlock in __qcom_smd_send()Dan Carpenter
We're not holding the lock here, so we shouldn't unlock. Fixes: 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> [bjorn: renamed "out" label to further distinguish the two exit paths] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-12-18rpmsg: smd: Don't hold the tx lock during waitBjorn Andersson
Holding the tx lock while waiting for tx-drain events from the remote side blocks try_send requests from failing quickly, so temporarily drop the tx lock while waiting. While this allows try_send to fail quickly it also could allow a subsequent send to succeed putting a smaller packet in the FIFO while we're waiting for room for our large packet. But as this lock is per channel we expect that clients with ordering concerns implements their own ordering mechanism. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-12-18rpmsg: smd: Fail send on a closed channelBjorn Andersson
Move the check for a closed channel out from the tx-full loop to fail any send request on a non-open channel. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-12-18rpmsg: smd: Wake up all waitersBjorn Andersson
It's possible to have multiple contexts waiting for new channel events and with an upcoming change it's possible to have multiple contexts waiting for a full FIFO. As such we need to wake them all up. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-12-18rpmsg: smd: Create device for all channelsBjorn Andersson
Rather than selectively creating devices only for the channels that the remote have moved to "opening" state let's create devices for all channels found. The driver model will match drivers to the ones we care about and attempt to open these. The one case where this fails is if the user loads a firmware that lacks a particular channel of the previous firmware that was running, in which case we would find the old channel and attempt to probe it. The channel opening handshake will ensure this will result in a graceful failure. The result of this patch is that we will actively open the RPM channel even though it's left in a state other than "opening" after the boot loader's closing of the channel. Tested-by: Will Newton <will.newton@gmail.com> Reported-by: Jeremy McNicoll <jmcnicol@redhat.com> Reported-by: Will Newton <will.newton@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-12-18rpmsg: smd: Perform handshake during openBjorn Andersson
Validate the the remote side is opening the channel that we've found by performing a handshake when opening the channel. Tested-by: Will Newton <will.newton@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28the rest of drivers/*: annotate ->poll() instancesAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-07-26rpmsg: qcom_smd: add of_node node to edge deviceSrinivas Kandagatla
This patch assigns the device node to the edge device, so that the edge device drivers could read required device tree properties. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-05-17rpmsg: Release rpmsg devices in backendsBjorn Andersson
The rpmsg devices are allocated in the backends and as such must be freed there as well. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-01-18rpmsg: smd: Register rpmsg user space interface for edgesBjorn Andersson
Create and register a rpmsg device for use with the rpmsg user space interface, allowing user space to access SMD channels. Also provide the "rpmsg_name" device attribute to expose the edge name in sysfs, allowing the user to write udev rules for specific rpmsg devices and their children. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-01-18rpmsg: qcom_smd: Implement endpoint "poll"Bjorn Andersson
Add support for polling the status of the write buffer so that user space can use rpmsg character devices in non-blocking mode. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-01-18rpmsg: qcom_smd: Add support for "label" propertyBjorn Andersson
Add support for the "label" property, used to give the edge a name other than the one of the DT node. This allows the implementor to provide consistently named edges when using the rpmsg character device. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-12-13Merge tag 'rpmsg-v4.10' of git://github.com/andersson/remoteprocLinus Torvalds
Pull rpmsg updates from Bjorn Andersson: "Argument validation in public functions, function stubs for COMPILE_TEST-ing clients, preparation for exposing rpmsg endponts to user space and minor Qualcomm SMD fixes" * tag 'rpmsg-v4.10' of git://github.com/andersson/remoteproc: dt-binding: soc: qcom: smd: Add label property rpmsg: qcom_smd: Correct return value for O_NONBLOCK rpmsg: Provide function stubs for API rpmsg: Handle invalid parameters in public API rpmsg: Support drivers without primary endpoint rpmsg: Introduce a driver override mechanism rpmsg: smd: Reduce restrictions when finding channel
2016-12-08rpmsg: qcom_smd: Correct return value for O_NONBLOCKBjorn Andersson
qcom_smd_send() should return -EAGAIN for non-blocking channels with insufficient space, so that we can propagate this event to user space. Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-11-14rpmsg: smd: Expose edge registration functionsBjorn Andersson
The edge registration functions is to be used from a remoteproc driver to register and unregister an edge as the remote processor comes and goes. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-10-31rpmsg: smd: Reduce restrictions when finding channelBjorn Andersson
SMD channels are created by the remotes in "opening" state, but sometimes as we close and try to reopen them they linger in closing state. Following the search for a matching channel the create_ept() will verify that the channel is in a suitable state, so we can lax the restrictions of the search function to work around above difference in behaviour. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Introduce Qualcomm SMD backendBjorn Andersson
This introduces a new rpmsg backend for the Qualcomm SMD system, allowing communication with various remote processors found in Qualcomm platforms. The implementation is based on, and intends to replace, drivers/soc/qcom/smd.c with the necessary adaptions for fitting with the rpmsg core. Based on original work by Sricharan R <sricharan@codeaurora.org> Cc: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>