From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D90BC3F2D1 for ; Wed, 4 Mar 2020 17:42:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 626B622B48 for ; Wed, 4 Mar 2020 17:42:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PW3BlBZq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbgCDRmQ (ORCPT ); Wed, 4 Mar 2020 12:42:16 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42234 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbgCDRmQ (ORCPT ); Wed, 4 Mar 2020 12:42:16 -0500 Received: by mail-pf1-f193.google.com with SMTP id f5so1303862pfk.9 for ; Wed, 04 Mar 2020 09:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ORwRRRdgoQK5aNU1JwMjXGzWTLkU/TYlQ7H6iaT7pZc=; b=PW3BlBZqBwsm7kiZXLa4mMyKvpwjhD5DE4sPZ9h/G96K0ltAZhl2mFH1cHpydDUUl5 lyq0Klf8iD00Fgc0IDt0kDMRYfPxepDD8gxZxjH8biascUlrw/XOo1UnBLCSponN0jP4 9DRVFTEgN9t4ONGrbv8qAEW+yzrZGpfaj3kue/5fl6zKhZDJfwKjnem1QMAtAYzJbUrG zzqJ0Bz7YDXD4xczhGsChqrlWlZ75DwjaUTP0qSOb+/TIm8VX4LkJbLwNWABbmwDyp+k jVjUTqqNhgOHeYJhToLT7QMbNSST6q7T5D3mijWvMayPCHl0GTCVCCjc04FOap2zsZui Vo2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ORwRRRdgoQK5aNU1JwMjXGzWTLkU/TYlQ7H6iaT7pZc=; b=cR+7wyNyL4Mj5fyO7xSSuHiJRmqO9vOt16GCXGx3ngm+M+s7rjhRPVIPJOgTYN5xnq REtNuPeuI5/VyF5HfdYYMyFwtkA+6IHwxDk/NIX8LybAN37l/YSQF11pLbsXOyCjCOfW ggzD/WpY+ZBKnnHAEhU074fNVR6Li2qjH/qqoqIZB+JGgo1ZXV2kVFCcYHfc80XkjYK9 yn3vR8Trf8aiHdYBZT3TScJSxfiZqeAH1GkQEMq4DvUQ/D7XgMZSRQoPIdP5YwDq6OO5 IIKcwzR8To2lZCctxUJHtHMWJum5rSuU1uHCnMX+hbZ8/0k5kCgMSGQ57hqYRJWPXn4r VBxA== X-Gm-Message-State: ANhLgQ1TVaffwRsPMqUuxEfYx12ZUckqKCwByzf/RmnEFtx3WOnGjZM0 Mv3sgWyfkIFM14WOSh17xv3IQw== X-Google-Smtp-Source: ADFU+vukPD9ymutUBQQTozGF7SeiJFsz/w5gVeP8LDhN7HoWX/8Xq7QfUuba2HcdgdoylDgOdRqFiw== X-Received: by 2002:a63:1a50:: with SMTP id a16mr3433267pgm.389.1583343733384; Wed, 04 Mar 2020 09:42:13 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b25sm29520654pfo.38.2020.03.04.09.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 09:42:12 -0800 (PST) Date: Wed, 4 Mar 2020 10:42:10 -0700 From: Mathieu Poirier To: Tero Kristo Cc: bjorn.andersson@linaro.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org, afd@ti.com, s-anna@ti.com, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCHv7 06/15] remoteproc/omap: Initialize and assign reserved memory node Message-ID: <20200304174210.GE8197@xps15> References: <20200221101936.16833-1-t-kristo@ti.com> <20200221101936.16833-7-t-kristo@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221101936.16833-7-t-kristo@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 12:19:27PM +0200, 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, > 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 > --- > drivers/remoteproc/omap_remoteproc.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c > index 89084dd919ba..872cd0df342b 100644 > --- a/drivers/remoteproc/omap_remoteproc.c > +++ b/drivers/remoteproc/omap_remoteproc.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -483,14 +484,23 @@ 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_warn(&pdev->dev, "device does not have specific CMA pool.\n"); > + dev_warn(&pdev->dev, "Typically this should be provided,\n"); > + dev_warn(&pdev->dev, "only omit if you know what you are doing.\n"); > + } I suppose that if no reserved memory has been specified things will go south pretty quickly. I'm fine with the first line being a dev_warn() but would devinitely move the next two to dev_info(). Since Bjorn has already agreed to this, with or without the above: Acked-by: Mathieu Poirier > + > 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; > @@ -502,6 +512,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; > } > -- > 2.17.1 > > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki