Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp272617rwe; Fri, 26 Aug 2022 04:57:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR56XlANSAxzXnLyA2gpWwyGZDWjsQ2oBujEHgn0Hl+bfmEZgXkEW1U9vdvB+bew1nRasi4z X-Received: by 2002:a05:6a00:188a:b0:536:1401:7f65 with SMTP id x10-20020a056a00188a00b0053614017f65mr3558846pfh.1.1661515056286; Fri, 26 Aug 2022 04:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661515056; cv=none; d=google.com; s=arc-20160816; b=w/o8gDteYhj0NsWTBr4JoGJtJAyQt0cjcOi7uzgcWeTP39dUxwXTdjgKpHINC8gZUO oMQZ+1OMEe1aWjtgbCrtoWIIzcxcZ4yjf98ouKx3Bi0xDZYZxrepwciWlFXSouLELfoH pk6ME+OrhPZJiEL5JrOhQTvl7+IGhAGeeoz7vPc0uy3uAi7cTwMV1+A5JPe8m5AhMTR9 WNaZ43j/6oacZP6+5yrFjyGWmQyWRwlY5ZaXzgqmlzAAWwQF2duYmx8Ow03wVlgGuD3S q07n0dRtfaDnTBpDQ0jCCSNjj7G+BBU+YkeTnPd7X1z40seYTq+pOXpO0oPV+hHT6mGl 4J3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iEo1T84Vz7FQCvQtWZ4+CglEzwVQiGhNUWl6R0IhKeg=; b=YPMOQh7MeB7S6uEM1RzlHxNPEqDdTp/z9dKtClKCL4UbNRVHQcEYynaWjxLeXp99hM DP5FtuzW5IdmHo0pUZX16vvq3pbHstBTohx+nJnZ+O/LauctbBB6a+Kv4k1izi0hrqVc ZwU70r8KSILMgrdbq4bODVhnziZD5GFsokmoebD2W5L0af41n4aOfwJmctM/izOhbRge RJ0ijlMT9d4vX/gm+Bs8g25gXBqEvsHQsbvV93Ljc2RmKN1S27L3QGt1Y+x2GVVfb1w+ /RsM0Gg0aMHWDFFwb7iwMK8dBMsJzXhoqM+W2ezesgWUPLWBweYqGMMKzWnP3Hl4P1Tx Xa/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=MKi3grh6; 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 x2-20020a623102000000b005369648b156si1522101pfx.276.2022.08.26.04.57.23; Fri, 26 Aug 2022 04:57:36 -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=MKi3grh6; 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 S1343699AbiHZLxi (ORCPT + 99 others); Fri, 26 Aug 2022 07:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbiHZLxf (ORCPT ); Fri, 26 Aug 2022 07:53:35 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13A94D742A; Fri, 26 Aug 2022 04:53:33 -0700 (PDT) Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27QA5Wv5031074; Fri, 26 Aug 2022 13:53:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=iEo1T84Vz7FQCvQtWZ4+CglEzwVQiGhNUWl6R0IhKeg=; b=MKi3grh6NUAmdOl1U/z9GlQWL9ABoYOKABPbV1sW32qLOMaqM+ljiHwjx4fIQd69dqqt u8GYJryaxdZ/Vhzjg5xHkYAtNsKnolLld0+4thMZbogp1GSP5bAVEUF0IeNVojTqARQk fxfzfMuvYUi2Z66MgaOEuEwGkagw1NBPz10Dv2/Znzph2WMiK9A79XjiXZ5w/IOGB+wY vMkebrTMsLvMtzMcCzX5KcGVjI4fgl/qf+Z3hFnlMPdx8MDW66ZsGgV5J2UdsdhT37Bp A6B0lb1F8poRpJIQQiy1nD+vd1kJmIqhp47W1ub/GEIMoVv1ATnKTAs6khZjzNsIgW8+ iQ== 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 3j4w3dm2yn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 13:53:24 +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 3074010002A; Fri, 26 Aug 2022 13:53:22 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 9BE08222CA8; Fri, 26 Aug 2022 13:53:22 +0200 (CEST) Received: from localhost (10.75.127.117) 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.2308.20; Fri, 26 Aug 2022 13:53:21 +0200 From: Arnaud Pouliquen To: Bjorn Andersson , Mathieu Poirier CC: , , , Rob Herring , Christoph Hellwig , Stefano Stabellini , Bruce Ashfield , Subject: [PATCH v8 0/4] remoteproc: restructure the remoteproc VirtIO device Date: Fri, 26 Aug 2022 13:52:28 +0200 Message-ID: <20220826115232.2163130-1-arnaud.pouliquen@foss.st.com> X-Mailer: git-send-email 2.24.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.117] X-ClientProxiedBy: GPXDAG2NODE4.st.com (10.75.127.68) 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.517,FMLib:17.11.122.1 definitions=2022-08-26_05,2022-08-25_01,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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://lkml.org/lkml/2022/7/13/663 [2] https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git/log/?h=for-next 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://lkml.org/lkml/2020/4/16/1817 [4] https://lkml.org/lkml/2021/6/23/607 [5] https://patchwork.kernel.org/project/linux-remoteproc/patch/AOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E@cp7-web-042.plabs.ch/ 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://github.com/arnopo/linux/commits/step2-virtio-in-DT step 3: Add memory declaration in VirtIO subnode => https://github.com/arnopo/linux/commits/step3-virtio-memories step 4: Add mailbox declaration in VirtIO subnode => https://github.com/arnopo/linux/commits/step4-virtio-mailboxes 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