Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp846020ybj; Thu, 7 May 2020 08:55:56 -0700 (PDT) X-Google-Smtp-Source: APiQypLRgMl2OBv3aitqXscJUBRFQEC0atH4TXuRy3BFhA7sNnY+YqzVLu26D9LD0zt/nAKwYtsq X-Received: by 2002:a05:6402:1506:: with SMTP id f6mr12657433edw.217.1588866956363; Thu, 07 May 2020 08:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588866956; cv=none; d=google.com; s=arc-20160816; b=y0e4BbUEmfimw6MIdf8P7wcB8/mWkWxJu7+qDmxluDdo3Aw84pBA3Ggo4Nd4Dll32S 1/ATyXdeCFnVuJKCN5BR918qnaqSKn6qWte+M6/yqpB9PK01OgdFNuqDGVFEiDOAkwQK JGI1Mt/Q/Gjms4UGzyKeccaIhPAAWN8zaEcNbQP1vZUlZk2X+SObNXAAzyPXYYgBhbu7 J1fv1hxFiTOb7+yCEJMupbDcyjAWGWp1Nm2wa7b5PDmv+Htg4/QorgrC+YxgzB1Oll8L n3JeTVUX6nmzkmuo0fgD4wBa5p19x3vs7gxHU5V/jP60K5Sc0xWtFp8RsVxgRdziVXsc PVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4nrPwlooEKXxqANt3eO2v41DucRALo8qLG3CN5HftvE=; b=IZRASCpGSoL5dQnWaDizAgqBY4ekN7TehJ4sxLxz9TYXXS9zE9ht341JpoKnb6KFPd SOHZzZAp5bXQq5gIe9/ScC4hE77LQ/+5GhLqqmZqnGV6q2YniO999G7ghs1+3l0QLgmX /Z4SPWmp7+plCKlBk7wxd7Ni6bzgPtBcpIfv+h1XhK8hxVqWJeyxD4HLumqHs4GSlJu4 g3YNe6NcUfRdNecSh40osYnQr82GzYKUaU++XV7ClekzOgjNlrNa6/OHn4xcRY84dNB9 oRPARZjNQ/iaH53Tgl/UKCPhWL/2pQPCEEUVFvCOznOY2klTkx5uW1Q08LGjiTUn14x4 AgLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=NM0ilE1n; 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 p18si1395447ejb.16.2020.05.07.08.55.31; Thu, 07 May 2020 08:55:56 -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=@st.com header.s=STMicroelectronics header.b=NM0ilE1n; 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 S1727903AbgEGPwS (ORCPT + 99 others); Thu, 7 May 2020 11:52:18 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:64074 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbgEGPwS (ORCPT ); Thu, 7 May 2020 11:52:18 -0400 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 047FlQ6J000799; Thu, 7 May 2020 17:52:11 +0200 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=4nrPwlooEKXxqANt3eO2v41DucRALo8qLG3CN5HftvE=; b=NM0ilE1no1NYlwxIySPJ6mTfapJStGQ24UQ7AP+RE4opFUzTpis+BcupHtBmo8w1nwOF wkD5tejKTVn7iXMlI9s+7ZJL+Ta9U/RqPTUU6nhob0qp/54wDo8E16UriX6DXrZGhmNP rqCEPOSXJe5+5PbgJ6bqN3+YvaAtKh1lFShej5je5I58v2mMtOOV18F5AxSHO3FC790K /I2yr/8B2eUyggsC+ajdYb+1L2k3UgS/5/xfZmFq05CtoAi3WsO411aD3O/PZKU7xoEb uAf37BU1KzTt7PRgRjK4aFVwN2V7y17f5klA3iBGgLTuoq76yiziTW47OHvm/JdPewgR Og== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30rxb2cnm1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 May 2020 17:52:10 +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 231B610002A; Thu, 7 May 2020 17:52:10 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 0B83A2CB27F; Thu, 7 May 2020 17:52:10 +0200 (CEST) Received: from lmecxl0889.tpe.st.com (10.75.127.51) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 7 May 2020 17:52:09 +0200 Subject: Re: [PATCH v3 1/2] remoteproc: Fall back to using parent memory pool if no dedicated available To: Suman Anna , Bjorn Andersson CC: Mathieu Poirier , Loic Pallardy , Tero Kristo , , References: <20200420160600.10467-1-s-anna@ti.com> <20200420160600.10467-2-s-anna@ti.com> From: Arnaud POULIQUEN Message-ID: Date: Thu, 7 May 2020 17:52:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200420160600.10467-2-s-anna@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-07_10:2020-05-07,2020-05-07 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Suman On 4/20/20 6:05 PM, Suman Anna wrote: > From: Tero Kristo > > In some cases, like with OMAP remoteproc, we are not creating dedicated > memory pool for the virtio device. Instead, we use the same memory pool > for all shared memories. The current virtio memory pool handling forces > a split between these two, as a separate device is created for it, > causing memory to be allocated from bad location if the dedicated pool > is not available. Fix this by falling back to using the parent device > memory pool if dedicated is not available. As it fixes the implementation of the legacy, that seems reasonable to me. Acked-by: Arnaud Pouliquen > > Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") > Signed-off-by: Tero Kristo > Signed-off-by: Suman Anna > --- > v3: > - Go back to v1 logic (removed the vdevbuf_mem_id variable added in v2) > - Revised the comment to remove references to vdevbuf_mem_id > - Capitalize the patch header > v2: https://patchwork.kernel.org/patch/11447651/ > > drivers/remoteproc/remoteproc_virtio.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c > index e61d738d9b47..44187fe43677 100644 > --- a/drivers/remoteproc/remoteproc_virtio.c > +++ b/drivers/remoteproc/remoteproc_virtio.c > @@ -376,6 +376,18 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) > goto out; > } > } > + } else { > + struct device_node *np = rproc->dev.parent->of_node; > + > + /* > + * If we don't have dedicated buffer, just attempt to re-assign > + * the reserved memory from our parent. A default memory-region > + * at index 0 from the parent's memory-regions is assigned for > + * the rvdev dev to allocate from. Failure is non-critical and > + * the allocations will fall back to global pools, so don't > + * check return value either. > + */ > + of_reserved_mem_device_init_by_idx(dev, np, 0); > } > > /* Allocate virtio device */ >