summaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg
Commit message (Collapse)AuthorAgeFilesLines
* rpmsg: core: Make remove handler for rpmsg driver optional.Pi-Hsun Shih2019-05-221-1/+2
| | | | | | | | Most other bus (for example, SPI, i2c) have the remove handler for driver optional. Make remove handler for rpmsg driver optional too. Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: virtio: change header file sort styleLoic Pallardy2019-02-211-9/+9
| | | | | | | Make header files alphabetical order. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: virtio: allocate buffer from parentLoic Pallardy2019-02-211-3/+3
| | | | | | | | | | | | Remoteproc is now capable to create one specific sub-device per virtio link to associate a dedicated memory pool. This implies to change device used by virtio_rpmsg for buffer allocation from grand-parent to parent. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Anup Patel <anup@brainfault.org> Tested-by: Anup Patel <anup@brainfault.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: smem: Support rx peak for size less than 4 bytesArun Kumar Neelakantam2018-10-041-8/+4Star
| | | | | | | | | | | | The current rx peak function fails to read the data if size is less than 4bytes. Use memcpy_fromio to support data reads of size less than 4 bytes. Cc: stable@vger.kernel.org Fixes: f0beb4ba9b18 ("rpmsg: glink: Remove chunk size word align warning") Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: fix memory leak on channel createColin Ian King2018-09-281-2/+5
| | | | | | | | | | | | | Currently a failed allocation of channel->name leads to an immediate return without freeing channel. Fix this by setting ret to -ENOMEM and jumping to an exit path that kfree's channel. Detected by CoverityScan, CID#1473692 ("Resource Leak") Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Cc: stable@vger.kernel.org Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: Remove chunk size word align warningChris Lew2018-09-011-3/+0Star
| | | | | | | | | | It is possible for the chunk sizes coming from the non RPM remote procs to not be word aligned. Remove the alignment warning and continue to read from the FIFO so execution is not stalled. Signed-off-by: Chris Lew <clew@codeaurora.org> Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Convert to using %pOFn instead of device_node.nameRob Herring2018-08-282-2/+2
| | | | | | | | | | | In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Ohad Ben-Cohen <ohad@wizery.com> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: linux-remoteproc@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: char: Migrate to iter versions of read and writeBjorn Andersson2018-08-281-11/+16
| | | | | | | | | | | In order to be able to use the aio interface for writing to a rpmsg_char the write_iter function must be implemented, so migrate to iter version for read and write functions. Regular read and write uses the iter methods if present and is as such unaffected. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Add compat ioctl for rpmsg char driverArun Kumar Neelakantam2018-07-311-0/+2
| | | | | | | Add compat ioctl callback to support 32bit user space applications. Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: Store edge name for glink deviceChris Lew2018-07-311-0/+6
| | | | | | | | | | Channels may need to identify the edge their channel was probed for. Store the edge name by reading the label property from device tree or default to the node name. Signed-off-by: Chris Lew <clew@codeaurora.org> Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: core: add support to power domains for devicesSrinivas Kandagatla2018-07-311-0/+7
| | | | | | | | | | | | | Some of the rpmsg devices need to switch on power domains to communicate with remote processor. For example on Qualcomm DB820c platform LPASS power domain needs to switched on for any kind of audio services. This patch adds the missing power domain support in rpmsg core. Without this patch attempting to play audio via QDSP on DB820c would reboot the system. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: fix kerneldoc warningsSrinivas Kandagatla2018-07-311-1/+8
| | | | | | | | | | | | | | | | This patch fixes below kerneldoc warnings qcom_smd.c:141: warning: Function parameter or member 'dev' not described in 'qcom_smd_edge' qcom_smd.c:141: warning: Function parameter or member 'name' not described in 'qcom_smd_edge' qcom_smd.c:141: warning: Function parameter or member 'new_channel_event' not described in 'qcom_smd_edge' qcom_smd.c:222: warning: Function parameter or member 'qsept' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'registered' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'state_change_event' not described in 'qcom_smd_channel' qcom_smd.c:222: warning: Function parameter or member 'drvdata' not described in 'qcom_smd_channel' qcom_smd.c:737: warning: Function parameter or member 'wait' not described in '__qcom_smd_send' Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: Fix various kerneldoc warnings.Srinivas Kandagatla2018-07-311-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix below kerneldoc warnings while building with W=1 qcom_glink_native.c:53: warning: Function parameter or member 'data' not described in 'glink_defer_cmd' qcom_glink_native.c:75: warning: Function parameter or member 'data' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'id' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'size' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'reuse' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'in_use' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'offset' not described in 'glink_core_rx_intent' qcom_glink_native.c:75: warning: Function parameter or member 'node' not described in 'glink_core_rx_intent' qcom_glink_native.c:116: warning: Function parameter or member 'features' not described in 'qcom_glink' qcom_glink_native.c:116: warning: Function parameter or member 'intentless' not described in 'qcom_glink' qcom_glink_native.c:524: warning: Function parameter or member 'version' not described in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Function parameter or member 'features' not described in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Excess function parameter 'r_version' description in 'qcom_glink_receive_version' qcom_glink_native.c:524: warning: Excess function parameter 'r_features' description in 'qcom_glink_receive_version' qcom_glink_native.c:551: warning: Function parameter or member 'version' not described in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Function parameter or member 'features' not described in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Excess function parameter 'r_version' description in 'qcom_glink_receive_version_ack' qcom_glink_native.c:551: warning: Excess function parameter 'r_features' description in 'qcom_glink_receive_version_ack' qcom_glink_native.c:570: warning: bad line: wire format and transmit qcom_glink_native.c:604: warning: Function parameter or member 'intent' not described in 'qcom_glink_advertise_intent' qcom_glink_native.c:604: warning: Excess function parameter 'size' description in 'qcom_glink_advertise_intent' qcom_glink_native.c:710: warning: Function parameter or member 'glink' not described in 'qcom_glink_handle_intent_req' qcom_glink_native.c:710: warning: Function parameter or member 'cid' not described in 'qcom_glink_handle_intent_req' qcom_glink_native.c:710: warning: Function parameter or member 'size' not described in 'qcom_glink_handle_intent_req' Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: correctly annotate intent membersSrinivas Kandagatla2018-07-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | As intent structure members are not correctly annotated, leading to below warnings qcom_glink_native.c:614:16: warning: incorrect type in assignment (different base types) qcom_glink_native.c:614:16: expected unsigned short [unsigned] [usertype] id qcom_glink_native.c:614:16: got restricted __le16 [usertype] <noident> qcom_glink_native.c:615:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:615:18: expected unsigned short [unsigned] [usertype] lcid qcom_glink_native.c:615:18: got restricted __le16 [usertype] <noident> qcom_glink_native.c:616:19: warning: incorrect type in assignment (different base types) qcom_glink_native.c:616:19: expected unsigned int [unsigned] [usertype] count qcom_glink_native.c:616:19: got restricted __le32 [usertype] <noident> qcom_glink_native.c:617:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:617:18: expected unsigned int [unsigned] [usertype] size qcom_glink_native.c:617:18: got restricted __le32 [usertype] <noident> qcom_glink_native.c:618:18: warning: incorrect type in assignment (different base types) qcom_glink_native.c:618:18: expected unsigned int [unsigned] [usertype] liid qcom_glink_native.c:618:18: got restricted __le32 [usertype] <noident> Fix this by correctly annotating them. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: Add missing include of sizes.hNiklas Cassel2018-07-021-0/+1
| | | | | | | | | | | | Add missing include of sizes.h. drivers/rpmsg/qcom_smd.c: In function ‘qcom_smd_channel_open’: drivers/rpmsg/qcom_smd.c:809:36: error: ‘SZ_4K’ undeclared (first use in this function) bb_size = min(channel->fifo_size, SZ_4K); ^~~~~ Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: do not use mananged resources for endpoints and channelsSrinivas Kandagatla2018-06-041-9/+9
| | | | | | | | | | | | | | | | | | All the managed resources would be freed by the time release function is invoked. Handling such memory in qcom_smd_edge_release() would do bad things. Found this issue while testing Audio usecase where the dsp is started up and shutdown in a loop. This patch fixes this issue by using simple kzalloc for allocating channel->name and channel which is then freed in qcom_smd_edge_release(). Without this patch restarting a remoteproc would crash the system. Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Cc: <stable@vger.kernel.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: char: Switch to SPDX license identifierSuman Anna2018-06-041-9/+1Star
| | | | | | | | | | | Use the appropriate SPDX license identifier in the rpmsg char driver source file and drop the previous boilerplate license text. The uapi header file already had the SPDX license identifier added as part of a mass update but the license text removal was deferred for later, and this patch drops the same. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: Switch to SPDX license identifierSuman Anna2018-06-044-36/+4Star
| | | | | | | | | Use the appropriate SPDX license identifier in various rpmsg glink driver source files and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: Switch to SPDX license identifierSuman Anna2018-06-041-9/+1Star
| | | | | | | | Use the appropriate SPDX license identifier in the rpmsg SMD backend driver source file and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: virtio_rpmsg_bus: Switch to SPDX license identifierSuman Anna2018-06-041-9/+1Star
| | | | | | | | | Use the appropriate SPDX license identifier in the virtio rpmsg bus driver source file and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Switch to SPDX license identifierSuman Anna2018-06-043-18/+4Star
| | | | | | | | Use the appropriate SPDX license identifier in the rpmsg core source files and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* Merge tag 'v4.17-rc4' into rpmsg-nextBjorn Andersson2018-05-091-0/+2
|\ | | | | | | | | | | Pick up fixes from rproc-v4.17-1 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: added MODULE_ALIAS for rpmsg_charRamon Fried2018-04-261-0/+2
| | | | | | | | | | | | | | | | Added "rpmsg:rpmsg_chrdev" MODULE_ALIAS to autoload rpmg_chrdev module automatically. Signed-off-by: Ramon Fried <rfried@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: qcom_smd: Access APCS through mailbox frameworkBjorn Andersson2018-04-262-19/+50
| | | | | | | | | | | | | | | | | | Attempt to acquire the APCS IPC through the mailbox framework and fall back to the old syscon based approach, to allow us to move away from using the syscon. Reviewed-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | rpmsg: Add driver_override device attribute for rpmsg_deviceAnup Patel2018-04-261-0/+39
|/ | | | | | | | | | | | | | | This patch adds "driver_override" device attribute for rpmsg_device which will allow users to explicitly specify the rpmsg_driver to be used via sysfs entry. The "driver_override" device attribute implemented here is very similar to "driver_override" implemented for platform, pci, and amba bus types. One important use-case of "driver_override" device attribute is to force use of rpmsg_chrdev driver for certain rpmsg_device instances. Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: Use announce_create to process any receive workBjorn Andersson2018-03-281-0/+18
| | | | | | | | | | | | | It is possible that incoming data arrives before the client driver has reached a point in the probe method where adequate context for handling the incoming message has been established. In the event that the client's callback function returns an error the message will be left on the FIFO and by invoking the receive handler after the device has been probed the message will be picked off the FIFO and the callback invoked again. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: Only invoke announce_create for rpdev with endpointsBjorn Andersson2018-03-281-1/+1
| | | | | | | | For special rpmsg devices without a primary endpoint there is nothing to announce so don't call the backend announce create function if we didn't create an endpoint. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: Fix container_of macrosBjorn Andersson2018-03-281-2/+2
| | | | | | | | The container_of macros should not use the same name for the parameter as the member to use for lookup, as this will result in a compilation error unless the passed parameter has the same name as the member. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* Revert "rpmsg: smd: Create device for all channels"Bjorn Andersson2018-03-271-0/+5
| | | | | | | | | | | | | | | | | | | In an effort to pick up channels that are in a funky state we optimistically tried to open all channels that we found, with the addition that we failed if the other side did not handshake the opening. But as we're starting the modem a second time all channels are found - in a "funky" state - and we try to open them. But the modem firmware requires the IPCRTR to be up in order to initialize. So any channels we try to open before that will fail and will not be opened again. This takes care of the regression, at the cost of reintroducing the previous behavior of handling of channels with "funky" states. Reverts commit c12fc4519f60 ("rpmsg: smd: Create device for all channels") Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: Use spinlock in tx pathBjorn Andersson2018-03-201-7/+11
| | | | | | | | | | | | | Switch the tx_lock to a spinlock we allow clients to use rpmsg_trysend() from atomic context. In order to allow clients to sleep while waiting for space in the FIFO we release the lock temporarily around the delay; which should be replaced by sending a READ_NOTIF and waiting for the remote to signal us that space has been made available. Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: Use spinlock in tx pathBjorn Andersson2018-03-201-10/+11
| | | | | | | | | | | | | By switching the tx_lock to a spinlock we allow clients to use rpmsg_trysend() from atomic context. The mutex was interruptable as it was previously held for the duration of some client waiting for available space in the FIFO, but this was recently changed to only be held temporarily - allowing us to replace it with a spinlock. Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: smd: use put_device() if device_register failArvind Yadav2018-03-181-1/+2
| | | | | | | | | if device_register() returned an error! Always use put_device() to give up the reference initialized. unregister device for other return error. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* rpmsg: glink: use put_device() if device_register failArvind Yadav2018-03-181-1/+2
| | | | | | | | | if device_register() returned an error! Always use put_device() to give up the reference initialized. And unregister device for other return error. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds2018-02-112-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge tag 'rpmsg-v4.16' of git://github.com/andersson/remoteprocLinus Torvalds2018-02-053-18/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * rpmsg: smd: Fix double unlock in __qcom_smd_send()Dan Carpenter2018-01-191-5/+5
| | | | | | | | | | | | | | | | | | 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>
| * rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()Wei Yongjun2018-01-021-0/+1
| | | | | | | | | | | | | | | | | | | | qcom_glink_alloc_channel() allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: smd: Don't hold the tx lock during waitBjorn Andersson2017-12-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * rpmsg: smd: Fail send on a closed channelBjorn Andersson2017-12-191-6/+8
| | | | | | | | | | | | | | 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>
| * rpmsg: smd: Wake up all waitersBjorn Andersson2017-12-191-2/+2
| | | | | | | | | | | | | | | | 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>
| * rpmsg: smd: Create device for all channelsBjorn Andersson2017-12-191-5/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * rpmsg: smd: Perform handshake during openBjorn Andersson2017-12-191-0/+30
| | | | | | | | | | | | | | | | 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>
| * rpmsg: glink: smem: Ensure ordering during txBjorn Andersson2017-12-191-0/+3
| | | | | | | | | | | | | | | | | | Ensure the ordering of the fifo write and the update of the write index, so that the index is not updated before the data has landed in the fifo. Acked-By: Chris Lew <clew@codeaurora.org> Reported-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * drivers: rpmsg: remove duplicate includesPravin Shedge2017-12-061-2/+0Star
| | | | | | | | | | | | | | | | These duplicate includes have been found with scripts/checkincludes.pl but they have been removed manually to avoid removing false positives. Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | the rest of drivers/*: annotate ->poll() instancesAl Viro2017-11-284-6/+6
|/ | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge tag 'rpmsg-v4.15' of git://github.com/andersson/remoteprocLinus Torvalds2017-11-182-12/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rpmsg updates from Bjorn Andersson: - turn RPMSG_VIRTIO into a user selectable config - fix few bugs in GLINK - provide the support for specifying initial buffer sizes for GLINK channels. * tag 'rpmsg-v4.15' of git://github.com/andersson/remoteproc: rpmsg: glink: The mbox client knows_txdone rpmsg: glink: Add missing MODULE_LICENSE rpmsg: glink: Use best fit intent during tx rpmsg: glink: Add support to preallocate intents dt-bindings: soc: qcom: Support GLINK intents rpmsg: glink: Initialize the "intent_req_comp" completion variable rpmsg: Allow RPMSG_VIRTIO to be enabled via menuconfig or defconfig
| * rpmsg: glink: The mbox client knows_txdoneBjorn Andersson2017-11-161-0/+1
| | | | | | | | | | | | | | As the GLINK driver is ticking the txdone of the mailbox channel (to implement the doorbell) it needs to set knows_txdone. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: glink: Add missing MODULE_LICENSEBjorn Andersson2017-11-151-0/+3
| | | | | | | | | | | | | | | | | | | | The qcom_glink_native driver is missing a MODULE_LICENSE(), correct this. Fixes: 835764ddd9af ("rpmsg: glink: Move the common glink protocol implementation to glink_native.c") Cc: stable@vger.kernel.org Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: glink: Use best fit intent during txChris Lew2017-10-311-3/+8
| | | | | | | | | | | | | | | | Intents can vary in size, try to find the best fitting remote intent instead of first fit when sending a message to the remote proc. Signed-off-by: Chris Lew <clew@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
| * rpmsg: glink: Add support to preallocate intentsChris Lew2017-10-311-8/+27
| | | | | | | | | | | | | | | | | | | | | | The base intents prequeued during channel creation may not satisfy a channel's throughput requirement. Add support for intents dt-binding to allow channels to specify the size and amount of intents to prequeue during endpoint announcement. Signed-off-by: Chris Lew <clew@codeaurora.org> [bjorn: Altered how defaults are expressed] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>