[PATCH v7] drm/bridge: dw-hdmi-qp: serialize HDMI audio callbacks with PHY enable/disable
Luca Ceresoli
luca.ceresoli at bootlin.com
Thu Nov 26 10:02:38 PST 2026
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 at vger.kernel.org
>
> Tested-by: Igor Paunovic <royalnet026 at gmail.com> # Orange Pi 5 Plus (RK3588)
> Tested-by: Tim Surber <me at timsurber.de> # FriendlyElec CM3588 NAS (RK3588)
> Signed-off-by: Frank Zhang <rmxpzlb at gmail.com>
I'm not really an ALSA expert, but the patch looks sane to me:
Acked-by: Luca Ceresoli <luca.ceresoli at 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
More information about the Linux-rockchip
mailing list