mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Frank Zhang" <rmxpzlb@gmail.com>, <hjc@rock-chips.com>,
	<heiko@sntech.de>, <andyshrk@163.com>, <andrzej.hajda@intel.com>,
	<neil.armstrong@linaro.org>, <rfoss@kernel.org>,
	<Laurent.pinchart@ideasonboard.com>, <jonas@kwiboo.se>,
	<jernej.skrabec@gmail.com>, <luca.ceresoli@bootlin.com>,
	<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
	<tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
	<royalnet026@gmail.com>, <me@timsurber.de>
Cc: <dri-devel@lists.freedesktop.org>,
	<linux-rockchip@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH v7] drm/bridge: dw-hdmi-qp: serialize HDMI audio callbacks with PHY enable/disable
Date: Thu, 26 Nov 2026 19:02:38 +0100	[thread overview]
Message-ID: <DN5C92OQ40J6.21PMG8R70TEDK@bootlin.com> (raw)
In-Reply-To: <20261112101155.47777-1-rmxpzlb@gmail.com>

On Thu Nov 12, 2026 at 11:11 AM CET, Frank Zhang wrote:
> The following panic was observed during system reboot, it can also be
> triggered by the following sequences:
>
> - Disable the HDMI drm display, open and close the HDMI PCM device.
> - Enable the HDMI drm display and start audio stream on the HDMI PCM
>   device, then switch the HDMI drm display to disable, stop and close
>   audio stream.
>
> Kernel panic - not syncing: Asynchronous SError Interrupt
> CPU: 6 UID: 1000 PID: 2348 Comm: pipewire ... 7.0.5+ #4 PREEMPT(full)
> Call trace:
>  ...
>  regmap_update_bits_base+0x70/0xa8
>  dw_hdmi_qp_bridge_clear_audio_infoframe+0x3c/0x58 [dw_hdmi_qp]
>  drm_bridge_connector_clear_audio_infoframe+0x2c/0x48 [drm_display_helper]
>  ...
>  dw_hdmi_qp_audio_disable+0x28/0xa8 [dw_hdmi_qp]
>  drm_bridge_connector_audio_shutdown+0x38/0x68 [drm_display_helper]
>  drm_connector_hdmi_audio_shutdown+0x28/0x40 [drm_display_helper]
>  hdmi_codec_shutdown+0x60/0x90 [snd_soc_hdmi_codec]
>  ...
>  snd_pcm_release_substream+0xcc/0x120 [snd_pcm]
>  snd_pcm_release+0x4c/0xc0 [snd_pcm]
>  ...
>
> The crash occurs when HDMI audio callbacks access registers after DRM
> atomic framework disabled the PHY.
>
> The root cause is a race condition exists between ALSA and DRM atomic
> framework. During a modeset disable sequence, the DRM path disables the
> PHY, while ALSA may still execute HDMI audio callbacks such as
> audio_shutdown(), leading to accessing registers while the PHY is down
> and eventually a kernel panic.
>
> Fix this by introducing a mutex lock and PHY enabled state to serialize
> PHY state transitions and HDMI audio callbacks. This ensures that HDMI
> audio callbacks can only access registers while the PHY is enabled.
>
> Fixes: fd0141d1a8a2 ("drm/bridge: synopsys: Add audio support for dw-hdmi-qp")
> Cc: stable@vger.kernel.org
>
> Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus (RK3588)
> Tested-by: Tim Surber <me@timsurber.de> # FriendlyElec CM3588 NAS (RK3588)
> Signed-off-by: Frank Zhang <rmxpzlb@gmail.com>

I'm not really an ALSA expert, but the patch looks sane to me:

Acked-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

I'd apply it to drm-misc-fixes in ~1 week if there are no objections.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2026-11-26 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 10:11 Frank Zhang
2026-11-26 18:02 ` Luca Ceresoli [this message]

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=DN5C92OQ40J6.21PMG8R70TEDK@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andyshrk@163.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=me@timsurber.de \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=rmxpzlb@gmail.com \
    --cc=royalnet026@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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®