Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1956982pxb; Mon, 23 Aug 2021 08:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK510RyEPMvSE095xq8YdiMBwpjhKmnIXcRbcnEzLXcv9sRdq359NZQQg/beUaphJvOH0A X-Received: by 2002:a50:9b03:: with SMTP id o3mr36962224edi.203.1629732776520; Mon, 23 Aug 2021 08:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629732776; cv=none; d=google.com; s=arc-20160816; b=YEARJ4tV1vvxPuwLKpRovLxZ1Weq6le8Ar514iqtrzAmdMFcvtnBnxyt3FBh3sLcC/ rrpcl0NpMsnetlUS5KosIEe2dD8i/oLLPtKp2XnGoC50iz9PM/ONF0OCkLsK+t2lKe3Z 6gayL9pGvpnCgGlgbVXpuf4UyVCZloO4Nr8ewcqKyk7A3gHszupCMsuMe+vrbCivU11W hr2fov62M2znANxtCjDQbXAeY/DAzEgqME4gC0Jd30NbY7AfiBcPmvt+ngqJ/9uncJ6+ ZFqBQBhGFvPNdml0R6biuyvzYY3HX5nDO3k2QIyof0zWrv+pjcpPO2pYIiX0WJpRAUOf OTMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vEaoUziBq3E6zdwPq0ckEpXVtz+BXh6RGLuJML224RM=; b=g3dK+dOAA2XbHA+6D2VcZljEp3u+LH5x6aFsMzP1UlNcfchAV71wOSrqP/K3uBROBX lzXf5HoaOufgl5ZPZPoZM4s7+tOQhXrudLqwRLrP3bg66HyIrA3U6GU5Jz0UAW+XuMo/ In7o20RnRrM/TfqPU8dexj02QRRQzwICRw5hlpE3vAPCI0XDIhHt9ChuZ6VSZ7c583nk +dXGrmwycNKWa4LXhX6qouhSVLTC4Yb07r7bXBXKbpTHo/eHlskxjNGtjlIv8F7PrQUN 10GzoV48pWs+Di7X1JwXEuvmXgckJauRnidGE8S4L2CVDu8WgYmPxVXFm4hfVNW0nbLn XYaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R1zKGChQ; 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 a16si16966895ejk.489.2021.08.23.08.32.30; Mon, 23 Aug 2021 08:32:56 -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=R1zKGChQ; 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 S231608AbhHWPaQ (ORCPT + 99 others); Mon, 23 Aug 2021 11:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbhHWPaQ (ORCPT ); Mon, 23 Aug 2021 11:30:16 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B80C061757 for ; Mon, 23 Aug 2021 08:29:33 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id 7so15690519pfl.10 for ; Mon, 23 Aug 2021 08:29:33 -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=vEaoUziBq3E6zdwPq0ckEpXVtz+BXh6RGLuJML224RM=; b=R1zKGChQimXrdBmVgI9Yg84uCfa/0GDmxaEIaiwyz1EnBS/laU7lveYFQIF/zReUWK 9xYFzvI9mL2SgpPDe3K8n2UaUoAjLsUmyJyyx7RgjeievBH3qw7jD5dgZ4wx75bnKY0p ReTmKrg/Z9DAvdfl7ymFeVlu2Pf4A5M9oGEuJRFo5kAnnkTJ6tnPGH6bHd3T+rbg16a5 BkCBX4VRt+y15qgq5yIMoguvdYlq1nfYXEaBTgtjU0UVuvIj0a3IRU3/OxwqVevCsy7y ClCO/O0E6c2hTSy7hO4U5D049p/+YUlHBvuzX2agZ57rzp9a+SQHas7Wd/PvQJi25LAg guSA== 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=vEaoUziBq3E6zdwPq0ckEpXVtz+BXh6RGLuJML224RM=; b=AxLRkZsN0Pze/NTGAlnPr/4vund+JtHJ5QdEvuQYxlv3X/W13TpbWzr82twvS5+ZkQ wA8QVDVl4PHlPbaW2SYm6KodwdrJothlh45SInN0FrN5Wr+sTuf7mHHHuxCWTTF3037X 6Rkgg0cdTQllEPQ73w76sk48yotlIHi0MnRUujKgSg+PE6KDo/2CGVUQvypbVu+jNjjP 13uf5AAkn5UxAHsKiIZWIcI+dbjUQUQbWgkWytrJZXopVSUkvac/dP0gRRWFhWfOawU2 9+FdEvCP0Hks1resgEeAD+R4JQMe0wq7c6+vwIuR0EAQT7lj+iLYlBTcE7PXibKQ4i31 yR4g== X-Gm-Message-State: AOAM530lEHduNmbUgY9h/GLS1Y1Zgdle7a5J6rW9h3zbFo7Xp7tZLMw1 T7fFY+2lKs1UnpC/ykSZkUNMgA== X-Received: by 2002:a05:6a00:ac6:b029:374:a33b:a74 with SMTP id c6-20020a056a000ac6b0290374a33b0a74mr34979881pfl.51.1629732573011; Mon, 23 Aug 2021 08:29:33 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id p10sm15697567pfw.28.2021.08.23.08.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 08:29:32 -0700 (PDT) Date: Mon, 23 Aug 2021 09:29:30 -0600 From: Mathieu Poirier To: Martin Blumenstingl Cc: linux-remoteproc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com Subject: Re: [PATCH v3 2/2] remoteproc: meson-mx-ao-arc: Add a driver for the AO ARC remote procesor Message-ID: <20210823152930.GA595498@p14s> References: <20210717234859.351911-1-martin.blumenstingl@googlemail.com> <20210717234859.351911-3-martin.blumenstingl@googlemail.com> <20210728175823.GA2766167@p14s> <20210805161506.GA3205691@p14s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210805161506.GA3205691@p14s> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 05, 2021 at 10:15:06AM -0600, Mathieu Poirier wrote: > On Wed, Aug 04, 2021 at 11:03:57PM +0200, Martin Blumenstingl wrote: > > Hi Mathieu, > > > > thanks for taking the time to look into this! > > > > (I will address any of your comments that I am not mentioning in this > > email anymore. Thanks a lot for the suggestions!) > > > > On Wed, Jul 28, 2021 at 7:58 PM Mathieu Poirier > > wrote: > > [...] > > > > + writel(FIELD_PREP(AO_REMAP_REG0_REMAP_AHB_SRAM_BITS_17_14_FOR_ARM_CPU, > > > > + priv->sram_pa >> 14), > > > Indentation problem > > The idea here is to align priv->sram_pa with AO_REMAP_REG0... which > > are both arguments to FIELD_PREP > > Right, this is what I would have expected. When I applied the patch on my side > "priv->sram_pa ..." was aligned wiht the 'M' of "AO_REMAP_ ...". > > > Maybe using something like this will make that easier to read: > > tmp = FIELD_PREP(AO_REMAP_REG0_REMAP_AHB_SRAM_BITS_17_14_FOR_ARM_CPU, > > priv->sram_pa >> 14); > > writel(tmp, priv->remap_base + AO_REMAP_REG0); > > I think the main problem is that > AO_REMAP_REG0_REMAP_AHB_SRAM_BITS_17_14_FOR_ARM_CPU is simply too long. I > suggest making is shorter and add a comment to describe exactly what it does. > > > > > What do you think: leave it as is or use a separate variable? > > > > [...] > > > > + usleep_range(10, 100); > > > > > > I've seen this kind of mysterious timeouts in other patchset based vendor trees. > > > You likely don't know why it is needed so I won't ask. > > unfortunately this is also the case here > > > > [...] > > > > + priv->arc_reset = devm_reset_control_get_exclusive(dev, NULL); > > > > + if (IS_ERR(priv->arc_reset)) { > > > > > > Function __reset_control_get() in __devm_reset_control_get() can return NULL so > > > this should be IS_ERR_OR_NULL(). > > The logic in there is: return optional ? NULL : ERR_PTR(-...); > > Ok, so you meant to do that. And I just checked reset_control_reset() and it does > account for a NULL parameter. I'm good with this one but add a comment to > make sure future readers don't think you've omitted to properly deal with the > NULL return value. > > > I am requesting a mandatory reset line here, so reset core will never > > return NULL > > See also [0] > > Indeed, I've read that too. Nonetheless __reset_control_get() can return NULL > by way of __reset_control_get_from_lookup(). > You are correct, in your case checking for IS_ERR() is sufficient. > > > > For this reason I am not planning to change this > > > > [...] > > > This driver is squeaky clean. With the above: > > > > > > Reviewed-by: Mathieu Poirier > > awesome, thank you! > > > > > > Best regards, > > Martin > > > > > > [0] https://elixir.bootlin.com/linux/v5.14-rc4/source/include/linux/reset.h#L227