Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2036412ybl; Thu, 30 Jan 2020 10:12:57 -0800 (PST) X-Google-Smtp-Source: APXvYqynDvdmQjepOY5+EEk2AgBDqVZSrNHx+MkdUUTWHdwjfcp8cgY/EFLm/o0D8PXhXKfMZm5p X-Received: by 2002:a54:488d:: with SMTP id r13mr3543618oic.115.1580407977078; Thu, 30 Jan 2020 10:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580407977; cv=none; d=google.com; s=arc-20160816; b=PfaE5zS/iQJQ39CCFWxESfuUzDcGhgqzghpBC2weYB9wWKSJnQhoweFT87bQrQ8ley 3pjmM868YZ7nZ21UmT5XQs1RM6gkXsAV6svAsSVqP+YvTBY+GiPQ+Wl/MTTk4AMhHjlA K24HIVUaOcXubZnfw6R5bviqsakI82ghuUtBvADoQHCQYoIMV1sHz19U8cm+By/fut/s tSyuDZNzjCJ0GaJr5Jo7snCTINGqwxQ5S4DaHfp7bklupB/jB9xJCHaEYWNFe8UzWTMl YdVq6chbA8yZ/TpFUZIJ25De8EB3wxniGPArkQdeycX8P7LoDL112WcfrCZix0kkDrXQ DFWw== 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=h+G3LYU16aiLuWdXeyIlXaOLzpHdez77njrJFeFbZgc=; b=oCD07dZkixYAWDnDWr9osDkKMTVyWwLCpOv2vqaAHnVBt6rI4Fx0eIG606y0PrT/Ku 0mqbs7uIQq0REovYVA4TKIWOb5A5p0GtYLy0/DVbKCPXg3a2Bot5pq4sfLmsb286nE6r rLbiHTCkCF0LtLkRcmDi/vLFZHBAiP1qGE4riADaGxX0063PntUNb/1VIuENZmW3fxe8 PCLKoyhNRnfT/08qF160SxL4tOYbrYtQarWxkwCyAxktW3YPe1y4Ym2TLdGIaaMS7ayk PFW0AmgLqOMlqfI6PEu52eMmW1hnaijyiJ+5uhtZDQsolEFRpBsgiiMC5Y02am/4YIBF yZsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VB4nECyO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si3044564otq.146.2020.01.30.10.12.44; Thu, 30 Jan 2020 10:12:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VB4nECyO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728374AbgA3SLo (ORCPT + 99 others); Thu, 30 Jan 2020 13:11:44 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:40990 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbgA3SLo (ORCPT ); Thu, 30 Jan 2020 13:11:44 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00UIBhI8005214; Thu, 30 Jan 2020 12:11:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580407903; bh=h+G3LYU16aiLuWdXeyIlXaOLzpHdez77njrJFeFbZgc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=VB4nECyOLcYrKZ2Lwg0Fj+3Ce9RxR92ut+kqcss4ZGQole0jHQD4F83kbFT3VsQ6e Sl6M5vgI7GTndGQmKueITUkH87KvfPbkxq3Yia2UmyDKelAwLP3vAd8ONUdLp5F2fY M6sxxx7TfHtNKY9M3WIz+MbuVAq7shX/5O2ABcwk= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00UIBhX6046863 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Jan 2020 12:11:43 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 30 Jan 2020 12:11:42 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 30 Jan 2020 12:11:43 -0600 Received: from [10.250.70.160] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00UIBfRd064578; Thu, 30 Jan 2020 12:11:42 -0600 Subject: Re: [PATCHv5 06/14] remoteproc/omap: Initialize and assign reserved memory node To: Tero Kristo , , , CC: , , , References: <20200116135332.7819-1-t-kristo@ti.com> <20200116135332.7819-7-t-kristo@ti.com> From: "Andrew F. Davis" Message-ID: <249c293c-6a23-165f-1df5-4859ee47658a@ti.com> Date: Thu, 30 Jan 2020 13:11:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200116135332.7819-7-t-kristo@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/20 8:53 AM, Tero Kristo wrote: > From: Suman Anna > > The reserved memory nodes are not assigned to platform devices by > default in the driver core to avoid the lookup for every platform > device and incur a penalty as the real users are expected to be > only a few devices. > > OMAP remoteproc devices fall into the above category and the OMAP > remoteproc driver _requires_ specific CMA pools to be assigned > for each device at the moment to align on the location of the > vrings and vring buffers in the RTOS-side firmware images. So, Same comment as before, this is a firmware issue for only some firmwares that do not handle being assigned vring locations correctly and instead hard-code them. This is not a requirement of the remote processor itself and so it should not fail to probe if a specific memory carveout isn't given. Andrew > use the of_reserved_mem_device_init/release() API appropriately > to assign the corresponding reserved memory region to the OMAP > remoteproc device. Note that only one region per device is > allowed by the framework. > > Signed-off-by: Suman Anna > Signed-off-by: Tero Kristo > Reviewed-by: Bjorn Andersson > --- > v5: no changes > > drivers/remoteproc/omap_remoteproc.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c > index 0846839b2c97..194303b860b2 100644 > --- a/drivers/remoteproc/omap_remoteproc.c > +++ b/drivers/remoteproc/omap_remoteproc.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -480,14 +481,22 @@ static int omap_rproc_probe(struct platform_device *pdev) > if (ret) > goto free_rproc; > > + ret = of_reserved_mem_device_init(&pdev->dev); > + if (ret) { > + dev_err(&pdev->dev, "device does not have specific CMA pool\n"); > + goto free_rproc; > + } > + > platform_set_drvdata(pdev, rproc); > > ret = rproc_add(rproc); > if (ret) > - goto free_rproc; > + goto release_mem; > > return 0; > > +release_mem: > + of_reserved_mem_device_release(&pdev->dev); > free_rproc: > rproc_free(rproc); > return ret; > @@ -499,6 +508,7 @@ static int omap_rproc_remove(struct platform_device *pdev) > > rproc_del(rproc); > rproc_free(rproc); > + of_reserved_mem_device_release(&pdev->dev); > > return 0; > } >