Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5410011rwb; Wed, 21 Sep 2022 07:28:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4A4ZDIvvTIhubgLh4UonNge3EIqAdT5qJp1AsemAtB+35BwsJOZtvlmDHTo36iqvuOd2kU X-Received: by 2002:a17:902:a606:b0:178:57e4:a0c1 with SMTP id u6-20020a170902a60600b0017857e4a0c1mr5045990plq.83.1663770534246; Wed, 21 Sep 2022 07:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663770534; cv=none; d=google.com; s=arc-20160816; b=C1WRoENpi0woxd8fJDmibI7tOO/Zfk5CDCDaHuq9MVrxlwX320TLzcM2AXgHZMT2w6 jKQAKJ4/j6g33pItnI8r6d7D+FAtSUylDFawlu0dw4urIlT7vrQZtmH4WXB39bT3S+0q kEGDrTnL7uRil+FTs4BJj4HDzqyzp946Ye3B7F8LyYIXRHeFbkNUz/nz23ETX+fq7utJ lbQqiDml8Z8zqTGY+rGciGs+PvkxJVCIyCkqZTAD7HSlkUcvwCMRgjx5u59plb0U0Vs4 anUeEn0jURu8pVZHx48r9bHxjexhO8aliBph0sPFwEoCGQiQXk/rzT4Gcnd7ZVB2FWyJ JMrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JEMX7/Vv9Vyf9i+1M84nH51KcSdxqVkD+jrC2ctIAws=; b=a7W8OV6JL3+Ry+1aMIW1AjQ1JXqn50IZ1TKNqd0phOCHHIn6cyWrJLoK/rUVLSgQOz t2V8iba6Ra/lZxTEl5/F53TFZS29NRmK+i50F/40yxJJIkgAR+b/If9vaOOZUJ/KgK+R lCLOG788VN2Ghjcx9zAqwjPTHIaYcBZQQHYzg979OZJGM3ih7zJxoImajKrkurpD7rhy 2a/E7PIK9jBLGSkd54+RzEpfm4RdrwUIZx/CuIfkOBVzeOiw4R5iJ2Zr/F+eB/rT1X49 qDen8RORiL8kXiRIy3LPJgy7qw8dMHSEvUzuQaMXoiE2s8u/ldYy3wx/5iM7EwDlDR4I 02RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=qNiYjQNI; 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=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob8-20020a17090b390800b00202acc2169csi3390936pjb.118.2022.09.21.07.28.42; Wed, 21 Sep 2022 07:28:54 -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=@foss.st.com header.s=selector1 header.b=qNiYjQNI; 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=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbiIUOHy (ORCPT + 99 others); Wed, 21 Sep 2022 10:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiIUOHv (ORCPT ); Wed, 21 Sep 2022 10:07:51 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EC1B95E50; Wed, 21 Sep 2022 07:07:49 -0700 (PDT) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28L9VWV1011673; Wed, 21 Sep 2022 16:07:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=JEMX7/Vv9Vyf9i+1M84nH51KcSdxqVkD+jrC2ctIAws=; b=qNiYjQNIFph8X0ZevJYrl6LioNyYee8VbCUi/Q+9npzpHwudI6j0m4InQjRlSi7nDJcq mkWqvh+NvmIbqTq143jCS6IqdkyDp2mwpjnhCZ0mAxwEFJDmcwLPobhZME5RZhbYAGHs aXWotmyQNfFLc9o8jzIEK3BpYkSzR0zRW/7YgbxoFt/oAT1JEygXl8Mtqy1VFWh3UdtM nSofv5bM/l9EBx3UmSWjABtGtTdVZggdnM5HrT/9KrJHNNL2ZacJwPoyRxHID1OuR435 WRnr8+HHHEcdsFxAP1LIBVIj3Vlqsztab5u+fAy6BrZv7tEqH18XvhfucPk/NXBAJgW6 VQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3jn6cktp22-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Sep 2022 16:07:38 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 725AB10002A; Wed, 21 Sep 2022 16:07:37 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 69226231DE6; Wed, 21 Sep 2022 16:07:37 +0200 (CEST) Received: from [10.201.22.245] (10.75.127.49) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Wed, 21 Sep 2022 16:07:36 +0200 Message-ID: <3a197588-fa74-acce-d17c-a2c2556b1fe1@foss.st.com> Date: Wed, 21 Sep 2022 16:07:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v8 0/4] remoteproc: restructure the remoteproc VirtIO device Content-Language: en-US To: Peng Fan , Mathieu Poirier , Bjorn Andersson CC: "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , Rob Herring , Christoph Hellwig , Stefano Stabellini , Bruce Ashfield References: <20220826115232.2163130-1-arnaud.pouliquen@foss.st.com> From: Arnaud POULIQUEN In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-21_08,2022-09-20_02,2022-06-22_01 X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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 Hi Peng, On 9/21/22 10:54, Peng Fan wrote: > Hi Arnaud, > >> Subject: [PATCH v8 0/4] remoteproc: restructure the remoteproc VirtIO >> device > > Sorry to get in at this late time, just try to catch up. > Not reviewing comments, just have a question, > Does remote core firmware requires changes to use this new feature? For this series, it is not. For the whole work, it should not, but it will probably depend on the evolutions related to the reviews and requirements that will come. > Does your 4 branches listed below still work with linux-6.x? I have to rebase them. Today my github branches are based on v5.18.rc1 I plan to do this end of this week or next week. > Could the multiple vdev still share same mbox channel? Yes I'm trying to keep the legacy support of the mailbox in the remoteproc platform driver. If no mailbox is declared in the virtio subnode it calls the rproc->ops->kick > > I not own i.MX remote core firmware development, so if no need > firmware change, I would like give a try and see how it works. Great! That would be nice to have your feedback. Mailbox management is one point, I'm also ineterested in having feedback on the memory regions management I will ping you when my work will be rebased on 6.0 Thanks, Arnaud > > Thanks, > Peng. > >> >> 1) Update from V7 [1]: >> >> - rebase on rproc-next branch [2], commit 729c16326b7f ("remoteproc: >> imx_dsp_rproc: fix argument 2 of rproc_mem_entry_init") >> The updates take into account the integration of the >> commit 1404acbb7f68 ("remoteproc: Fix dma_mem leak after >> rproc_shutdown") >> - add Reviewed-by: Mathieu Poirier according >> to reviews on V7 >> >> >> [1] >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml. >> org%2Flkml%2F2022%2F7%2F13%2F663&data=05%7C01%7Cpeng.fan% >> 40nxp.com%7Ce0e5200d739a48e7439508da87599d14%7C686ea1d3bc2b4c >> 6fa92cd99c5c301635%7C0%7C0%7C637971116202643149%7CUnknown%7C >> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL >> CJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=77pEuwAI7Lh61hx1%2B >> Hs79Cu0G5KOa6mzQ0PnTC5r8Xk%3D&reserved=0 >> [2] >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.ke >> rnel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fremoteproc%2Flinux.g >> it%2Flog%2F%3Fh%3Dfor- >> next&data=05%7C01%7Cpeng.fan%40nxp.com%7Ce0e5200d739a48e7 >> 439508da87599d14%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7 >> C637971116202643149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA >> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7 >> C%7C&sdata=iWUSzKkN9BpHwqbO62awIcyVf9PXcftcdt2kytWVR78%3D >> &reserved=0 >> >> 2) Patchset description: >> >> This series is a part of the work initiated a long time ago in the series >> "remoteproc: Decorelate virtio from core"[3] >> >> Objective of the work: >> - Update the remoteproc VirtIO device creation (use platform device) >> - Allow to declare remoteproc VirtIO device in DT >> - declare resources associated to a remote proc VirtIO >> - declare a list of VirtIO supported by the platform. >> - Prepare the enhancement to more VirtIO devices (e.g I2C, audio, video, ...). >> For instance be able to declare a I2C device in a virtio-i2C node. >> - Keep the legacy working! >> - Try to improve the picture about concerns reported by Christoph Hellwing >> [4][5] >> >> [3] >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml. >> org%2Flkml%2F2020%2F4%2F16%2F1817&data=05%7C01%7Cpeng.fan >> %40nxp.com%7Ce0e5200d739a48e7439508da87599d14%7C686ea1d3bc2b4 >> c6fa92cd99c5c301635%7C0%7C0%7C637971116202643149%7CUnknown%7 >> CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw >> iLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oPWSfUweLdhUFK5X9 >> 2YcGHem8s%2Bfelcr%2FHx9JAlKG%2BI%3D&reserved=0 >> [4] >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml. >> org%2Flkml%2F2021%2F6%2F23%2F607&data=05%7C01%7Cpeng.fan% >> 40nxp.com%7Ce0e5200d739a48e7439508da87599d14%7C686ea1d3bc2b4c >> 6fa92cd99c5c301635%7C0%7C0%7C637971116202643149%7CUnknown%7C >> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL >> CJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=HPpnlaykes8R1Kz1dEN >> nirEHkDNr7JvRs%2FcsaDPuLdI%3D&reserved=0 >> [5] >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc >> hwork.kernel.org%2Fproject%2Flinux- >> remoteproc%2Fpatch%2FAOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E >> %40cp7-web- >> 042.plabs.ch%2F&data=05%7C01%7Cpeng.fan%40nxp.com%7Ce0e520 >> 0d739a48e7439508da87599d14%7C686ea1d3bc2b4c6fa92cd99c5c301635% >> 7C0%7C0%7C637971116202643149%7CUnknown%7CTWFpbGZsb3d8eyJWIj >> oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C >> 3000%7C%7C%7C&sdata=GtNruefDreOoogL%2BlntAC7GBfk6E1Goq4j% >> 2BYXt36RdI%3D&reserved=0 >> >> In term of device tree this would result in such hierarchy (stm32mp1 >> example with 2 virtio RPMSG): >> >> m4_rproc: m4@10000000 { >> compatible = "st,stm32mp1-m4"; >> reg = <0x10000000 0x40000>, >> <0x30000000 0x40000>, >> <0x38000000 0x10000>; >> memory-region = <&retram>, <&mcuram>,<&mcuram2>; >> mboxes = <&ipcc 2>, <&ipcc 3>; >> mbox-names = "shutdown", "detach"; >> status = "okay"; >> >> #address-cells = <1>; >> #size-cells = <0>; >> >> vdev@0 { >> compatible = "rproc-virtio"; >> reg = <0>; >> virtio,id = <7>; /* RPMSG */ >> memory-region = <&vdev0vring0>, <&vdev0vring1>, >> <&vdev0buffer>; >> mboxes = <&ipcc 0>, <&ipcc 1>; >> mbox-names = "vq0", "vq1"; >> status = "okay"; >> }; >> >> vdev@1 { >> compatible = "rproc-virtio"; >> reg = <1>; >> virtio,id = <7>; /*RPMSG */ >> memory-region = <&vdev1vring0>, <&vdev1vring1>, >> <&vdev1buffer>; >> mboxes = <&ipcc 4>, <&ipcc 5>; >> mbox-names = "vq0", "vq1"; >> status = "okay"; >> }; >> }; >> >> I have divided the work in 4 steps to simplify the review, This series >> implements only the step 1: >> step 1: Redefine the remoteproc VirtIO device as a platform device >> - migrate rvdev management in remoteproc virtio.c, >> - create a remotproc virtio config ( can be disabled for platform that not >> use VirtIO IPC. >> step 2: Add possibility to declare and probe a VirtIO sub node >> - VirtIO bindings declaration, >> - multi DT VirtIO devices support, >> - introduction of a remote proc virtio bind device mechanism , => >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithu >> b.com%2Farnopo%2Flinux%2Fcommits%2Fstep2-virtio-in- >> DT&data=05%7C01%7Cpeng.fan%40nxp.com%7Ce0e5200d739a48e74 >> 39508da87599d14%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C >> 637971116202643149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw >> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C >> %7C&sdata=XtF%2FQnml3QXFL7rgqST1Z2FotUzoj%2FD57WfiuAVMnr8 >> %3D&reserved=0 >> step 3: Add memory declaration in VirtIO subnode => >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithu >> b.com%2Farnopo%2Flinux%2Fcommits%2Fstep3-virtio- >> memories&data=05%7C01%7Cpeng.fan%40nxp.com%7Ce0e5200d739 >> a48e7439508da87599d14%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7 >> C0%7C637971116202643149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4 >> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% >> 7C%7C%7C&sdata=6gq28c6a1TJ%2FdkvokcEjgy6FKQcKTXSz%2BNAbJPo >> mjac%3D&reserved=0 >> step 4: Add mailbox declaration in VirtIO subnode => >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithu >> b.com%2Farnopo%2Flinux%2Fcommits%2Fstep4-virtio- >> mailboxes&data=05%7C01%7Cpeng.fan%40nxp.com%7Ce0e5200d739 >> a48e7439508da87599d14%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7 >> C0%7C637971116202643149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4 >> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% >> 7C%7C%7C&sdata=wfy2euuOPoMmBMIH3BOsGcsEYGSTWsDaRr7ENN >> QCK70%3D&reserved=0 >> >> Arnaud Pouliquen (4): >> remoteproc: core: Introduce rproc_rvdev_add_device function >> remoteproc: core: Introduce rproc_add_rvdev function >> remoteproc: Move rproc_vdev management to remoteproc_virtio.c >> remoteproc: virtio: Create platform device for the remoteproc_virtio >> >> drivers/remoteproc/remoteproc_core.c | 154 +++--------------- >> drivers/remoteproc/remoteproc_internal.h | 23 ++- >> drivers/remoteproc/remoteproc_virtio.c | 189 ++++++++++++++++++++--- >> include/linux/remoteproc.h | 6 +- >> 4 files changed, 210 insertions(+), 162 deletions(-) >> >> -- >> 2.24.3 >