From patchwork Wed Aug 16 17:19:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9904325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89AF26038C for ; Wed, 16 Aug 2017 17:23:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72A21205FC for ; Wed, 16 Aug 2017 17:23:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 675AE285F2; Wed, 16 Aug 2017 17:23:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87256205FC for ; Wed, 16 Aug 2017 17:23:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbdHPRXK (ORCPT ); Wed, 16 Aug 2017 13:23:10 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54276 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbdHPRU3 (ORCPT ); Wed, 16 Aug 2017 13:20:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2C7B460710; Wed, 16 Aug 2017 17:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1502904028; bh=uzDVgMAAVx1pzt/Ts/aV0DPye8IcKTnGdyjnJIIDQuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aNxV9AOSRDi16EVy5GRQ6uaLBIKrjdXKhqXlJtBb6s7yohK9w+AOF5PdXVTjunqTd BGoX2Fq6UazNcA/OyArpHTUTVcb+4Mz96bg8bmduC75yaSZQEcrKk6fEDam/TBvWIg MXgzkEeQWifBNfPPL7+VyLcBC9T9UhhTBxkRgzgE= Received: from srichara-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 221E460729; Wed, 16 Aug 2017 17:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1502904010; bh=uzDVgMAAVx1pzt/Ts/aV0DPye8IcKTnGdyjnJIIDQuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gpdL3MDnceHSz24rsxz5XxIZts37wV23aFVlPxkQUARLPQ60plvIZye6PWDtsPu7r NzsfWdhHWpxw/y5KN6a1+xx2wyxTTPq5I8bBfwV14OYAOrL0mqJVCNLh/NAxCVlWFz MVN+48uPlfEf3W/wDKrjUN9DiDDvrS3ck0Fcwcss= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 221E460729 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R To: ohad@wizery.com, bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sricharan@codeaurora.org Subject: [PATCH 14/18] rpmsg: glink: Add announce_create ops and preallocate intents Date: Wed, 16 Aug 2017 22:49:07 +0530 Message-Id: <1502903951-5403-15-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502903951-5403-1-git-send-email-sricharan@codeaurora.org> References: <1502903951-5403-1-git-send-email-sricharan@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Sricharan R Signed-off-by: Bjorn Andersson --- drivers/rpmsg/qcom_glink_native.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index b8db74a..c111046 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -995,6 +995,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); @@ -1070,6 +1089,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 = {