Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v10 15/21] drm/rockchip: dw_dp: Add runtime PM support
Date: Thu, 06 Aug 2026 01:06:36 +0000	[thread overview]
Message-ID: <20260806010637.485FD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260806-synopsys-dw-dp-improvements-v10-15-d84a26c303d6@collabora.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [High] Omission of system sleep PM callbacks breaks hardware reinitialization after system suspend (S3).
- [High] Activating runtime PM skips the manual initialization of controller clocks, causing `phy_init()` to be called with disabled clocks.

Pre-existing issues:
- [High] Asynchronous runtime PM put on driver unbind leads to resource leaks because the suspend is cancelled by pm_runtime_disable().
--

--- Patch [15]: [PATCH v10 15/21] drm/rockchip: dw_dp: Add runtime PM support ---
commit a8b68fca7b517a740f570a28e454719c2577d17d
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

drm/rockchip: dw_dp: Add runtime PM support

This patch adds runtime PM support to the Rockchip RK3576/3588 Synopsys
DesignWare DisplayPort driver.

> diff --git a/drivers/gpu/drm/rockchip/dw_dp-rockchip.c b/drivers/gpu/drm/rockchip/dw_dp-rockchip.c
> index ffcfb887d0d2a..770ab042a1879 100644
> --- a/drivers/gpu/drm/rockchip/dw_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_dp-rockchip.c
[ ... ]
> @@ -231,6 +232,7 @@ static int dw_dp_rockchip_probe(struct platform_device *pdev)
>  	if (IS_ERR(dp->vo_grf))
>  		return PTR_ERR(dp->vo_grf);
>  
> +	plat_data->autosuspend_delay = 500;

[Severity: High]
This is a pre-existing issue, but activating runtime PM for this driver by
setting this autosuspend delay exposes a potential resource leak during
driver unbind.

During component unbind, devm_drm_bridge_add() cleanup invokes
dw_dp_bridge_detach():

drivers/gpu/drm/bridge/synopsys/dw-dp.c:dw_dp_bridge_detach() {
    ...
    if (!dp->usbc_mode)
        pm_runtime_put_autosuspend(dp->dev);
    ...
}

Shortly after, the devm_pm_runtime_enable() cleanup invokes
pm_runtime_disable(), which cancels any pending asynchronous suspend requests.

Since this is an async put, will the hardware clocks (apb_clk, aux_clk)
remain enabled indefinitely after driver unbind?

[Severity: High]
Does activating runtime PM here skip the clock enablement needed for PHY
initialization?

In dw_dp_probe(), the fallback manual resume is skipped when runtime PM is
enabled:

drivers/gpu/drm/bridge/synopsys/dw-dp.c:dw_dp_probe() {
    ...
    if (!pm_runtime_enabled(dev)) {
        dw_dp_runtime_resume(dp);
        ...
    }
    
    ret = phy_init(dp->phy);
    ...
}

Since we set autosuspend_delay here, pm_runtime_enabled() evaluates to true
and we skip dw_dp_runtime_resume(). However, there is no corresponding
pm_runtime_get_sync() before phy_init() is called.

Will this cause phy_init() to execute with the controller's APB clock turned
off, potentially resulting in a bus hang?

>  	plat_data->max_link_rate = plat_data_const->max_link_rate;
>  	plat_data->pixel_mode = plat_data_const->pixel_mode;
[ ... ]
> @@ -253,6 +255,24 @@ static void dw_dp_rockchip_remove(struct platform_device *pdev)
>  	component_del(&pdev->dev, &dw_dp_rockchip_component_ops);
>  }
>  
> +static int dw_dp_rockchip_runtime_suspend(struct device *dev)
> +{
> +	struct rockchip_dw_dp *dp = dev_get_drvdata(dev);
> +
> +	return dw_dp_runtime_suspend(dp->base);
> +}
> +
> +static int dw_dp_rockchip_runtime_resume(struct device *dev)
> +{
> +	struct rockchip_dw_dp *dp = dev_get_drvdata(dev);
> +
> +	return dw_dp_runtime_resume(dp->base);
> +}
> +
> +static const struct dev_pm_ops dw_dp_pm_ops = {
> +	RUNTIME_PM_OPS(dw_dp_rockchip_runtime_suspend, dw_dp_rockchip_runtime_resume, NULL)
> +};

