Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3878794pxb; Tue, 17 Nov 2020 06:04:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF/JO1ld1d3fY/wOB+0T51yeVEI32dqwhZ/aHu3sO0lGuGsaEGerTo71JXR5G/VgCs99RB X-Received: by 2002:a17:906:74c6:: with SMTP id z6mr20119695ejl.448.1605621850650; Tue, 17 Nov 2020 06:04:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621850; cv=none; d=google.com; s=arc-20160816; b=wak/oPGcqyr853Tcm5bOmGmCNyW5INf0uLLfJEUc88QHn7qsf7aCX01W/pFksxAGiF GTLe2IbiZyvYA/HFmukJCTj8Mg4djiZXB8dxwN78ad5HlIMoSxgnjRDri49m7gkXhA7w eR17k8BX5Wd/kota1fs0617S1PX2ioLxZj3xN010OJhbNORwqP/iBHciuNbXda4EkB7G h6z8GbunPdZ43a1ucFb8CpvszX+lWmoR+n2sfCIvttEhnKiyPYjW+LhzsI03SyfMSwks WbhnJWxIRiVpMzvXtUHpR6nSKVOza3ZjgkeJ0bMeKaivkjU6kRcXkdzCyjGRsfr+m+jy gVlw== 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=jVvnEkcOSvoJYeMhxUbGozS73QUI6vmOLenEHz6g06g=; b=k9TXziIhIs3BveukspsV+FfYwnoQxNSP8w/hYKMrb5ervN8dTER/9mkT9xGvXN/szA kUL5oMakxEPV/a0lkpGte/KqnkKUTcibYloLmKSJ5Z/0R03LHpI+tgp10chSR074Zlvm 8gOMMY/iooGEJYWjXTvADQqD4O8sZg6YHhGbguP7iK1WNyABrxNjOFWw57eFBXu3H4ig lMo5MEZYQqYEazOKsXKTV14Jtdr8ENoBw/IevTS7LT7erP91cDVUnfl7XUwCfIquHLa/ YLStHmKAfXS8mm4fNi9R9uy7oOIOm54FAhSbVScNjK5Tk7aG7Oq0v4znm5pbKmlOPL/G V5vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=PV53Thje; 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=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h4si13605910ejj.390.2020.11.17.06.03.44; Tue, 17 Nov 2020 06:04:10 -0800 (PST) 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=@st.com header.s=STMicroelectronics header.b=PV53Thje; 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=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732929AbgKQOBV (ORCPT + 99 others); Tue, 17 Nov 2020 09:01:21 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:17386 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731126AbgKQOBK (ORCPT ); Tue, 17 Nov 2020 09:01:10 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AHDvZEd013952; Tue, 17 Nov 2020 15:00:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=jVvnEkcOSvoJYeMhxUbGozS73QUI6vmOLenEHz6g06g=; b=PV53Thje8eJpmKTSC2cAgUMoiFddEJyTaK/9fQINegu38IY7vRUIFI0+oEQe68cMI19o Sq0f0SLQjhlUsmSD+LIZZifim2jYCFDLswqi0OzPFQIYcctRMVMRdNA4aRlEaF6etNL6 om7jCXTF4P6+fjNI71mjOhxaQb7u9tfLlzuOXpY0hkmKrDO3FakqSr+uMS97yfZhTJBU qdGO1kpKnzVIvhYuraB8vl/ADVgs3oBq5KeRoFRGqx+H0ISWPgh7U8Y80fVgiz0/rhq5 VWxIq646yI60DUdZtJNOVZZDWG0th1TDV7SPU4tFiORSQJ024rKEZgwJbZ1UJ2J9dpOF hw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34t5k51mxd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Nov 2020 15:00:35 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AA2FB10002A; Tue, 17 Nov 2020 15:00:33 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6DD5B205D19; Tue, 17 Nov 2020 15:00:33 +0100 (CET) Received: from lmecxl0889.lme.st.com (10.75.127.47) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 17 Nov 2020 15:00:32 +0100 Subject: Re: [PATCH virtio] virtio: virtio_console: fix DMA memory allocation for rproc serial To: Christoph Hellwig CC: Alexander Lobakin , Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , Suman Anna , Mathieu Poirier , Bjorn Andersson , Ohad Ben-Cohen , "Michael S. Tsirkin" , Jason Wang , "virtualization@lists.linux-foundation.org" , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" References: <20201116091950.GA30524@infradead.org> <20201116162844.GB16619@infradead.org> <20201116163907.GA19209@infradead.org> From: Arnaud POULIQUEN Message-ID: <79d2eb78-caad-9c0d-e130-51e628cedaaa@st.com> Date: Tue, 17 Nov 2020 15:00:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201116163907.GA19209@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-17_03:2020-11-17,2020-11-17 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/16/20 5:39 PM, Christoph Hellwig wrote: > Btw, I also still don't understand why remoteproc is using > dma_declare_coherent_memory to start with. The virtio code has exactly > one call to dma_alloc_coherent vring_alloc_queue, a function that > already switches between two different allocators. Why can't we just > add a third allocator specifically for these remoteproc memory carveouts > and bypass dma_declare_coherent_memory entirely? > The dma_declare_coherent_memory allows to associate vdev0buffer memory region to the remoteproc virtio device (vdev parent). This region is used to allocated the rpmsg buffers. The memory for the rpmsg buffer is allocated by the rpmsg_virtio device in rpmsg_virtio_bus[1]. The size depends on the total size needed for the rpmsg buffers. The vrings are allocated directly by the remoteproc device. [1] https://elixir.bootlin.com/linux/v5.10-rc3/source/drivers/rpmsg/virtio_rpmsg_bus.c#L925