From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933016AbdBHJMt (ORCPT ); Wed, 8 Feb 2017 04:12:49 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:36894 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932969AbdBHJLH (ORCPT ); Wed, 8 Feb 2017 04:11:07 -0500 From: Hugues FRUCHET To: Loic PALLARDY , "bjorn.andersson@linaro.org" , "ohad@wizery.com" , "lee.jones@linaro.org" CC: "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@stlinux.com" , Patrice CHOTARD , "peter.griffin@linaro.org" Subject: Re: [v3, 4/4] remoteproc: core: don't allocate carveout if pa or da are defined Thread-Topic: [v3, 4/4] remoteproc: core: don't allocate carveout if pa or da are defined Thread-Index: AQHSgenaD1hc2jQBVE6b9nKT7b/DAA== Date: Wed, 8 Feb 2017 09:00:53 +0000 Message-ID: <2412fafd-6544-1d62-a8c6-5162d2d8cfb4@st.com> References: <1485866156-6364-5-git-send-email-loic.pallardy@st.com> In-Reply-To: <1485866156-6364-5-git-send-email-loic.pallardy@st.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.47] Content-Type: text/plain; charset="utf-8" Content-ID: <0830F387FBFDB143BD176F4FD5ADD0B8@st.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-08_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v189CvXn002409 On 01/31/2017 01:35 PM, Loic PALLARDY wrote: > Remoteproc doesn't check if firmware requests fixed > addresses for carveout regions. > Current assumption is that platform specific driver is in > charge of coprocessor specific memory region allocation and > remoteproc core doesn't have to handle them. > If a da or a pa is specified in firmware resource table, remoteproc > core doesn't have to perform any allocation. > Access to carveout will be done thanks to rproc_da_to_pa function, > which will provide virtual address on carveout region allocated > by platform specific driver. > > Signed-off-by: Loic Pallardy Acked-and-tested-by: Hugues Fruchet Tested on B2260 ST Platform with st-delta video decoder V4L2 kernel driver (http://www.mail-archive.com/linux-media@vger.kernel.org/msg107644.html). > --- > No change since V1 > > drivers/remoteproc/remoteproc_core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 90b05c7..dd63ceed 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -622,6 +622,11 @@ static int rproc_handle_carveout(struct rproc *rproc, > dev_dbg(dev, "carveout rsc: name: %s, da 0x%x, pa 0x%x, len 0x%x, flags 0x%x\n", > rsc->name, rsc->da, rsc->pa, rsc->len, rsc->flags); > > + if (rsc->pa != FW_RSC_ADDR_ANY || rsc->da != FW_RSC_ADDR_ANY) { > + dev_dbg(dev, "carveout already allocated by low level driver\n"); > + return 0; > + } > + > carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); > if (!carveout) > return -ENOMEM; > >