[Severity: High]
Does this struct need to map system sleep callbacks as well?

Because we only define RUNTIME_PM_OPS here, the PM core takes no action for
this device when the system enters S3 suspend. The device remains tracked as
active in software.

Upon system wake, since there is no system resume callback, the software
state remains active.

When a subsequent pm_runtime_get() is called during display enable, will it
skip executing dw_dp_rockchip_runtime_resume() because the software status is
already active? If so, this could leave the hardware uninitialized after a
system suspend.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260806-synopsys-dw-dp-improvements-v10-0-d84a26c303d6@collabora.com?part=15

  reply	other threads:[~2026-08-06  1:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  0:39 [PATCH v10 00/21] Synopsys DisplayPort Controller improvements for Rockchip platforms Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 01/21] drm/bridge: synopsys: dw-dp: Register DP AUX on bridge attach Sebastian Reichel
2026-08-06  1:02   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 02/21] drm/bridge: synopsys: dw-dp: Fix incorrect resource lifetimes in bind callback Sebastian Reichel
2026-08-06  1:05   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 03/21] drm/bridge: synopsys: dw-dp: Fix error handling for DP link enablement Sebastian Reichel
2026-08-06  0:59   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 04/21] drm/bridge: synopsys: dw-dp: Document missing reset line deassert Sebastian Reichel
2026-08-06  0:58   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 05/21] drm/bridge: synopsys: dw-dp: Add missing mutex cleanups on module removal Sebastian Reichel
2026-08-06  0:58   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 06/21] drm/bridge: synopsys: dw-dp: Fix AUX transfer timeout race condition Sebastian Reichel
2026-08-06  1:05   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 07/21] drm/bridge: synopsys: dw-dp: Fix support for short I2C reads Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 08/21] drm/bridge: synopsys: dw-dp: Free output_fmts when none are valid Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 09/21] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 10/21] drm/bridge: synopsys: dw-dp: Add follow-up bridge support Sebastian Reichel
2026-08-06  1:01   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 11/21] drm/bridge: Add out-of-band HPD notify handler Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 12/21] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 13/21] drm/rockchip: dw_dp: Implement out-of-band HPD handling Sebastian Reichel
2026-08-06  0:58   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 14/21] drm/bridge: synopsys: dw-dp: Add Runtime PM support Sebastian Reichel
2026-08-06  1:07   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 15/21] drm/rockchip: dw_dp: Add runtime " Sebastian Reichel
2026-08-06  1:06   ` sashiko-bot [this message]
2026-08-06  0:39 ` [PATCH v10 16/21] drm/bridge: synopsys: dw-dp: Protect sdp_reg_bank from concurrent access Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 17/21] drm/bridge: synopsys: dw-dp: Drop useless reservation of first slot Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 18/21] drm/bridge: synopsys: dw-dp: Clear only enabled SDPs on atomic disable Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 19/21] drm/bridge: synopsys: dw-dp: Use regmap_set_bits in dw_dp_send_sdp Sebastian Reichel
2026-08-06  0:39 ` [PATCH v10 20/21] dt-bindings: display: rockchip: dw-dp: Fix sound DAI cells Sebastian Reichel
2026-08-06  1:06   ` sashiko-bot
2026-08-06  0:39 ` [PATCH v10 21/21] drm/bridge: synopsys: dw-dp: Add audio support Sebastian Reichel
2026-08-06  1:10   ` sashiko-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=20260806010637.485FD1F000E9@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=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.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