summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/qcom_glink_native.c
diff options
context:
space:
mode:
authorSricharan R <sricharan@codeaurora.org>2017-08-24 12:51:38 +0530
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-08-29 20:34:14 -0700
commit6bf68cbdf7df32d53fcf32a9615d00913eac8d23 (patch)
treed74912683b401ea58124dea3c797ef3f307e7413 /drivers/rpmsg/qcom_glink_native.c
parent1d2ea36eead91e77e2733000a7f8e81a87d30c52 (diff)
downloadlwn-6bf68cbdf7df32d53fcf32a9615d00913eac8d23.tar.gz
lwn-6bf68cbdf7df32d53fcf32a9615d00913eac8d23.zip
rpmsg: glink: Add announce_create ops and preallocate intents
Preallocate local intent buffers and pass the intent ids to the remote. This way there are some default intents available for the remote to start sending data without having to wait by sending intent requests. Do this by adding the rpmsg announce_create ops, which gets called right after the rpmsg device gets probed. Acked-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/qcom_glink_native.c')
-rw-r--r--drivers/rpmsg/qcom_glink_native.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 2ad171585d8f..da47c0066972 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -23,6 +23,7 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/rpmsg.h>
+#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/mailbox_client.h>
@@ -1001,6 +1002,25 @@ static struct rpmsg_endpoint *qcom_glink_create_ept(struct rpmsg_device *rpdev,
return ept;
}
+static int qcom_glink_announce_create(struct rpmsg_device *rpdev)
+{
+ struct glink_channel *channel = to_glink_channel(rpdev->ept);
+ struct glink_core_rx_intent *intent;
+ struct qcom_glink *glink = channel->glink;
+ int num_intents = glink->intentless ? 0 : 5;
+
+ /* Channel is now open, advertise base set of intents */
+ while (num_intents--) {
+ intent = qcom_glink_alloc_intent(glink, channel, SZ_1K, true);
+ if (!intent)
+ break;
+
+ qcom_glink_advertise_intent(glink, channel, intent);
+ }
+
+ return 0;
+}
+
static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
{
struct glink_channel *channel = to_glink_channel(ept);
@@ -1076,6 +1096,7 @@ static struct device_node *qcom_glink_match_channel(struct device_node *node,
static const struct rpmsg_device_ops glink_device_ops = {
.create_ept = qcom_glink_create_ept,
+ .announce_create = qcom_glink_announce_create,
};
static const struct rpmsg_endpoint_ops glink_endpoint_ops = {