Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp629666ybz; Wed, 29 Apr 2020 06:40:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKl1wXahODy8fxEYmSz2LQ4+oReNnaBxlX04G3LunOAx446/oyAbhdvBYRr8HcJELPkD/rc X-Received: by 2002:a50:d987:: with SMTP id w7mr2428424edj.276.1588167637551; Wed, 29 Apr 2020 06:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588167637; cv=none; d=google.com; s=arc-20160816; b=fvbVopoXc9omEZ74nTlju6HgsgJdiFqcETpdlTrQW1lcAfrE8fyiDGY9lOiGTA6yq5 DDDvxektQEQBiy4BDOmPVVl+UB+bbHN2I4fAb+FHCH1nuBm55JpDGVMkqShQHzVEngas VhY65jtqTfqh2qfIVfyftFsHjWHbe55g6/obz7UCcOFWkQk87gtfQnXTGk6DlcIYPO56 13j6pNsrXlERs8N1LFZLOHxRyMdMpAw4vlRsh/pEVW7hBxSw4dtTR9wKa5VnvWXpPIsR i/PK75wbMKGo1rQcZFSP4tLP97V3niXjQJYQ05VgWki8uNrL1d/9bvNmpAiiSj0hcmIk lSlA== 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=bJQux7EgibvvlrfXQNK8JzLDHncWGBXxPs2Cap42l5k=; b=EtjBNYgJ2nS7AN+YOOvb/Gb7km5fohHcE6AHKuoPdMWyuQEJxyxYCz03/4j7IURxKl ps/5hqXNy1ObL8vv0lMLF+rQhhPIDs692+UE6c4SoaFNAzNlJLD6GvadvRI0cYYJOdsV sL+qQIMCjZ9Gkf4rs3tCWk6FXJch1B9Y7fqJE71s2EwqE4sT1hI7PpAIEdqWIWf4e6yw iQdSFKeOjqlgedD7mHU9ZfOGFELH+RZDi0xLXcvmr25EiJopeEn5zA7OxmWQiTblc6Yt bM8Vv+9Unz9Sy3yUePFK4vpxIO0G+BDfvQuWiUi7NyC3G4efZmdcRavVRYyrHv/9aDY7 1vRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=hnHXCWVl; 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 l22si3946407ejg.362.2020.04.29.06.40.13; Wed, 29 Apr 2020 06:40:37 -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=hnHXCWVl; 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 S1728147AbgD2NiP (ORCPT + 99 others); Wed, 29 Apr 2020 09:38:15 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:11894 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727053AbgD2NiO (ORCPT ); Wed, 29 Apr 2020 09:38:14 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03TDWPpl025320; Wed, 29 Apr 2020 15:38:01 +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=bJQux7EgibvvlrfXQNK8JzLDHncWGBXxPs2Cap42l5k=; b=hnHXCWVlL4f/N7JJoY4Bj+dFB4Tnl5MUR8GNAeC2Yx7MjRLk1LA035y9T++V/Z5g4Ebm SIGyGFj1ZReorYoVgJnDFZ5Zrybx51YYPoaqUkLBmAdeBewrXjJT0V2QFZ6mmUgFzOhW ivGWTRlF/AxVywtcS6pbrd838J5tEimkEC5SY8OY2YcHnnl0GvxE8Z+S+eU0JMPN/Ilf STkKFMugvElB1XNkFB3yYe3K12yit/PKMW2bknCb32CPLpa62+jewSaNIHF6ERM7tr2q emGDbtILgSczSBk8OGEXLLw8vKVen4EU9uLnt6rDPr4HnQEpsAwT3pMl4UWOby4bAuwp +g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30mhq66mu6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 15:38:01 +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 B632010002A; Wed, 29 Apr 2020 15:38:00 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A153921F687; Wed, 29 Apr 2020 15:38:00 +0200 (CEST) Received: from lmecxl0889.tpe.st.com (10.75.127.45) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 29 Apr 2020 15:37:59 +0200 Subject: Re: [PATCH v2 03/12] remoteproc: stm32: Decouple rproc from DT parsing To: Mathieu Poirier , , , , CC: , , , , References: <20200424202505.29562-1-mathieu.poirier@linaro.org> <20200424202505.29562-4-mathieu.poirier@linaro.org> From: Arnaud POULIQUEN Message-ID: Date: Wed, 29 Apr 2020 15:37:58 +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: <20200424202505.29562-4-mathieu.poirier@linaro.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG7NODE1.st.com (10.75.127.19) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-29_05:2020-04-29,2020-04-29 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu, On 4/24/20 10:24 PM, 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 > --- > 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; Nitpicking: Seems that you don't need to initialize it. Perhaps you can simply suppress the local variable and directly use rproc->auto_boot. else LGTM Thanks, Arnaud > 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) >