From patchwork Thu Aug 24 07:21:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9919321 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 656DC60349 for ; Thu, 24 Aug 2017 07:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 539EC28BA8 for ; Thu, 24 Aug 2017 07:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47FF528BAD; Thu, 24 Aug 2017 07:38:38 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7EC328BA8 for ; Thu, 24 Aug 2017 07:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=PovOhNFm6bxhMJpeN16Kk78DTnlbX0qO2fS8/iAXCRk=; b=XZYyWKuh4S8Iy/HoLuUDHYO0yK qNMzTf1hcFmDOhzfmgRWLACJiE80Dq9JKKqrQZqbkYrE/Q9R0oESIQZAl/fTAXWTIP0e2LxDuDUx5 y/C5pxCaYcpF6INrDhbNg7wVB8efaagMZ/SSaLlkk4r85nfEMvQ96FQe+2Smd0ls6Ou8iwPd+u4m0 OJ7AsXURq3O3H0CIDZ4KrNgLlue6I9a4bkPOv+y4yoNzv+FkTSm9D3IRz6y7n+vlon2kDnYJ/AsGQ TKVxoHYzSvd+nic1z6fXt9RXmiFeIKgNBJi/HlCwAnxAAYxgZ/L1NjHzj93mrYRLh/p/RZ2wnKHoy wZrCJqSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkmiH-0007hl-M6; Thu, 24 Aug 2017 07:38:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkmhi-00075A-5L for linux-arm-kernel@bombadil.infradead.org; Thu, 24 Aug 2017 07:37:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=E62cjXV4biJERXWPFm01uqOWxZ61gJT/bGxGv7GPZtc=; b=hSu1hD79IWa7Q5NU7LOJUvzDL MYdM7uR3yU2xqMorXKO36QzKjjPCwYGxooqEGEDdTCImz11DqRa5S/j+ydjkVCg/LowcEuyhCb4NL BBxTodC6ZCY/bCdxRg86Qicx3CWoxP4voMe7dwdw38IUfnNBccxkHBbFuY25//+4vB1x5U9TUFXio ofVUGFQZrDsp8lliq2d+PIw82wdeT931FXnuxo30QGNDobr8bpIx2S4iViBFm/UvWejnUzg0B36G2 lJhNDzTvHnFNZdGFoMOQ8shuJK9FzRdqYTwFJk30ICZpNVaOzthf3Ky4n/r2cYkArl06D3vo/5DAv 6cUYLaF9g==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkmTw-0004pn-KF for linux-arm-kernel@lists.infradead.org; Thu, 24 Aug 2017 07:23:14 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9CC086071F; Thu, 24 Aug 2017 07:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503559374; bh=e7iawrMWt8vHNGzkJGlyDU0ZoYJwXJ1E3b9EFXNJCmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBQ6N/ivE0OPaM7Kr1M54R/QcrcALPafFua2Wr60OP72up9WZ0q93SynTv9KS8V25 2Oyo3NQRC0O+OwCSYuf0wT284u5rjb/AvWsM4Zn3ZfQOvFSZHcubYHpZ01u+8Dkpw5 fqa6/UPJaKnKZrhe+A62o+folp1yS8gD54mKTUTk= 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 399F9607DF; Thu, 24 Aug 2017 07:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503559364; bh=e7iawrMWt8vHNGzkJGlyDU0ZoYJwXJ1E3b9EFXNJCmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B7pCWJjT4E+tUcNDf1gECHx+iwcFLdK0tWKKsf4AW/zbewbd3kFjapAxOyhhlE7QU Pf7WLm//SZrV4Vq0AwU1B6gZ9MhPaO30tXzc+OxJPVK731oZJw6Z16wVyVB3wVMl3X YPUDu0AM0rNhLrhQv2zR0leq5DVODYU12MjpUYzE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 399F9607DF 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 Subject: [PATCH v2 16/20] rpmsg: glink: Add announce_create ops and preallocate intents Date: Thu, 24 Aug 2017 12:51:38 +0530 Message-Id: <1503559302-3744-17-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503559302-3744-1-git-send-email-sricharan@codeaurora.org> References: <1503559302-3744-1-git-send-email-sricharan@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170824_082312_974695_89931515 X-CRM114-Status: GOOD ( 18.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sricharan@codeaurora.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Acked-by: Arun Kumar Neelakantam --- 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 1458bdb..76ee86e 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1002,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); @@ -1077,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 = {