Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5097152rwe; Tue, 18 Apr 2023 01:54:14 -0700 (PDT) X-Google-Smtp-Source: AKy350ZPfd7AboIfBeFaMIobS77MwrJ63CIhq3dxBkLUI3KA3TWuwoltQ8VUYwjnWKpwMxV/Or+h X-Received: by 2002:a17:90a:74c7:b0:247:bd63:c3af with SMTP id p7-20020a17090a74c700b00247bd63c3afmr1482341pjl.8.1681808053776; Tue, 18 Apr 2023 01:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681808053; cv=none; d=google.com; s=arc-20160816; b=fSynTHZid1qFngRcRFHewLUQxyBlF/qgpSvhlH86IGBeJgA+TwP4BfjsB9EAZnDM7A DmeE1SzkcIRC2VuFgQ6Jz5xtUxsuvapABgJZhnwx/ZUYQVtPS0rykL5+g+nol7iCcVX1 kZipb8fp/EqOGzeomjstDSikBCvQfwbttie4KLTkaP5m5BA/HdiNtb0BSTth+zCZAQXE KMTXexlnTMnuvNoTATMTLTcTj+G1SCDr9+ltY2jmNPmEpoVTqWMvOWwLuTWzoJ1hhSU7 f1gAWr75G21cd5q1qQt5trCIOabC9K2CCSoTfoS7xOjbiIV+p+BugOGLF+oG2Es5yIDq PlEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=V0VXQUdwHCaYzZ2NBYpdwlaQZQNqo/Cu+Fd29cY4tNM=; b=B5P1jkQfDK9sgbdYSSuRsLiQI8RDMU/rIWMmGszdvLAcpRrjw+w2CTHzEPMYqAkCz0 frT2pjPm1EVXrJIrF1Iq5KMWzQr855kITNJ/XmG1y6imYvCgb+ddELZsoJaRR5gmmnlT iJbLfdMGXIIbSMdpve+9MLx+Iqy/eSMNz52mxf1vV5dyY6hGFbJfklmO+7PcECBsdkJF ZCEB4s5j5gvDHo301QFH4ySxhn509CKy2j3Y/9+mQBFdIvLRJChaXuvMkT5PUnRhaMja CucZLLTritARX+1JFSDTAIw468fwas0nmVL+Mhj1J33l2LqcZGT9VEBUYz9E5a86L+wI FJ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="C/rTeb3a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl5-20020a17090b384500b0023af4ee47dasi2759202pjb.65.2023.04.18.01.54.02; Tue, 18 Apr 2023 01:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="C/rTeb3a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbjDRItu (ORCPT + 99 others); Tue, 18 Apr 2023 04:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbjDRIts (ORCPT ); Tue, 18 Apr 2023 04:49:48 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 444FE3AA2; Tue, 18 Apr 2023 01:49:47 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33I6shAD017126; Tue, 18 Apr 2023 08:49:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=V0VXQUdwHCaYzZ2NBYpdwlaQZQNqo/Cu+Fd29cY4tNM=; b=C/rTeb3aezq84rxE2GgHcgJ3HXi4mgMnvcp9dGxZ4at5YapGu0kh7CssB+EZScOSGw6f Qu3lBqau93ftdTe85F+uUM+ZlGEQ/63zxYmO/0+ZQR9/otb6w7ZmF5g5sFGfWIP+4pXq tEmSiiCi/r/gtIFUwJ3XAy6isP8SXgl2fLbXXRHhecwuGXCj9e6BvW5c1II1DeooQVB9 NAWKFOjrE0LO0LJJSwBu7v9lx3cYntRhCpD60L2T5yuUKA6GxabdVeFW542dVQSY8sot /0PJEagNhs2s4DmZwcnPywiY5VWPQ7DjOrgRtD7PM5SbtqDvmC6SstOwmvEZLoUVPGIi wA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q1bvksc9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Apr 2023 08:49:38 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33I8nbg4005770 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Apr 2023 08:49:37 GMT Received: from sarannya-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 18 Apr 2023 01:49:33 -0700 From: Sarannya S To: , , , , CC: , , , Deepak Kumar Singh , Sarannya S , "Bjorn Andersson" Subject: [PATCH V5 1/3] rpmsg: core: Add signal API support Date: Tue, 18 Apr 2023 14:18:39 +0530 Message-ID: <1681807721-32343-2-git-send-email-quic_sarannya@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1681807721-32343-1-git-send-email-quic_sarannya@quicinc.com> References: <1681807721-32343-1-git-send-email-quic_sarannya@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: yp3nWsFbNFwcgR1pTzyD7UvKHX3Buc6G X-Proofpoint-ORIG-GUID: yp3nWsFbNFwcgR1pTzyD7UvKHX3Buc6G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-18_04,2023-04-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 clxscore=1011 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304180075 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Deepak Kumar Singh Some transports like Glink support the state notifications between clients using flow control signals similar to serial protocol signals. Local glink client drivers can send and receive flow control status to glink clients running on remote processors. Add APIs to support sending and receiving of flow control status by rpmsg clients. Signed-off-by: Deepak Kumar Singh Signed-off-by: Sarannya S --- drivers/rpmsg/rpmsg_core.c | 20 ++++++++++++++++++++ drivers/rpmsg/rpmsg_internal.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index a2207c0..86b4912 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -331,6 +331,24 @@ int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, EXPORT_SYMBOL(rpmsg_trysend_offchannel); /** + * rpmsg_set_flow_control() - sets/clears serial flow control signals + * @ept: the rpmsg endpoint + * @enable: pause/resume incoming data flow + * + * Return: 0 on success and an appropriate error value on failure. + */ +int rpmsg_set_flow_control(struct rpmsg_endpoint *ept, bool enable) +{ + if (WARN_ON(!ept)) + return -EINVAL; + if (!ept->ops->set_flow_control) + return -ENXIO; + + return ept->ops->set_flow_control(ept, enable); +} +EXPORT_SYMBOL(rpmsg_set_flow_control); + +/** * rpmsg_get_mtu() - get maximum transmission buffer size for sending message. * @ept: the rpmsg endpoint * @@ -539,6 +557,8 @@ static int rpmsg_dev_probe(struct device *dev) rpdev->ept = ept; rpdev->src = ept->addr; + + ept->flow_cb = rpdrv->flowcontrol; } err = rpdrv->probe(rpdev); diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h index 39b646d..4fea45a 100644 --- a/drivers/rpmsg/rpmsg_internal.h +++ b/drivers/rpmsg/rpmsg_internal.h @@ -55,6 +55,7 @@ struct rpmsg_device_ops { * @trysendto: see @rpmsg_trysendto(), optional * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional * @poll: see @rpmsg_poll(), optional + * @set_flow_control: see @rpmsg_set_flow_control(), optional * @get_mtu: see @rpmsg_get_mtu(), optional * * Indirection table for the operations that a rpmsg backend should implement. @@ -75,6 +76,7 @@ struct rpmsg_endpoint_ops { void *data, int len); __poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp, poll_table *wait); + int (*set_flow_control)(struct rpmsg_endpoint *ept, bool enable); ssize_t (*get_mtu)(struct rpmsg_endpoint *ept); }; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project