linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tomi Valkeinen" <tomi.valkeinen+renesas@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver
Date: Mon, 07 Sep 2026 09:42:51 +0000	[thread overview]
Message-ID: <20260907094252.049221F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907-rcar-du-dsc-v6-2-f8ef711a7494@ideasonboard.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Lifecycle teardown order inversion between manual PM runtime disable and devres bridge removal.
--

commit a2a78077050a0efecae114552f483f67a6423d4c
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>

drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s. Add rudimentary driver, which currently acts as a
pass-through bridge and allows DSI1 to be operational on R-Car V4H.

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
> new file mode 100644
> index 0000000000000..1882ae34ce8f5
> --- /dev/null
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
[ ... ]
> +static void rcar_dsc_atomic_enable(struct drm_bridge *bridge,
> +				   struct drm_atomic_commit *commit)
> +{
> +	struct rcar_dsc *dsc = bridge_to_rcar_dsc(bridge);
> +
> +	WARN_ON(pm_runtime_get_sync(dsc->dev) < 0);
> +}
[ ... ]
> +static int rcar_dsc_probe(struct platform_device *pdev)
> +{
[ ... ]
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_drm_bridge_add(dev, &dsc->bridge);
> +	if (ret)
> +		goto err_runtime_disable;
> +
> +	return 0;
> +
> +err_runtime_disable:
> +	pm_runtime_disable(&pdev->dev);
> +
> +	return ret;
> +}
> +
> +static void rcar_dsc_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);
> +}

[Severity: High]
Does this create a lifecycle teardown order inversion during driver unbind?

When the driver is unbound, the driver core executes the manual
rcar_dsc_remove() callback first, which calls pm_runtime_disable(). Only
afterwards does the devres infrastructure execute drm_bridge_remove()
(registered via devm_drm_bridge_add() in rcar_dsc_probe()), removing the
bridge from the system.

During this window, the DRM bridge remains active and accessible to the DRM
core after its power management has been disabled. If an atomic commit occurs
during this time, rcar_dsc_atomic_enable() will invoke pm_runtime_get_sync(),
which will fail since PM runtime is disabled. This triggers a WARN_ON and
leaves the hardware unpowered.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-rcar-du-dsc-v6-0-f8ef711a7494@ideasonboard.com?part=2

  reply	other threads:[~2026-09-07  9:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-09-07  9:42   ` sashiko-bot [this message]
2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
2026-09-07  9:44   ` sashiko-bot
2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
2026-09-08 12:11   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
2026-09-07  9:43   ` sashiko-bot
2026-09-08 12:16   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support Tomi Valkeinen
2026-09-11  7:07 ` [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-09-14  8:04   ` Geert Uytterhoeven

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=20260907094252.049221F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tomi.valkeinen+renesas@ideasonboard.com \
    --cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).