Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp550993imm; Fri, 12 Oct 2018 02:48:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV619iKFNjPystqzQFD+5wPw7+HxYhnozwqxW8V91GDNrKPyoHr8fRYAikygvmHQj9CY3tEhP X-Received: by 2002:a62:b87:: with SMTP id 7-v6mr5322197pfl.67.1539337693199; Fri, 12 Oct 2018 02:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539337693; cv=none; d=google.com; s=arc-20160816; b=MTbWvXP1WK4Cqj8sIhrQAlAKVYFvQP6qqCzLXbmQURERb2DHnFFnTQwf+M4tQ7vNeS crwz8GrfZKgPSrh3Eqm1r3jDxptB1QsJWf4qHadGx4EV9rrPAq36MZY6S7iANZRtqYHr 0Yhx4B1BUdWbmTk3Fgvggn0n2NnEt1Qyw2r2p+kSK5ZTX3S8ShjXsuzlpH3Oil4X3H3O WDB/fljOvCIY6rFYVx1pQpxvVGmEekCi4GxHoaWena6wCAk060Opu4QBlizem925pL0q DlknZKE4U1FJf1mTffJznBIk8I+UYZ9O15yzwL8jSwuprRU3uG00zIaajiU+XRWVjHZv 4G9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=EZoedUc4KvaaxgJ1ZmEy91eGFQKSSkBpyvgiKMWUy0w=; b=GJ07lVjAXKlGCm4QsSg2ZZUFmTwaMAGW6EwXKLkwzyRJ49gU0na1upE+y8InUI57oS BXVz38lZBzsEMHCTlrrmkQ7GUwIqDb0yZmjnOtvZNsBEWHrYmdY9qZhBnBAr9lCwGI1H 1Iz6OTQI3kWsLo/VWgPq4JqIilsL26vnLneBDWaARqpz2sbB/vp/ghEDl4vopvG3Odz9 yh81M///TFjCu4sAHh3lCxgIWxmhg7xN8Vb0ObUPoY/+xD7lR3iv5oBYBwRSPdPwXQic ORI+OuhfYTftDv070T8xemy8IgF4jf0hLJCeRskYkGsQ2zEqfyvYVgzxKYVmGD4yw6k6 3neg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14-v6si843073ple.236.2018.10.12.02.47.58; Fri, 12 Oct 2018 02:48:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728257AbeJLRSD (ORCPT + 99 others); Fri, 12 Oct 2018 13:18:03 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:47494 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbeJLRSD (ORCPT ); Fri, 12 Oct 2018 13:18:03 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w9C9hvKC022198; Fri, 12 Oct 2018 11:46:22 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2n0se73c2y-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 12 Oct 2018 11:46:22 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 82D9D31; Fri, 12 Oct 2018 09:46:20 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 18BA527A4; Fri, 12 Oct 2018 09:46:20 +0000 (GMT) Received: from [10.201.23.162] (10.75.127.51) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 12 Oct 2018 11:46:19 +0200 Subject: Re: [PATCH V4 0/4] Add TIOCM Signals support for RPMSG char devices To: Bjorn Andersson CC: Arun Kumar Neelakantam , , , , , References: <1538980699-21516-1-git-send-email-aneela@codeaurora.org> <20181008162325.GA1331@tuxbook-pro> <20181009182712.GC28399@tuxbook-pro> From: Arnaud Pouliquen Openpgp: preference=signencrypt Autocrypt: addr=arnaud.pouliquen@st.com; prefer-encrypt=mutual; keydata= xsFNBFZu+HIBEAC/bt4pnj18oKkUw40q1IXSPeDFOuuznWgFbjFS6Mrb8axwtnxeYicv0WAL rWhlhQ6W2TfKDJtkDygkfaZw7Nlsj57zXrzjVXuy4Vkezxtg7kvSLYItQAE8YFSOrBTL58Yd d5cAFz/9WbWGRf0o9MxFavvGQ9zkfHVd+Ytw6dJNP4DUys9260BoxKZZMaevxobh5Hnram6M gVBYGMuJf5tmkXD/FhxjWEZ5q8pCfqZTlN9IZn7S8d0tyFL7+nkeYldA2DdVplfXXieEEURQ aBjcZ7ZTrzu1X/1RrH1tIQE7dclxk5pr2xY8osNePmxSoi+4DJzpZeQ32U4wAyZ8Hs0i50rS VxZuT2xW7tlNcw147w+kR9+xugXrECo0v1uX7/ysgFnZ/YasN8E+osM2sfa7OYUloVX5KeUK yT58KAVkjUfo0OdtSmGkEkILWQLACFEFVJPz7/I8PisoqzLS4Jb8aXbrwgIg7d4NDgW2FddV X9jd1odJK5N68SZqRF+I8ndttRGK0o7NZHH4hxJg9jvyEELdgQAmjR9Vf0eZGNfowLCnVcLq s+8q3nQ1RrW5cRBgB8YT2kC8wwY5as8fhfp4846pe2b8Akh0+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u8pTEReGBYSVUBHx7GF1e3L/IMZZMquggEsixD8CYMOzahCEZ7UUwD5LKxRfmBWBgK 36tfTyducLyZtGB3mbJYfWeI7aiFgYsd5ehov6OIBlOz5iOshd97+wbbmziYEp6jWMIMX+Em zqSvS5ETZydayO5JBbw7fFBd1nGVYk1WL6Ll72g+iEnqgIckMtxey1TgfT7GhPkR7hl54ZAe 8mOik8I/F6EW8XyQAA2P Message-ID: <8efdf3c6-2c52-cff2-d99f-3abb0b54cb31@st.com> Date: Fri, 12 Oct 2018 11:46:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181009182712.GC28399@tuxbook-pro> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG6NODE1.st.com (10.75.127.16) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-12_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2018 08:27 PM, Bjorn Andersson wrote: > On Tue 09 Oct 09:02 PDT 2018, Arnaud Pouliquen wrote: > >> hello Bjorn, >> >> On 10/08/2018 06:23 PM, Bjorn Andersson wrote: >>> On Mon 08 Oct 06:08 PDT 2018, Arnaud Pouliquen wrote: >>> >>>> Hi Arun, Bjorn, >>>> >>>> On 10/08/2018 08:38 AM, Arun Kumar Neelakantam wrote: >>>>> Glink transport support signals to exchange state notification between >>>>> local and remote side clients. Adding support to send/receive the signal >>>>> command and notify the clients through callback and POLL notification. >>>> >>>> Please correct me if i'm wrong...My concern here is that this patchset >>>> implements a rpmsg service in the rpmsg core. I would separate this from >>>> the rpmsg core, as this is not part of the rpmsg protocol but seems >>>> linked to the serial protocol itself. >>>> Could it be implemented in rpmsg_char, using a dedicated channel...? >>>> >>> >>> rpmsg_char does expose a rpmsg channel (be it virtio, smd or glink) to >>> user space. This patch series add support for invoking TIOCMGET and >>> TIOCMSET on these channels. >> >> I'm not familiar with this concept, that could explain that i don't >> understand this patchset... >> >> TIOCMGET and TIOCMSET is related to the serial/console flow control, to >> control remote modem/processor, right? >> > > Correct, using the known tty ioctls for flow control we allow userspace > to communicate flow control information to the rpmsg_char driver. > >> it seems be implemented only to support the rpmsg_char ioctl interface. >> When i have a look to the glink code, signal is treated by a message >> sent to remote processor. Therefore it seems that it could be treated as >> a service on top of rpmsg (so treat it in rpmsg_char instead of extend >> the rpmsg protocol to treat it in glink driver). >> > > The glink message is a control message, so it's not possible to pass > this inside a channel. As such it's not possible to solve this entirely > in rpmsg_char. > > Looking at SMD, this is a set of bits in a per-channel control > structure. So there it's clearer that it's some side-band control > information. > > > Further more, the rpmsg_char driver just exposes a channel to user > space, it does not care about the data inside. As such it's not possible > to generically extend it to support this with in-band messages. > >>> >>> In addition to adding the client side of this to rpmsg_char it provides >>> this support for glink, but the same mechanism exists in smd - while >>> this is not supported (today) by the virtio rpmsg. >> This is my main concern, i would like to be sure that this service is >> not related to specific needs introduced by the rmpsg char implementation: >> In this case this should not be part of the rpmsg core but perhaps some >> ops directly provided to the rpmsg_char on registration >> (rpmsg_chrdev_register_device?)... >> > > Arun's imminent need is for a user space client that needs to flow > control the incoming data stream. But the possibility of controlling the > incoming flow of data is useful in a number of situations. > >>> >>> >>> I'm uncertain of how we could implement this mechanism for virtio rpmsg, >>> given that it as a transport doesn't really have a concept of >>> channels/flows - but it's really useful to have! >>> >>> PS. rpmsg_set_signals() can be called from any rpmsg device to perform >>> flow control of the communication channel. >> >> For my point of view this patch-set extends the rpmsg protocol to add >> channel flow control. >> Does it make sense to have a flow control in rpmsg protocol? >> if yes, should it be linked to a channel or to the remote processor itself? >> > > Having per-channel flow control particularly useful in scenarios where > one has multiple types of data flowing over a shared underlying FIFO - > such as virtio rpmsg. As this allows these different applications to > limit the data rate without having to use application specific side band > controls. Agree that per-channel flow control could be useful to give priorities an limit data flow rate. And as discussed yesterday in Openamp meeting, rpmsg seems the well place to add a kind of channel controller. That's means than we should probably need a generic way to configure flow control, not based on TTY ioctl protocol, but compatible with its associated feature. If you need a short term solution, perhaps, a first step could be to define a more generic API, that would be bypassed to the rpmsg backend driver... From my POV, a blocking point in current patch is that rpmsg_set_signals and rpmsg_get_signals create dependency between the client the back-end driver in term of parameters. Both have to know the signification of these parameters, that are not defined in the interface, but in user ioctl API. This seems not suitable for non rpmsg_char client that would use flow control. Other concern is that the term "signals" seems too generic if it is dedicated to flow control. Regards, Arnaud > >> Extra comment: associated documentation update is missing. >> > > Good catch, we should have a section in Documentation/rpmsg.txt > describing this mechanism. > > Regards, > Bjorn > >> Regards, >> Arnaud >> >>> >>> Regards, >>> Bjorn >>> >>>> Regards >>>> Arnaud >>>> >>>>> >>>>> Changes since v1: >>>>> - Split the patches as per functional areas like core, char, glink >>>>> - Add set, clear mask for TIOCMSET >>>>> - Merge the char signal callback and POLLPRI patches >>>>> >>>>> Changes since v2: >>>>> - Modify the rpmsg_get_signals function prototype >>>>> >>>>> Changes since v3: >>>>> - Correct the TICOMGET case handling as per new rpmsg_get_signals prototype >>>>> - Update the rpmsg_get_signals function header >>>>> >>>>> Arun Kumar Neelakantam (4): >>>>> rpmsg: core: Add signal API support >>>>> rpmsg: glink: Add support to handle signals command >>>>> rpmsg: char: Add TIOCMGET/TIOCMSET ioctl support >>>>> rpmsg: char: Add signal callback and POLLPRI support >>>>> >>>>> drivers/rpmsg/qcom_glink_native.c | 126 ++++++++++++++++++++++++++++++++++++++ >>>>> drivers/rpmsg/rpmsg_char.c | 74 +++++++++++++++++++++- >>>>> drivers/rpmsg/rpmsg_core.c | 41 +++++++++++++ >>>>> drivers/rpmsg/rpmsg_internal.h | 5 ++ >>>>> include/linux/rpmsg.h | 26 ++++++++ >>>>> 5 files changed, 269 insertions(+), 3 deletions(-) >>>>>