Skip to content

Commit 6bf68cb

Browse files
Sricharan Randersson
authored andcommitted
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>
1 parent 1d2ea36 commit 6bf68cb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/rpmsg/qcom_glink_native.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/platform_device.h>
2424
#include <linux/regmap.h>
2525
#include <linux/rpmsg.h>
26+
#include <linux/sizes.h>
2627
#include <linux/slab.h>
2728
#include <linux/workqueue.h>
2829
#include <linux/mailbox_client.h>
@@ -1001,6 +1002,25 @@ static struct rpmsg_endpoint *qcom_glink_create_ept(struct rpmsg_device *rpdev,
10011002
return ept;
10021003
}
10031004

1005+
static int qcom_glink_announce_create(struct rpmsg_device *rpdev)
1006+
{
1007+
struct glink_channel *channel = to_glink_channel(rpdev->ept);
1008+
struct glink_core_rx_intent *intent;
1009+
struct qcom_glink *glink = channel->glink;
1010+
int num_intents = glink->intentless ? 0 : 5;
1011+
1012+
/* Channel is now open, advertise base set of intents */
1013+
while (num_intents--) {
1014+
intent = qcom_glink_alloc_intent(glink, channel, SZ_1K, true);
1015+
if (!intent)
1016+
break;
1017+
1018+
qcom_glink_advertise_intent(glink, channel, intent);
1019+
}
1020+
1021+
return 0;
1022+
}
1023+
10041024
static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
10051025
{
10061026
struct glink_channel *channel = to_glink_channel(ept);
@@ -1076,6 +1096,7 @@ static struct device_node *qcom_glink_match_channel(struct device_node *node,
10761096

10771097
static const struct rpmsg_device_ops glink_device_ops = {
10781098
.create_ept = qcom_glink_create_ept,
1099+
.announce_create = qcom_glink_announce_create,
10791100
};
10801101

10811102
static const struct rpmsg_endpoint_ops glink_endpoint_ops = {

0 commit comments

Comments
 (0)