All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 08/11] arm64: dts: rockchip: Add USB-C DP AltMode for RG-Vita-Pro
Date: Fri, 27 Nov 2026 11:05:43 +0000	[thread overview]
Message-ID: <sashiko-outbox-237212@kernel.org> (raw)
In-Reply-To: <20261127-rockchip-usb-c-dp-altmode-v2-8-77ee78869307@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] arm64: dts: rockchip: connecting vp2 on RK3576 fails in
  vop2_create_crtcs()
--

commit 99a502d224b0a9ebbacac11ac289a2bf3c184e45
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

arm64: dts: rockchip: Add USB-C DP AltMode for RG-Vita-Pro

This commit enables DisplayPort over USB-C AltMode on the Anbernic
RG-Vita-Pro and updates the USBDP PHY and USB-C connector port graphs.

> diff --git a/arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts b/arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts
> index 85576a437f7bf..5da90f3792a14 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts
> @@ -469,6 +469,22 @@ mipi_out_panel: endpoint {
>  	};
>  };
>  
> +&dp {
> +	status = "okay";
> +};
> +
> +&dp0_in {
> +	dp0_in_vp2: endpoint {
> +		remote-endpoint = <&vp2_out_dp0>;
> +	};
> +};

[ ... ]

> @@ -1221,6 +1240,13 @@ vp1_out_dsi: endpoint@ROCKCHIP_VOP2_EP_MIPI0 {
>  	};
>  };
>  
> +&vp2 {
> +	vp2_out_dp0: endpoint@a {
> +		reg = <ROCKCHIP_VOP2_EP_DP0>;
> +		remote-endpoint = <&dp0_in_vp2>;
> +	};
> +};

[Severity: High]
Does enabling vp2 alongside vp0 (HDMI) and vp1 (DSI) cause
vop2_create_crtcs() to fail with -ENOENT ("no primary plane for vp 2")?

In rk3576_vop_win_data[], only Cluster0-win0 and Cluster1-win0 have
DRM_PLANE_TYPE_PRIMARY, and their possible_vp_mask is BIT(0) | BIT(1).
All four windows that can feed vp2 (Esmart0-win0 through Esmart3-win0,
with BIT(2) in possible_vp_mask) are marked DRM_PLANE_TYPE_OVERLAY:

drivers/gpu/drm/rockchip/rockchip_vop2_reg.c:rk3576_vop_win_data[] {
	{
		.name = "Cluster0-win0",
		...
		.possible_vp_mask = BIT(0) | BIT(1),
		...
		.type = DRM_PLANE_TYPE_PRIMARY,
	}, {
		.name = "Esmart0-win0",
		...
		.possible_vp_mask = BIT(0) | BIT(2),
		...
		.type = DRM_PLANE_TYPE_OVERLAY,
	...
}

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:vop2_create_crtcs() {
	...
			if (win->type == DRM_PLANE_TYPE_PRIMARY) {
				possible_crtcs = BIT(nvp);
				vp->primary_plane = win;
				ret = vop2_plane_init(vop2, win, possible_crtcs);
				...
				break;
			}
		}

		if (!vp->primary_plane)
			return dev_err_probe(drm->dev, -ENOENT,
					     "no primary plane for vp %d\n", i);
}

When vop2_create_crtcs() reaches vp2, no window matches
DRM_PLANE_TYPE_PRIMARY, so vop2_bind() fails and breaks all display
outputs on the board.  In addition, because vop2_plane_init() has already
linked the primary planes for vp0 and vp1 onto
drm->mode_config.plane_list, freeing the devm-allocated vop2 struct on
component_bind() failure leaves dangling plane pointers that trigger a
use-after-free during drm_mode_config_cleanup().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-rockchip-usb-c-dp-altmode-v2-0-77ee78869307@collabora.com?part=8

  reply	other threads:[~2026-11-27 11:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 10:51 [PATCH v2 00/11] arm64: dts: rockchip: USB-C DP AltMode support Sebastian Reichel
2026-11-27 10:51 ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 01/11] arm64: dts: rockchip: Fix USB-C DP AltMode vdo Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 02/11] arm64: dts: rockchip: Fix USBDP ports for LubanCat 5IO board Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 03/11] arm64: dts: rockchip: Fix USBDP ports for Indiedroid Nova Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-30 14:23   ` Chris Morgan
2026-11-30 14:23     ` Chris Morgan
2026-11-27 10:51 ` [PATCH v2 04/11] arm64: dts: rockchip: Add USB-C DP AltMode for RK3588 EVB1 Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 05/11] arm64: dts: rockchip: Add USB-C DP AltMode for ROCK 5B family Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 06/11] arm64: dts: rockchip: Add USB-C DP AltMode for ArmSom Sige5 Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 07/11] arm64: dts: rockchip: Add USB-C DP AltMode for Gameforce Ace Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 08/11] arm64: dts: rockchip: Add USB-C DP AltMode for RG-Vita-Pro Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 11:05   ` sashiko-bot [this message]
2026-11-27 10:51 ` [PATCH v2 09/11] arm64: dts: rockchip: Add USB-C DP AltMode for CM5-IO Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 10/11] arm64: dts: rockchip: Add USB-C DP AltMode for Firefly ITX 3588J Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel
2026-11-27 10:51 ` [PATCH v2 11/11] arm64: dts: rockchip: Add USB-C DP AltMode for RK3588 Jaguar Sebastian Reichel
2026-11-27 10:51   ` Sebastian Reichel

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=sashiko-outbox-237212@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.