mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Yejune Deng <yejune.deng@gmail.com>,
	robh@kernel.org, tomeu.vizoso@collabora.com,
	alyssa.rosenzweig@collabora.com, airlied@linux.ie,
	daniel@ffwll.ch, p.zabel@pengutronix.de
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panfrost: Add support for non-existent reset node
Date: Mon, 2 Nov 2020 09:11:43 +0000	[thread overview]
Message-ID: <64fb3d99-d42b-6135-0670-ab50205714ad@arm.com> (raw)
In-Reply-To: <1604307289-32110-1-git-send-email-yejune.deng@gmail.com>

On 02/11/2020 08:54, Yejune Deng wrote:
> Some dts hasn't no reset node, is should ok.
> 
> Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
> ---
>   drivers/gpu/drm/panfrost/panfrost_device.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c
> index ea8d318..a982878 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_device.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_device.c
> @@ -18,7 +18,12 @@
>   
>   static int panfrost_reset_init(struct panfrost_device *pfdev)
>   {
> -	pfdev->rstc = devm_reset_control_array_get(pfdev->dev, false, true);
> +	pfdev->rstc = devm_reset_control_array_get_optional_exclusive(pfdev->dev);

This change is fine - it should have no functional change and makes the 
code more readable.

> +	if (!pfdev->rstc) {
> +		dev_info(pfdev->dev, "reset does not exist\n");

I don't think this output is particularly useful.

> +		return 0;

The early return isn't necessary. IS_ERR(NULL) is false, and 
reset_control_deassert() deals fine with NULL, so the path below would 
be fine.

> +	}
> +
>   	if (IS_ERR(pfdev->rstc)) {
>   		dev_err(pfdev->dev, "get reset failed %ld\n", PTR_ERR(pfdev->rstc));
>   		return PTR_ERR(pfdev->rstc);
> @@ -29,7 +34,8 @@ static int panfrost_reset_init(struct panfrost_device *pfdev)
>   
>   static void panfrost_reset_fini(struct panfrost_device *pfdev)
>   {
> -	reset_control_assert(pfdev->rstc);
> +	if (pfdev->rstc)
> +		reset_control_assert(pfdev->rstc);

reset_control_assert() deals fine with a NULL input, so this is unneeded.

>   }
>   
>   static int panfrost_clk_init(struct panfrost_device *pfdev)
> 

Have you actually seen a problem on a platform without a reset node - it 
works fine for me and I can't see any functional change with this patch.

Steve

      reply	other threads:[~2020-11-02  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02  8:54 Yejune Deng
2020-11-02  9:11 ` Steven Price [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64fb3d99-d42b-6135-0670-ab50205714ad@arm.com \
    --to=steven.price@arm.com \
    --cc=airlied@linux.ie \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=tomeu.vizoso@collabora.com \
    --cc=yejune.deng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®