ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jernej Skrabec" <jernej.skrabec@gmail.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-sunxi@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH 10/11] arm64: dts: allwinner: h616: Add display pipeline
Date: Thu, 26 Nov 2026 22:00:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-236290@kernel.org> (raw)
In-Reply-To: <20261126214433.3562326-11-jernej.skrabec@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: allwinner: h616: tcon_top graph overflows
  sun4i_drv_probe() kfifo
--

commit 01e1e3e0b1574bffa9c9d00380c059ba10691ddb
Author: Jernej Skrabec <jernej.skrabec@gmail.com>

arm64: dts: allwinner: h616: Add display pipeline

This commit adds the devicetree nodes for the Allwinner H616 display
engine 3.3 pipeline, including two mixers, TCON TOP, four TCONs, and HDMI.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> index 93c3b8279241f..d7ed84d3c1217 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
[ ... ]
> @@ -978,6 +1065,339 @@ ohci3: usb@5311400 {
[ ... ]
> +		tcon_top: tcon-top@6510000 {
> +			compatible = "allwinner,sun50i-h616-tcon-top";
> +			reg = <0x06510000 0x1000>;
> +			clocks = <&ccu CLK_BUS_TCON_TOP>,
> +				 <&ccu CLK_TCON_TV0>,
> +				 <&ccu CLK_TVE0>,
> +				 <&ccu CLK_TCON_TV1>;
> +			clock-names = "bus",
> +				      "tcon-tv0",
> +				      "tve0",
> +				      "tcon-tv1";
> +			clock-output-names = "tcon-top-tv0",
> +					     "tcon-top-tv1";
> +			resets = <&ccu RST_BUS_TCON_TOP>;
> +			#clock-cells = <1>;
> +
> +			ports {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +
> +				tcon_top_mixer0_in: port@0 {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +					reg = <0>;
> +
> +					tcon_top_mixer0_in_mixer0: endpoint@0 {
> +						reg = <0>;
> +						remote-endpoint = <&mixer0_out_tcon_top_mixer0>;
> +					};
> +				};
> +
> +				tcon_top_mixer0_out: port@1 {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +					reg = <1>;
> +
> +					tcon_top_mixer0_out_tcon_lcd0: endpoint@0 {
> +						reg = <0>;
> +						remote-endpoint = <&tcon_lcd0_in_tcon_top_mixer0>;
> +					};
> +
> +					tcon_top_mixer0_out_tcon_lcd1: endpoint@1 {
> +						reg = <1>;
> +						remote-endpoint = <&tcon_lcd1_in_tcon_top_mixer0>;
> +					};
> +
> +					tcon_top_mixer0_out_tcon_tv0: endpoint@2 {
> +						reg = <2>;
> +						remote-endpoint = <&tcon_tv0_in_tcon_top_mixer0>;
> +					};
> +
> +					tcon_top_mixer0_out_tcon_tv1: endpoint@3 {
> +						reg = <3>;
> +						remote-endpoint = <&tcon_tv1_in_tcon_top_mixer0>;
> +					};
> +				};
> +
> +				tcon_top_mixer1_in: port@2 {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +					reg = <2>;
> +
> +					tcon_top_mixer1_in_mixer1: endpoint@1 {
> +						reg = <1>;
> +						remote-endpoint = <&mixer1_out_tcon_top_mixer1>;
> +					};
> +				};
> +
> +				tcon_top_mixer1_out: port@3 {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +					reg = <3>;
> +
> +					tcon_top_mixer1_out_tcon_lcd0: endpoint@0 {
> +						reg = <0>;
> +						remote-endpoint = <&tcon_lcd0_in_tcon_top_mixer1>;
> +					};
> +
> +					tcon_top_mixer1_out_tcon_lcd1: endpoint@1 {
> +						reg = <1>;
> +						remote-endpoint = <&tcon_lcd1_in_tcon_top_mixer1>;
> +					};
> +
> +					tcon_top_mixer1_out_tcon_tv0: endpoint@2 {
> +						reg = <2>;
> +						remote-endpoint = <&tcon_tv0_in_tcon_top_mixer1>;
> +					};
> +
> +					tcon_top_mixer1_out_tcon_tv1: endpoint@3 {
> +						reg = <3>;
> +						remote-endpoint = <&tcon_tv1_in_tcon_top_mixer1>;
> +					};
> +				};
> +
> +				tcon_top_hdmi_in: port@4 {
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +					reg = <4>;
> +
> +					tcon_top_hdmi_in_tcon_tv0: endpoint@0 {
> +						reg = <0>;
> +						remote-endpoint = <&tcon_tv0_out_tcon_top>;
> +					};
> +
> +					tcon_top_hdmi_in_tcon_tv1: endpoint@1 {
> +						reg = <1>;
> +						remote-endpoint = <&tcon_tv1_out_tcon_top>;
> +					};
> +				};
> +
> +				tcon_top_hdmi_out: port@5 {
> +					reg = <5>;
> +
> +					tcon_top_hdmi_out_hdmi: endpoint {
> +						remote-endpoint = <&hdmi_in_tcon_top>;
> +					};
> +				};
> +			};
> +		};

[Severity: Medium]
Does this tcon_top graph overflow the 16-entry endpoint_list FIFO in
sun4i_drv_probe() and leak device_node references?

When sun4i_drv_probe() traverses mixer0 and mixer1, both push tcon_top
into list.fifo.  tcon_top has 9 connected output endpoints across port@1
(4), port@3 (4), and port@5 (1), and sun4i_drv_traverse_endpoints() queues
every remote node regardless of whether the target device is disabled:

drivers/gpu/drm/sun4i/sun4i_drv.c:
struct endpoint_list {
	DECLARE_KFIFO(fifo, struct device_node *, 16);
};

drivers/gpu/drm/sun4i/sun4i_drv.c:sun4i_drv_traverse_endpoints() {
    ...
	for_each_available_child_of_node(port, ep) {
		remote = of_graph_get_remote_port_parent(ep);
    ...
		kfifo_put(&list->fifo, remote);
	}
}

Popping the first tcon_top entry pushes 9 remote nodes while the second
tcon_top entry is still queued (10 entries in list.fifo).  Popping the
second tcon_top entry then attempts to push 9 more remote nodes (18 in
total), so the final two kfifo_put() calls for tcon_tv1 and hdmi fail on a
full 16-entry FIFO, dropping the queue insertions and leaking the two
remote device_node references from of_graph_get_remote_port_parent().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126214433.3562326-1-jernej.skrabec@gmail.com?part=10

  reply	other threads:[~2026-11-26 22:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 21:44 [PATCH 00/11] drm/sun4i: Add H616 display pipeline support Jernej Skrabec
2026-11-26 21:44 ` [PATCH 01/11] dt-bindings: display: sun4i-tcon: Add R40 TCON LCD Jernej Skrabec
2026-11-26 21:44 ` [PATCH 02/11] dt-bindings: display: Add H616 display engine compatibles Jernej Skrabec
2026-11-26 21:44 ` [PATCH 03/11] drm/sun4i: Add support for H616 TCON TOP Jernej Skrabec
2026-11-26 21:44 ` [PATCH 04/11] drm/sun4i: tcon: Request LVDS reset as shared Jernej Skrabec
2026-11-26 21:44 ` [PATCH 05/11] drm/sun4i: tcon-top: Route LCD TCONs to the LCD pins Jernej Skrabec
2026-11-26 21:44 ` [PATCH 06/11] drm/sun4i: tcon: Add support for R40 LCD Jernej Skrabec
2026-11-26 21:44 ` [PATCH 07/11] drm/sun4i: Add H616 TCON TV support Jernej Skrabec
2026-11-26 21:44 ` [PATCH 08/11] drm/sun4i: Add support for H616 HDMI PHY Jernej Skrabec
2026-11-26 21:44 ` [PATCH 09/11] drm/sun4i: Add compatible for H616 display engine Jernej Skrabec
2026-11-26 21:44 ` [PATCH 10/11] arm64: dts: allwinner: h616: Add display pipeline Jernej Skrabec
2026-11-26 22:00   ` sashiko-bot [this message]
2026-11-26 21:44 ` [PATCH 11/11] arm64: dts: allwinner: h616: Enable HDMI on several boards Jernej Skrabec

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-236290@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --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