Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paul Elder" <paul.elder+renesas@ideasonboard.com>
Cc: linux-clk@vger.kernel.org, media-ci@linuxtv.org,
	conor+dt@kernel.org, wsa+renesas@sang-engineering.com,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 10/11] media: rcar-fcp: Handle resets
Date: Fri, 18 Sep 2026 17:23:34 +0000	[thread overview]
Message-ID: <20260918172335.7CBEA1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919-epaul-v7-3-rc1-x5h-vsp-fcp-v2-10-dbe9236bfd22@ideasonboard.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] media: rcar-fcp: hardware access while in reset due to PM ordering
- [Medium] media: rcar-fcp: missing reset assertion on driver unbind due to async PM
--

commit d0433a4b8db079b09c43d3564a42e501b20457b1
Author: Paul Elder <paul.elder+renesas@ideasonboard.com>

media: rcar-fcp: Handle resets

On some versions of the FCP, such as the one on the X5H, reset control
is required to operate the FCP. Add support for handling resets
optionally, to continue supporting versions that do not require it.

> diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/platform/renesas/rcar-fcp.c
> index dfb0ca93e854d..76d4c250b3081 100644
> --- a/drivers/media/platform/renesas/rcar-fcp.c
> +++ b/drivers/media/platform/renesas/rcar-fcp.c

[ ... ]

> @@ -190,6 +197,24 @@ static void rcar_fcp_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  }

[Severity: Medium]
Will this leave the device powered on and out of reset if the driver is
unbound?

A client driver (like VSP1) calls rcar_fcp_disable(), which performs an
asynchronous pm_runtime_put(). If the rcar_fcp driver is removed via sysfs
immediately afterward, rcar_fcp_remove() calls pm_runtime_disable() which
cancels any pending asynchronous idle/suspend work.

Because rcar_fcp_remove() relies solely on pm_runtime_disable() without a
synchronous suspend (e.g., via pm_runtime_put_sync() or manually asserting
the reset), the device is trapped in RPM_ACTIVE and the reset control will be
released without being asserted.

> +static int fcp_pm_runtime_suspend(struct device *dev)
> +{
> +	struct rcar_fcp_device *fcp = dev_get_drvdata(dev);
> +
> +	return reset_control_assert(fcp->rstc);
> +}
> +
> +static int fcp_pm_runtime_resume(struct device *dev)
> +{
> +	struct rcar_fcp_device *fcp = dev_get_drvdata(dev);
> +
> +	return reset_control_deassert(fcp->rstc);
> +}

[Severity: High]
Does tying the reset control to runtime PM here cause the hardware to be
accessed while still in reset?

The vsp1 driver's PM resume callback (vsp1_pm_runtime_resume) calls
vsp1_device_init(), which in turn calls vsp1_reset_wpf(). This function
invokes rcar_fcp_soft_reset(), performing register I/O on the FCP:

drivers/media/platform/renesas/rcar-fcp.c:rcar_fcp_soft_reset() {
    ...
	rcar_fcp_write(fcp, RCAR_FCP_REG_RST, RCAR_FCP_REG_RST_SOFTRST);
	ret = readl_poll_timeout(fcp->base + RCAR_FCP_REG_STA, ...);
    ...
}

However, vsp1_pm_runtime_resume() only enables the FCP (via
rcar_fcp_enable()) after calling vsp1_device_init().

Since the FCP is not yet PM-resumed when rcar_fcp_soft_reset() executes, its
reset control is still asserted. Writing to hardware registers while the
device is held in reset causes a bus hang or imprecise external abort.

> +
> +static const struct dev_pm_ops fcp_pm_ops = {
> +	RUNTIME_PM_OPS(fcp_pm_runtime_suspend, fcp_pm_runtime_resume, NULL)
> +};
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919-epaul-v7-3-rc1-x5h-vsp-fcp-v2-0-dbe9236bfd22@ideasonboard.com?part=10

  reply	other threads:[~2026-09-18 17:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 17:06 [PATCH DNI v2 00/11] media: rcar-fcp, vsp1: Enable on R-Car X5H Paul Elder
2026-09-18 17:06 ` [PATCH DNI v2 01/11] dt-bindings: clock: renesas,r8a78000-cpg: Add CPG_SGD4_VIO_DP_{TX,OTHER} Paul Elder
2026-09-18 17:06 ` [PATCH DNI v2 02/11] clk: renesas: r8a78000: Add clock for FCPV and VSP for SCP FW SDKv4.36 Paul Elder
2026-09-18 17:07 ` [PATCH v2 03/11] pmdomain: renesas: r8a78000: Add maps for VIO " Paul Elder
2026-09-18 17:18   ` sashiko-bot
2026-09-19 17:40   ` Laurent Pinchart
2026-09-18 17:07 ` [PATCH v2 04/11] arm64: renesas: r8a78000: Add FCPV[BI] nodes Paul Elder
2026-09-18 17:18   ` sashiko-bot
2026-09-18 17:07 ` [PATCH v2 05/11] arm64: renesas: r8a78000: Add VSP[BI] nodes Paul Elder
2026-09-18 17:07 ` [PATCH v2 06/11] arm64: renesas: r8a78000: Add FCPVD and VSPD nodes Paul Elder
2026-09-19 17:56   ` Laurent Pinchart
2026-09-18 17:07 ` [PATCH v2 07/11] media: vsp1: Support full VSPB on R-Car M3-W, M3-N and E3 Paul Elder
2026-09-18 17:07 ` [PATCH v2 08/11] media: vsp1: Document X5H SoC ID Paul Elder
2026-09-19 17:58   ` Laurent Pinchart
2026-09-24  9:16     ` Paul Elder
2026-09-24 14:38       ` Laurent Pinchart
2026-09-18 17:07 ` [PATCH v2 09/11] media: vsp1: Add device info entries for VSPD on X5H Paul Elder
2026-09-18 17:17   ` sashiko-bot
2026-09-19 18:11   ` Laurent Pinchart
2026-09-18 17:07 ` [PATCH v2 10/11] media: rcar-fcp: Handle resets Paul Elder
2026-09-18 17:23   ` sashiko-bot [this message]
2026-09-19 18:15   ` Laurent Pinchart
2026-09-18 17:07 ` [PATCH DNI v2 11/11] media: rcar-fcp: Check device revision at probe time Paul Elder
2026-09-18 17:15   ` sashiko-bot
2026-09-21  7:41 ` [PATCH DNI v2 00/11] media: rcar-fcp, vsp1: Enable on R-Car X5H Geert Uytterhoeven
2026-09-21  7:51   ` Laurent Pinchart

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=20260918172335.7CBEA1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=paul.elder+renesas@ideasonboard.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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