From patchwork Thu Jul 2 08:21:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 192196 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1230812ilg; Thu, 2 Jul 2020 01:23:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTb9iI8JMoy6gbYC/aHss/LJYJHKH0AHYkXX+lFqTpuOeyS4/+/4QUaSAkeQ/I8C0N4oIs X-Received: by 2002:a05:6402:2c2:: with SMTP id b2mr33186172edx.184.1593678222231; Thu, 02 Jul 2020 01:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593678222; cv=none; d=google.com; s=arc-20160816; b=kITw3ZdY0hkbNKY3xKNzCtxjCn2T/GJkgRI1b2FcGnX+i3ooYVYPmJj10NLUMGnPGY /Q7Ic/LqMZ8tDEFS1AkSHxJ9wfyxKPo02XovDFhbvmKQvHc01v2TaIOCkx74OAo9bPnb 2kBAPvmfI2tPhb3YokJfckj21c6BRQkwn6cdjR9onx7iWusFmmOAgDh0JYPJJoAc8Lvz 9faKh7MI1leet7M+iMRYrbmwnk5Xrsjpg+2wiunNkUYDG+I8cYccBQNXHI6LmLCOHbSh DC55RppALiqzX7k/MAb+suQJPt/zjBuOIGiyFAlxwpgXCYNOEm+drBmmyz5jxlTgpIkf i13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=eGYb68Z81KhdwdWoOADJFuS9KisslFzKd0+Ho98yHF4=; b=f/+NXOYgRzk6SS7P75DdMjYi+FI2yNCPTAQlHZfvrs+z1qPMvPBKzG0sGdg27X1ryR 63PVTwfehLWm7hvQkSY4vZrjB2AwA3/zuGKKpXQgK1P/MXfnLGMLKJb51yBT99jrZHrw fARHcxINtWvyVa+uJTvxKs1TQL6Y2kmYkNqspL+g0MLnvOrJsnBFxTmb3D9dQgGVS+XL +Ku7UpwCRngr7pllZfhT+bAl0po/nRg3KM2iJ2RHQqo5BjEzB7kV1ob79eDTnmNyln++ HoGq2o3loqFkpBWHK4Qq/lAEagSD0kU8/dLrznR96yXCa8XHIbB2EHOmIFW9+ha+5t9k 0xAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=F0noB78A; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si5583178edq.111.2020.07.02.01.23.42; Thu, 02 Jul 2020 01:23:42 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=F0noB78A; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728701AbgGBIXk (ORCPT + 9 others); Thu, 2 Jul 2020 04:23:40 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:59632 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728663AbgGBIXg (ORCPT ); Thu, 2 Jul 2020 04:23:36 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0628NRFx082069; Thu, 2 Jul 2020 03:23:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1593678207; bh=eGYb68Z81KhdwdWoOADJFuS9KisslFzKd0+Ho98yHF4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=F0noB78AMveWf8E6/OYl0fvkIWUkgc8p1+tAJru1wvoGuIlwhyTOKLqRzzREVMbIb c7ubOUbj1+YlQEkv9bxxVzvmWBuTCDqVMO92gzyvCxs6XfLxklkzRgHJmP67Jzn1Se PLGX/HHRmdUR/21XYGVtP4/I5Rf5cywezjz+DbXY= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0628NRB2032083 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Jul 2020 03:23:27 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 2 Jul 2020 03:23:26 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 2 Jul 2020 03:23:26 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0628LiYT006145; Thu, 2 Jul 2020 03:23:21 -0500 From: Kishon Vijay Abraham I To: Ohad Ben-Cohen , Bjorn Andersson , Jon Mason , Dave Jiang , Allen Hubbe , Lorenzo Pieralisi , Bjorn Helgaas , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Stefano Garzarella CC: , , , , , , , Subject: [RFC PATCH 17/22] rpmsg.txt: Add Documentation to configure rpmsg using configfs Date: Thu, 2 Jul 2020 13:51:38 +0530 Message-ID: <20200702082143.25259-18-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702082143.25259-1-kishon@ti.com> References: <20200702082143.25259-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add Documentation on how rpmsg device can be created using configfs required for vhost_rpmsg_bus.c Signed-off-by: Kishon Vijay Abraham I --- Documentation/rpmsg.txt | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) -- 2.17.1 diff --git a/Documentation/rpmsg.txt b/Documentation/rpmsg.txt index 24b7a9e1a5f9..0e0a32b2cb66 100644 --- a/Documentation/rpmsg.txt +++ b/Documentation/rpmsg.txt @@ -339,3 +339,59 @@ by the bus, and can then start sending messages to the remote service. The plan is also to add static creation of rpmsg channels via the virtio config space, but it's not implemented yet. + +Configuring rpmsg using configfs +================================ + +Usually a rpmsg_device is created when the virtproc driver (virtio_rpmsg_bus.c) +receives a name service notification from the remote core. However there could +also be cases where the user should be given the ability to create rpmsg_device +(like in the case of vhost_rpmsg_bus.c) where vhost_rpmsg_bus should be +responsible for sending name service notification. For such cases, configfs +provides an ability to the user for binding a rpmsg_client_driver with virtproc +device in order to create rpmsg_device. + +Two configfs directories are added for configuring rpmsg +:: + + # ls /sys/kernel/config/rpmsg/ + channel virtproc + +channel: Whenever a new rpmsg_driver is registered with rpmsg core, a new +sub-directory will be created for each entry provided in rpmsg_device_id +table of rpmsg_driver. + +For instance when rpmsg_sample_client is installed, it'll create the following +entry in the mounted configfs directory +:: + + # ls /sys/kernel/config/rpmsg/channel/ + rpmsg-client-sample + +virtproc: A virtproc device can choose to add an entry in this directory. +Virtproc device adds an entry if it has to allow user to control creation of +rpmsg device. (e.g vhost_rpmsg_bus.c) +:: + + # ls /sys/kernel/config/rpmsg/virtproc/ + vhost0 + + +The first step in allowing the user to create rpmsg device is to create a +sub-directory rpmsg-client-sample. For each rpmsg_device, the user would like +to create, a separate subdirectory has to be created. +:: + + # mkdir /sys/kernel/config/rpmsg/channel/rpmsg-client-sample/c1 + +The next step is to link the created sub-directory with virtproc device to +create rpmsg device. +:: + + # ln -s /sys/kernel/config/rpmsg/channel/rpmsg-client-sample/c1 \ + /sys/kernel/config/rpmsg/virtproc/vhost0 + +This will create rpmsg_device. However the driver will not register the +rpmsg device until it receives the VIRTIO_CONFIG_S_DRIVER_OK (in the case +of vhost_rpmsg_bus.c) as it can access virtio buffers only after +VIRTIO_CONFIG_S_DRIVER_OK is set.