From: Adrián Larumbe <adrian.larumbe@collabora.com>
To: Biju <biju.das.au@gmail.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>,
Rob Herring <robh@kernel.org>,
Steven Price <steven.price@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Biju Das <biju.das.jz@bp.renesas.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 2/4] drm/panfrost: Drop redundant optional clock checks in runtime PM
Date: Fri, 20 Mar 2026 21:19:31 +0000 [thread overview]
Message-ID: <ab25E0kTBA4EjZ3Y@sobremesa> (raw)
In-Reply-To: <20260320164158.487406-3-biju.das.jz@bp.renesas.com>
Hi Biju,
On 20.03.2026 16:41, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> The clk_enable() and clk_disable() APIs already handle NULL clock pointers
> gracefully — clk_enable() returns 0 and clk_disable() returns immediately
> when passed a NULL or optional clock. The explicit if (pfdev->bus_clock)
> guards around these calls in the runtime suspend/resume paths are
> therefore unnecessary. Remove them to simplify the code.
>
> Reviewed-by: Steven Price <steven.price@arm.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * Collected tag
> ---
> drivers/gpu/drm/panfrost/panfrost_device.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c
> index dedc13e56631..01e702a0b2f0 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_device.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_device.c
> @@ -429,11 +429,9 @@ static int panfrost_device_runtime_resume(struct device *dev)
> if (ret)
> goto err_clk;
>
> - if (pfdev->bus_clock) {
> - ret = clk_enable(pfdev->bus_clock);
> - if (ret)
> - goto err_bus_clk;
> - }
> + ret = clk_enable(pfdev->bus_clock);
> + if (ret)
> + goto err_bus_clk;
> }
It seems clk_prepare_enable() can also deal with NULL clock device pointers gracefully,
so maybe you could also do away with pointer checks in panfrost_clk_init?
Other than that,
Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com>
> panfrost_device_reset(pfdev, true);
> @@ -464,9 +462,7 @@ static int panfrost_device_runtime_suspend(struct device *dev)
> panfrost_gpu_power_off(pfdev);
>
> if (pfdev->comp->pm_features & BIT(GPU_PM_RT)) {
> - if (pfdev->bus_clock)
> - clk_disable(pfdev->bus_clock);
> -
> + clk_disable(pfdev->bus_clock);
> clk_disable(pfdev->clock);
> reset_control_assert(pfdev->rstc);
> }
> --
> 2.43.0
Adrian Larumbe
next prev parent reply other threads:[~2026-03-20 21:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 16:41 [PATCH v2 0/4] Add RZ/G3L GFX support Biju
2026-03-20 16:41 ` [PATCH v2 1/4] dt-bindings: gpu: mali-bifrost: Add compatible for RZ/G3L SoC Biju
2026-03-21 17:29 ` Claude review: " Claude Code Review Bot
2026-03-20 16:41 ` [PATCH v2 2/4] drm/panfrost: Drop redundant optional clock checks in runtime PM Biju
2026-03-20 21:19 ` Adrián Larumbe [this message]
2026-03-20 21:32 ` Biju Das
2026-03-21 14:16 ` Biju Das
2026-03-21 17:29 ` Claude review: " Claude Code Review Bot
2026-03-20 16:41 ` [PATCH v2 3/4] drm/panfrost: Add bus_ace optional clock support for RZ/G2L Biju
2026-03-20 21:15 ` Adrián Larumbe
2026-03-21 17:29 ` Claude review: " Claude Code Review Bot
2026-03-20 16:41 ` [PATCH v2 4/4] drm/panfrost: Add GPU_PM_RT support for RZ/G3L SoC Biju
2026-03-20 21:14 ` Adrián Larumbe
2026-03-21 17:29 ` Claude review: " Claude Code Review Bot
2026-03-21 17:29 ` Claude review: Add RZ/G3L GFX support Claude Code Review Bot
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=ab25E0kTBA4EjZ3Y@sobremesa \
--to=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=biju.das.au@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/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