Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4374933pxv; Tue, 29 Jun 2021 05:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrXObTzkr7CyCnKHyS5DabsFLBB+dlhh0t5AJzc8bM0KlPXg2rDEtfEpWabJBxw/DW6HuI X-Received: by 2002:a92:cc0b:: with SMTP id s11mr704431ilp.304.1624970634214; Tue, 29 Jun 2021 05:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624970634; cv=none; d=google.com; s=arc-20160816; b=rVMMsi065Nebzu7ByFlN06nrWeKdEq5DvAjDTErfY0Emp+gX9ULUNfl3Dip9eh3+YJ ujrSNLQu/EcEPqE+kA1hY5qQZhEA4I2bK31t7hxkwQnt5p3XClEEpGY6KDtOXGB7zj+6 Q6Yxqq8hgfbUXLgmFP1f4X5AP3rn/QQfB/PqXskj28rLtz/pcdABfjc2KMoHlduEfqkD g5bNXZsJu/0GmV/06jWcVtJnIIsp0eXTOI67XJeZT+FX3VpM5/Ycy84hKAFu5ufEtML9 m0kNwCFCBzDUtj7CRYouoUNZr7F41BjZWPKnmVQSZiWJ94LEYTj+v4tXWdtSEcYbtHMR sq7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=HNidlLSuT/EgI/UAGSiAl/SFbXn1XzYYaTDoJm1qbVM=; b=VgSVfHYIAX/JS5NXOK5J3xmQOLtv+shy2HIp6muq3KW832IcHEkuNBebPXH+zvHlXt 8Yajowf/Yywttelt5o4fKvj6ncg1yjs9bVjMbwzBmHc55rMPQgwAyf++v2il4t08abvm Zf9h8gKw8y+1EjOhtFq/cvMIbDwKSJaQoz9RC1EdvBPZh5+kz4ix+PMpbenYO34LZbje Fs7sZ/eHr3Pu3MX7jEu9+OJSTJpcQUarOOsl8QGr4zGNZp0WKx5XXS+CFEZ0tVg6319c v4I7Nhp1z5q5GMiy6/5haqrzcg7hnEA8iG63aJYDC/dPXiBTLwl7Vf7+fRCt5dkG2FTb YIKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=lju3M3oT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si19159806iov.99.2021.06.29.05.43.40; Tue, 29 Jun 2021 05:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@foss.st.com header.s=selector1 header.b=lju3M3oT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232927AbhF2KM7 (ORCPT + 99 others); Tue, 29 Jun 2021 06:12:59 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:47740 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232772AbhF2KM5 (ORCPT ); Tue, 29 Jun 2021 06:12:57 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15TA8fVL002052; Tue, 29 Jun 2021 12:10:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=HNidlLSuT/EgI/UAGSiAl/SFbXn1XzYYaTDoJm1qbVM=; b=lju3M3oT6ER1kv/CRLNLECPkaPJ2Yzbhd4dNgmo4L/jYElyS11KrnWxUlbWDPgE2u0JS QE7G+q4nn6EiyVYrU1An44rJqtLomNXTmscp/zJKulVrXYtxf36I+Jh9VLk0HtCmUj56 eZbc+3QLzz4DydAd1HDD86C9VcoatBkNvjrShVQCnl98UHpVXVbxlr5xDvYwSf3O4EzQ dTyyzpP9LRM4/SkoTQnvgwsTzD/Tq81B3j2xvsNrBU+QCsRTDTu3oE+dk+cb/CWIX/bq Tso87Z4TvnNZRQqi7vCnDUJz64zCAOUsU7SKSzW1mItotHeQVTaI+BQcz+Cn9jsZYffx UQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 39fxbnhest-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 12:10:28 +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 8EC3810002A; Tue, 29 Jun 2021 12:10:27 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7DBEA21ED4D; Tue, 29 Jun 2021 12:10:27 +0200 (CEST) Received: from lmecxl0889.lme.st.com (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Jun 2021 12:10:27 +0200 Subject: Re: remoteproc DMA API abuse status To: Mathieu Poirier CC: Christoph Hellwig , Ohad Ben-Cohen , Bjorn Andersson , , References: <20210623134307.GA29505@lst.de> <20210624193514.GA1090275@p14s> <011dac94-cfe0-d276-980a-b8ffe1447521@foss.st.com> <20210628201419.GC1200359@p14s> From: Arnaud POULIQUEN Message-ID: <3f0a2e44-c439-46ea-1100-881d19c9005d@foss.st.com> Date: Tue, 29 Jun 2021 12:10:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210628201419.GC1200359@p14s> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG1NODE1.st.com (10.75.127.1) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-06-29_05:2021-06-28,2021-06-29 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu On 6/28/21 10:14 PM, Mathieu Poirier wrote: > I thought your current work on refactoring the rpmsg_char driver was part of the > early steps on the way to splitting that patchset up... No it is de-correlated. Here the point is the vdev0buffer memory region declared in rproc that we associate to the rproc_virtio device to be able to use is for RPMsg. When I have a look this here is the approach we had trying to fix it (this correspond to my patchset): The objective is to suppress the dma_declare_coherent_memory usage. => In this case the "vdev0buffer" virtio buffer memory pool has do be associated to the a virtio device by a declaration in device tree. Probably as a subnode of the remoteproc device node. &rproc { #address-cells = <1>; #size-cells = <0>; + vdev@0 { + memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>; + compatible = "rproc-virtio"; + reg = <0>; + status = "okay"; + }; }; => a reproc virtio platform driver compatible should be created (based on remoteproc core and remote_virtio restructuring). The memory region will be in this case associated in a clean way to the remoteproc virtio device. => As consequence we would have 2 module devices the remoteproc and remoteproc virtio. Both as to be synchronized to ensure that all is ready before starting the remote processor => reuse of the proc->subdev mechanism + (component bind/unbind similar to DRM?) The last but not the least we probably have to maintain the legacy a while to let time to move on this new device tree architecture. Now the question are: - Is this the good approach or could a simpler patch can fix the issue. - how to address models with one big memory pool used (TI implementation) Regards, Arnaud