Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1051334ybk; Wed, 13 May 2020 22:03:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZBRLrKkCN7hWjn+/UGrBJzlEA06+ZBdWmuK/J1nMr1t+B/JKIixW/yXL+fR6sa+MId4W8 X-Received: by 2002:a17:906:1804:: with SMTP id v4mr2320545eje.104.1589432619688; Wed, 13 May 2020 22:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589432619; cv=none; d=google.com; s=arc-20160816; b=u5RNTpyoehe3jHULETvFRdQSAWEhCMhlOuEhiRDp2jQEpTsAKSJN/DcQkRRaKhuMHb o0b1LQ27EDmNF7ckDe/kaSwjj63jkLqEgpMFByi9eo14GSPVjXpxJlpzrVEl+5p6FZw1 Ptw59Q3o1HcgAah4CtODMQ4LREnzXcMS/No4RKRm0eG5M7NjYw1QKKqbZgZSaDHZk/yW lUGvQRHVx1NAq3D++oh/zZtWpv+y59i4e1MeWB15LyBNfDLdHyzoFQxjf47Hf234qYv5 Tu+TwAENe8tLe9uuruzHUjat7nGwEKtML1uwq9NktvkqxL6Xddg7GHPe4/OVPi+Pm68X MJ7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gRtb+ye+6N2jERJtNafzHVxmDwBVGiZa6FElJAmpzAg=; b=ihQbH2Dwt+gCjC1SLWIaxWpEF0M7fb/LvY3/fQ4wWiIfy41RjIKHEhgnz4OvaXZlug jeXkfmCMZUNboa1qMOiotWgNymDkO9/6C1opefphm9OI2Frm8KGWHJGcjTFtUkPC+51Z 50WyhTQ726tXxPbB1G2aNCTtSzNIAiwArJptPbjR5EEC5fFvY1XndsdL40qsUB+TlEG9 l1CsewHMLwHOOPux0XlGa3sBHLg9QAH8h9EM4hEClSxegEnmli1elYzrd8MvAafhTbUr F9eMuJazB+baFE3uA8dcmucNqTow3oQvaD+ecjsSSaGmchxYYANIy9jmZjyhWwFHSoIT NkAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iTlKFnvL; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si856287edp.75.2020.05.13.22.03.16; Wed, 13 May 2020 22:03:39 -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=@linaro.org header.s=google header.b=iTlKFnvL; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbgENFAr (ORCPT + 99 others); Thu, 14 May 2020 01:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725831AbgENFAq (ORCPT ); Thu, 14 May 2020 01:00:46 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3898C061A0E for ; Wed, 13 May 2020 22:00:45 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id j21so758824pgb.7 for ; Wed, 13 May 2020 22:00:45 -0700 (PDT) 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; bh=gRtb+ye+6N2jERJtNafzHVxmDwBVGiZa6FElJAmpzAg=; b=iTlKFnvLfFYMiRs/m3eZENaimKbVUuQZVgPWtxNuem+VijamM+3tXGhIT/7RFiZ1yb 9hr9CA61VbhbBo3+o5Epa9c+28DXOGdsLDBWAuaJ7gYcFqfR9/zqGs47lEqwrE/wSRBZ 04NAF0Z75+b+Y73uIRcl7N+gkdIXKuaLQX8PQhWal3RUGW+Ir/um6wqe3NanwiAk9jWA Phosz3081FLvsRMMOsZFP1Ne/gQiHo1dwSrMPAHKRdEK3ZeUdbsx7bPzSa/DoiLASZRa mgm/T2uJijxPTULXV0s3P0weaUSJIbptAliKmiiicCGPxvfM+eqja2dH639Xr9a1N/E6 Wq6g== 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; bh=gRtb+ye+6N2jERJtNafzHVxmDwBVGiZa6FElJAmpzAg=; b=JN+0GQJw8FcKVXibiFSR/hl7DZiL/wcaoNt0KRt+ux5N7Vn7CBnANjomslaAS0Ut2j slJUucKn8QrWRhLMVQx7XY8+o+mk2zmavkEILTMvL5tNqAof9RVszv/6zRsMhHPeTi/F jYr/EaHM9xNr8eP3rvc4PdhDLmrIhlDTIsHvI1hMW9XtmQbzOcNfKLV/MjtUAJMpOfNc kvKKk55XxmqeSxkZbTQhb92m8FwPL3oxmmgRAoYRpiGggdCa9FnBYNaOwgky68xU28dn VbALHkZhTIaTMLyH0wY78rsoLsIm8ySO7gSB3fVzb/iq5cI5492eNui9w6q0iezVlfcG oXwQ== X-Gm-Message-State: AOAM532+LA4L42DqXAXPKFWze7mKAeXkc1ftUUvAb5fOw8ghx2G9JO3V MuFG3i4Jb20cMjthObwrE0sAew== X-Received: by 2002:a65:6799:: with SMTP id e25mr2609901pgr.9.1589432445068; Wed, 13 May 2020 22:00:45 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id a15sm16664612pju.3.2020.05.13.22.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 22:00:44 -0700 (PDT) Date: Wed, 13 May 2020 21:59:14 -0700 From: Bjorn Andersson To: Mathieu Poirier Cc: ohad@wizery.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, loic.pallardy@st.com, arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 03/12] remoteproc: stm32: Decouple rproc from DT parsing Message-ID: <20200514045914.GI16107@builder.lan> References: <20200424202505.29562-1-mathieu.poirier@linaro.org> <20200424202505.29562-4-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200424202505.29562-4-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 24 Apr 13:24 PDT 2020, Mathieu Poirier wrote: > Remove the remote processor from the process of parsing the device tree > since (1) there is no correlation between them and (2) to use the > information that was gathered to make a decision on whether to > synchronise with the M4 or not. > > Signed-off-by: Mathieu Poirier Reviewed-by: Bjorn Andersson > --- > drivers/remoteproc/stm32_rproc.c | 25 ++++++++++++++----------- > 1 file changed, 14 insertions(+), 11 deletions(-) > > diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c > index 1ac90adba9b1..57a426ea620b 100644 > --- a/drivers/remoteproc/stm32_rproc.c > +++ b/drivers/remoteproc/stm32_rproc.c > @@ -538,12 +538,11 @@ static int stm32_rproc_get_syscon(struct device_node *np, const char *prop, > return err; > } > > -static int stm32_rproc_parse_dt(struct platform_device *pdev) > +static int stm32_rproc_parse_dt(struct platform_device *pdev, > + struct stm32_rproc *ddata, bool *auto_boot) > { > struct device *dev = &pdev->dev; > struct device_node *np = dev->of_node; > - struct rproc *rproc = platform_get_drvdata(pdev); > - struct stm32_rproc *ddata = rproc->priv; > struct stm32_syscon tz; > unsigned int tzen; > int err, irq; > @@ -589,7 +588,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev) > > err = regmap_read(tz.map, tz.reg, &tzen); > if (err) { > - dev_err(&rproc->dev, "failed to read tzen\n"); > + dev_err(dev, "failed to read tzen\n"); > return err; > } > ddata->secured_soc = tzen & tz.mask; > @@ -605,7 +604,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev) > if (err) > dev_info(dev, "failed to get pdds\n"); > > - rproc->auto_boot = of_property_read_bool(np, "st,auto-boot"); > + *auto_boot = of_property_read_bool(np, "st,auto-boot"); > > return stm32_rproc_of_memory_translations(pdev, ddata); > } > @@ -616,6 +615,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) > struct stm32_rproc *ddata; > struct device_node *np = dev->of_node; > struct rproc *rproc; > + bool auto_boot = false; > int ret; > > ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); > @@ -626,9 +626,16 @@ static int stm32_rproc_probe(struct platform_device *pdev) > if (!rproc) > return -ENOMEM; > > + ddata = rproc->priv; > + > rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE); > + > + ret = stm32_rproc_parse_dt(pdev, ddata, &auto_boot); > + if (ret) > + goto free_rproc; > + > + rproc->auto_boot = auto_boot; > rproc->has_iommu = false; > - ddata = rproc->priv; > ddata->workqueue = create_workqueue(dev_name(dev)); > if (!ddata->workqueue) { > dev_err(dev, "cannot create workqueue\n"); > @@ -638,13 +645,9 @@ static int stm32_rproc_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, rproc); > > - ret = stm32_rproc_parse_dt(pdev); > - if (ret) > - goto free_wkq; > - > ret = stm32_rproc_request_mbox(rproc); > if (ret) > - goto free_rproc; > + goto free_wkq; > > ret = rproc_add(rproc); > if (ret) > -- > 2.20.1 >