Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v7 05/10] drm/rockchip: analogix_dp: Enable hclk for RK3588
Date: Mon, 25 May 2026 08:48:07 +0000	[thread overview]
Message-ID: <20260525084808.292061F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260525082033.117569-6-damon.ding@rock-chips.com>

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

New issues:
- [Medium] Power and clock leak for 'hclk' during suspend and display powerdown.

Pre-existing issues:
- [Critical] Dangling pointer dereference / Use-After-Free via `endpoint.local_node`.
--

commit 4b37db64b85dfb304df892e845f75e6e05adbfbe
Author: Damon Ding <damon.ding@rock-chips.com>

drm/rockchip: analogix_dp: Enable hclk for RK3588

This commit acquires and enables the HCLK_VO1 bus clock explicitly for
the RK3588 eDP controller. It fetches the optional hclk clock in the
driver probe to align with updated device tree bindings.

> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index 06072efd7fca3..d2af5eb29dbb5 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c

[ ... ]

> @@ -327,6 +328,11 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
>  		return dev_err_probe(dev, PTR_ERR(dp->pclk),
>  				     "failed to get pclk property\n");
>  
> +	clk = devm_clk_get_optional_enabled(dev, "hclk");
> +	if (IS_ERR(clk))
> +		return dev_err_probe(dev, PTR_ERR(clk),
> +				     "failed to get hclk property\n");
> +

[Severity: Medium]
Does this cause a clock leak during system suspend or when the eDP
controller is powered down?

Because hclk is acquired and enabled here but only stored in a local
variable, the driver has no way to reference it later to disable it
during suspend or powerdown.

Unlike pclk which is saved in the driver context and explicitly managed,
would leaving this clock permanently enabled prevent its parent power
domain from entering low-power states?

>  	dp->rst = devm_reset_control_get(dev, "dp");
>  	if (IS_ERR(dp->rst))

[ ... ]

[Severity: Critical]
This is a pre-existing issue, but can the usage of endpoint.local_node
in rockchip_dp_drm_encoder_enable() cause a use-after-free?

drm_of_encoder_active_endpoint() populates the of_endpoint structure,
setting endpoint.local_node to the endpoint node, but explicitly calls
of_node_put(ep) before returning. This drops the reference to the node.

When rockchip_dp_drm_encoder_enable() later passes this unreferenced
pointer to of_graph_get_remote_port_parent(), could this result in
dereferencing a dangling pointer if the node's reference count has
reached zero?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260525082033.117569-1-damon.ding@rock-chips.com?part=5

  reply	other threads:[~2026-05-25  8:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  8:20 [PATCH v7 00/10] Add eDP support for RK3576 Damon Ding
2026-05-25  8:20 ` [PATCH v7 01/10] dt-bindings: display: rockchip: analogix-dp: Fix hclk as third clock for RK3588 Damon Ding
2026-05-25  8:38   ` sashiko-bot
2026-05-25  9:42   ` Damon Ding
2026-05-25 11:43   ` Rob Herring (Arm)
2026-05-25  8:20 ` [PATCH v7 02/10] dt-bindings: display: rockchip: analogix-dp: Add per-clock descriptions Damon Ding
2026-05-25 11:13   ` Rob Herring (Arm)
2026-05-25  8:20 ` [PATCH v7 03/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP0 Damon Ding
2026-05-25  8:20 ` [PATCH v7 04/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP1 Damon Ding
2026-05-25  8:20 ` [PATCH v7 05/10] drm/rockchip: analogix_dp: Enable hclk for RK3588 Damon Ding
2026-05-25  8:48   ` sashiko-bot [this message]
2026-05-25  8:20 ` [PATCH v7 06/10] dt-bindings: display: rockchip: analogix-dp: Add support for RK3576 Damon Ding
2026-05-25 11:13   ` Rob Herring (Arm)
2026-05-25  8:20 ` [PATCH v7 07/10] arm64: dts: rockchip: Add eDP node " Damon Ding
2026-05-25  8:20 ` [PATCH v7 08/10] drm/bridge: analogix_dp: Rename and simplify is_rockchip() Damon Ding
2026-05-25  8:34   ` sashiko-bot
2026-05-25  8:20 ` [PATCH v7 09/10] drm/bridge: analogix_dp: Add support for RK3576 Damon Ding
2026-05-25  8:20 ` [PATCH v7 10/10] drm/rockchip: " Damon Ding
2026-05-25  8:51   ` 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=20260525084808.292061F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=damon.ding@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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