mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Tim Surber <me@timsurber.de>, Heiko Stuebner <heiko@sntech.de>
Cc: Sandy Huang <hjc@rock-chips.com>, Andy Yan <andyshrk@163.com>,
	Andy Yan <andy.yan@rock-chips.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Daniel Stone <daniel@fooishbar.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
	Igor Paunovic <royalnet026@gmail.com>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 07/15] drm/rockchip: vop2: Reset AXI and DCLK to improve robustness
Date: Wed, 25 Nov 2026 03:58:18 +0200	[thread overview]
Message-ID: <3c203ba7-6a0b-45bf-ac88-9928ad0b4a11@collabora.com> (raw)
In-Reply-To: <20261121023139.3515640-1-me@timsurber.de>

Hi Tim,

On 11/21/26 4:31 AM, Tim Surber wrote:
> Hi Cristian,
> 
> On Thu, 05 Nov 2026 03:00:41 +0200, Cristian Ciocaltea wrote:
>> @@ -953,6 +974,8 @@ static int vop2_enable(struct vop2 *vop2)
>>
>>  static void vop2_disable(struct vop2 *vop2)
>>  {
>> +	vop2_reset_assert_deassert(vop2, vop2->axi_rst);
>> +
>>  	rockchip_drm_dma_detach_device(vop2->drm, vop2->dev);
> 
> with this patch my RK3588 board (FriendlyElec
> CM3588) hangs hard sometimes when the last CRTC is switched off. Without the series
> or with the AXI reset in vop2_disable() removed it does not happen.
> 
> Here is a minimal reproducer, run as root, with a display on HDMI and fbcon on it:
> 
>   python3 - <<'EOF' &
>   import fcntl, os, struct
>   fd = os.open("/dev/dri/by-path/platform-display-subsystem-card", os.O_RDWR)
>   try:
>       fcntl.ioctl(fd, 0x641F)        # DRM_IOCTL_DROP_MASTER: leave KMS to fbcon
>   except OSError:
>       pass
>   while True:
>       b = bytearray(struct.pack("6IQ", 2160, 3840, 32, 0, 0, 0, 0))
>       fcntl.ioctl(fd, 0xC02064B2, b)                         # DRM_IOCTL_MODE_CREATE_DUMB
>       handle = struct.unpack("6IQ", b)[4]
>       fcntl.ioctl(fd, 0xC00464B4, struct.pack("I", handle))  # DRM_IOCTL_MODE_DESTROY_DUMB
>   EOF
>   while :; do
>   	echo 4 > /sys/class/graphics/fb0/blank; sleep 0.3
>   	echo 0 > /sys/class/graphics/fb0/blank; sleep 0.7
>   done
> 
> This hangs the board within a few blank cycles. In
> practice I hit it when a KMS application exits: it frees its buffers
> while fbcon takes the display back with a full modeset.

Thanks for reporting this - with your reproducer I could also trigger the hang
on my Rock5B board, after ~15 cycles.

> This issue can be fixed for me by moving vop2_reset_assert_deassert(vop2, vop2->axi_rst) from vop2_disable to vop2_enable.
> 
> --8<--
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -913,6 +913,9 @@ static int vop2_enable(struct vop2 *vop2)
>  	if (ret)
>  		goto err_put_pm;
> 
> +	/* Reset while idle; doing it in vop2_disable() can hang the SoC */
> +	vop2_reset_assert_deassert(vop2, vop2->axi_rst);
> +
>  	ret = rockchip_drm_dma_attach_device(vop2->drm, vop2->dev);
>  	if (ret) {
>  		drm_err(vop2->drm, "failed to attach dma mapping: %d\n", ret);
> @@ -973,8 +976,6 @@ static int vop2_enable(struct vop2 *vop2)
> 
>  static void vop2_disable(struct vop2 *vop2)
>  {
> -	vop2_reset_assert_deassert(vop2, vop2->axi_rst);
> -
>  	rockchip_drm_dma_detach_device(vop2->drm, vop2->dev);
> 
>  	regcache_drop_region(vop2->map, 0, vop2_regmap_config.max_register);
> -->8--
> 
> Does that work for the cases the reset was added for (the RGB <-> YUV420
> switch glitches and the DSI panel on the EVB1)? I can't test those here.

I briefly tested the RGB <-> YUV420 mode switches and didn't notice any obvious
regressions. For the EVB1 we need Sebastian's help, as I don't have that board.

Would you like to send a proper patch in the meantime? 

Regards,
Cristian

  reply	other threads:[~2026-11-25  1:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  1:00 [PATCH v6 00/15] Support 10-bit YUV422 and 8/10-bit YUV420 color format on DW HDMI QP Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 01/15] dt-bindings: display: vop2: Add missing reset properties Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 02/15] drm/rockchip: vop2: Fix resource leak on vop2_enable() error path Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 03/15] drm/rockchip: vop2: Disable core clocks before dropping runtime PM reference Cristian Ciocaltea
2026-11-05 11:43   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 04/15] drm/rockchip: vop2: Balance state on atomic_enable() error paths Cristian Ciocaltea
2026-11-05 12:24   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 05/15] drm/rockchip: vop2: Avoid division by zero when computing max_dclk Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 06/15] drm/rockchip: vop2: Fix VOP2_MAX_DCLK_RATE overflow on 32-bit Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 07/15] drm/rockchip: vop2: Reset AXI and DCLK to improve robustness Cristian Ciocaltea
2026-11-21  2:31   ` Tim Surber
2026-11-25  1:58     ` Cristian Ciocaltea [this message]
2026-11-05  1:00 ` [PATCH v6 08/15] drm/rockchip: vop2: Consolidate HDMI PHY PLL clock parent switch Cristian Ciocaltea
2026-11-05 12:18   ` Daniel Stone
2026-11-05 12:56     ` Cristian Ciocaltea
2026-11-05 14:33       ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 09/15] drm/rockchip: vop2: Use TMDS character rate to select DCLK source Cristian Ciocaltea
2026-11-05 14:35   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 10/15] drm/rockchip: vop2: Switch to enum vop_csc_format Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 11/15] drm/bridge: dw-hdmi-qp: Log resolution and refresh rate in atomic_enable() Cristian Ciocaltea
2026-11-05  1:00 ` [PATCH v6 12/15] drm/rockchip: dw_hdmi_qp: Do not mask error code in atomic_check() Cristian Ciocaltea
2026-11-05 11:55   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 13/15] drm/rockchip: dw_hdmi_qp: Support 10-bit YUV422 output format Cristian Ciocaltea
2026-11-05 12:08   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 14/15] drm/rockchip: dw_hdmi_qp: Enable YUV420 " Cristian Ciocaltea
2026-11-05 12:09   ` Daniel Stone
2026-11-05  1:00 ` [PATCH v6 15/15] arm64: dts: rockchip: Add RK3588 VOP2 resets Cristian Ciocaltea
2026-11-05 12:25 ` [PATCH v6 00/15] Support 10-bit YUV422 and 8/10-bit YUV420 color format on DW HDMI QP Daniel Stone
2026-11-05 13:04   ` Cristian Ciocaltea
2026-11-05 13:22     ` Heiko Stübner
2026-11-05 14:36       ` Daniel Stone
2026-11-05 14:35     ` Daniel Stone
2026-11-06 12:27 ` (subset) " Heiko Stuebner
2026-11-06 12:28 ` Heiko Stuebner

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=3c203ba7-6a0b-45bf-ac88-9928ad0b4a11@collabora.com \
    --to=cristian.ciocaltea@collabora.com \
    --cc=andy.yan@rock-chips.com \
    --cc=andyshrk@163.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=me@timsurber.de \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=royalnet026@gmail.com \
    --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

all inboxes | Powered by JetHome®