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.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 F03A3C47247 for ; Thu, 30 Apr 2020 20:58:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0027207DD for ; Thu, 30 Apr 2020 20:58:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gVduoNLO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CsTBErZF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0027207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ALNL5z5bubO3KKQACtv57aNV7E2dZOLfTx0XdbjihVg=; b=gVduoNLOd2ro8F Xy3ejKg2DzBfDPXN1xAw9dCUnYYh1DFXiqaSfZjAL/Dz3oRPx3UTjPC20m/HhYQJyPBrSnnMrYH+x xM9WmzDHvjzsTmgNA0xHw9FMEiLs/qvBA7tSIJtPltwE1vKuRkS4f48sR07utTrso/rO+QVMopDDE oNsoIvc7lFAfQgDNCSo1R7l2WzU5hnQ/ospaU3yfAya2dBWnRYQDm303qpEssDHcesuwIN1nhe6mh C7GLQNPw8586M0LFarka3hRcvZIbeSibZQmoQvZ9Mpq0Qhfq9dthII4EptA/sxlnEFf89nAIyO3oP oOWJdFa6LS6thPrmrWGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUGGI-0000Po-65; Thu, 30 Apr 2020 20:58:26 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jUGGF-0000PC-2D for linux-arm-kernel@lists.infradead.org; Thu, 30 Apr 2020 20:58:24 +0000 Received: by mail-pj1-x1042.google.com with SMTP id y6so1383060pjc.4 for ; Thu, 30 Apr 2020 13:58:22 -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:user-agent; bh=MX/gFKorFD3fJiz0waGi+R3fRw1GVFpupUsSX0SPyJY=; b=CsTBErZFaAQkEbs5S+GlwA8kRzgyJRrcYYtemLqJ9WlfIPAhaq6G4rW9gc3uI8mECY OMjpu0MqbtnrkkGBFU8c/hoxlzYOAoSNV2BdQCVF8lHP2UPvKSWGeIHDMTYDp8al261g lV8Vh0nWV30oVczqakw539UDRjIKSR24bd1HFHrw8Gf7opTt4Vk+SSqj/xO2nokwhZw2 1OOJwQdoa+tqNpeiHYjzibN2xdFDXDes6gRUNiPGVnncDZywStP0554NDEfMabSOjeis 8vfPXauZSf0IR0nm3IJrCMbGs3o/HsvmL3H0ypxjyka1O616cT1vv/24yQwBFsHDsy91 9a3w== 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=MX/gFKorFD3fJiz0waGi+R3fRw1GVFpupUsSX0SPyJY=; b=jj15JarbxLulNI+/Ec5WbaI9xEF3vWDcHYnW8P9iy23yRSrhR2bwo6MR7WaylS81Uy 2bm+ECrnObKOY5rLVBWLmM2/zHk9NY8un6XtGMyW65YAh00TzSkCNFJsgXalIYht7OpB 5bItsK7ctDzUQ8AH/bJ7ByezQiK+UL0CcYHXT6ek46Cm/P72+13Jm4IysdXaWOHlrJvT 6JXpdPeV2BaUNyFxiVaDBrirqNuJhmXhaUYHYfPcPU9XFdh8m4hsnEjYAIxxYqh2J9Ph bpBF6RHjYfuA4AkpRw9J91cWEYugQym8IRlNt9QR3r4TL17x5ouhxKK3oQy31B1I9pUc cDeA== X-Gm-Message-State: AGi0Puay98jvqAp984Waj0yOvaBkupG03kSHXBNEvaj2yUcmwdX5Q+Zh l69KTHeR32iqijI9Js3rB7HFLg== X-Google-Smtp-Source: APiQypKe3OdI9QEW41vMal8UJb8GDAGm5V7tlJQS0ryzb463ValPrIAGP3jeUyn/S22VakZZUZ9faw== X-Received: by 2002:a17:90b:297:: with SMTP id az23mr762282pjb.85.1588280301989; Thu, 30 Apr 2020 13:58:21 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id v7sm559509pfm.146.2020.04.30.13.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 13:58:21 -0700 (PDT) Date: Thu, 30 Apr 2020 14:58:19 -0600 From: Mathieu Poirier To: Arnaud POULIQUEN Subject: Re: [PATCH v2 03/12] remoteproc: stm32: Decouple rproc from DT parsing Message-ID: <20200430205819.GD18004@xps15> References: <20200424202505.29562-1-mathieu.poirier@linaro.org> <20200424202505.29562-4-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200430_135823_144317_747FC2EA X-CRM114-Status: GOOD ( 21.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ohad@wizery.com, alexandre.torgue@st.com, loic.pallardy@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, mcoquelin.stm32@gmail.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 29, 2020 at 03:37:58PM +0200, Arnaud POULIQUEN wrote: > 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. I think you are correct. > Perhaps you can simply suppress the local variable and directly use rproc->auto_boot. ... and change the value of rproc->auto_boot if state == M4_STATE_CRUN? Sure, that's possible. Thanks for all the comments, it really helps to have a different perspective. I am out of time for today but will continue with the rest of your comments tomorrow. Mathieu > > 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) > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel