* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
@ 2026-06-01 11:17 ` Sebastian Reichel
2026-07-06 8:24 ` Maud Spierings
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Sebastian Reichel @ 2026-06-01 11:17 UTC (permalink / raw)
To: Detlev Casanova
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
linux-kernel, kernel
[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]
Hello Detlev,
On Tue, May 19, 2026 at 02:00:11PM -0400, Detlev Casanova wrote:
> -EOPNOTSUPP is not logged as an error by the ASoC subsystem, but -ENODEV
> is.
> It also better represents the situation: The operation is currently not
> supported (because clocks are not enabled and tmds_char_rate is
> unavailable), but the hardware is present.
>
> Using -EOPNOTSUPP in the audio_prepare callback removes possible repeated
> warning log lines when HDMI is not connected.
>
> Returning -EOPNOTSUPP in the audio_enable callback is also needed as it
> avoids logging 0-valued ELD errors.
>
> When tmds_char_rate is available, the clocks are enabled and the
> functions will keep returning 0 as before.
>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Fixes: fd0141d1a8a2a ("drm/bridge: synopsys: Add audio support for dw-hdmi-qp")
Greetings,
-- Sebastian
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index d649a1cf07f5..270c8c47d853 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -469,8 +469,10 @@ static int dw_hdmi_qp_audio_enable(struct drm_bridge *bridge,
> {
> struct dw_hdmi_qp *hdmi = dw_hdmi_qp_from_bridge(bridge);
>
> - if (hdmi->tmds_char_rate)
> - dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
> + if (!hdmi->tmds_char_rate)
> + return -EOPNOTSUPP;
> +
> + dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
>
> return 0;
> }
> @@ -484,7 +486,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_bridge *bridge,
> bool ref2stream = false;
>
> if (!hdmi->tmds_char_rate)
> - return -ENODEV;
> + return -EOPNOTSUPP;
>
> if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
> dev_err(hdmi->dev, "unsupported clock settings\n");
>
> ---
> base-commit: 1a2ab0feaa23147e347b4d4cb79cb3fc392118eb
> change-id: 20260519-fix-hdmi-audio-warnings-139062ec00b9
>
> Best regards,
> --
> Detlev Casanova <detlev.casanova@collabora.com>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
2026-06-01 11:17 ` Sebastian Reichel
@ 2026-07-06 8:24 ` Maud Spierings
2026-08-06 13:25 ` Detlev Casanova
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Maud Spierings @ 2026-07-06 8:24 UTC (permalink / raw)
To: detlev.casanova
Cc: Laurent.pinchart, airlied, andrzej.hajda, dri-devel,
jernej.skrabec, jonas, kernel, linux-kernel, maarten.lankhorst,
mripard, neil.armstrong, rfoss, simona, tzimmermann
> -EOPNOTSUPP is not logged as an error by the ASoC subsystem, but -ENODEV
> is.
> It also better represents the situation: The operation is currently not
> supported (because clocks are not enabled and tmds_char_rate is
> unavailable), but the hardware is present.
>
> Using -EOPNOTSUPP in the audio_prepare callback removes possible repeated
> warning log lines when HDMI is not connected.
>
> Returning -EOPNOTSUPP in the audio_enable callback is also needed as it
> avoids logging 0-valued ELD errors.
>
> When tmds_char_rate is available, the clocks are enabled and the
> functions will keep returning 0 as before.
>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Error messages are gone, tested on Orangepi 5+
Kind regards,
Maud
Tested-by: Maud Spierings <maud_spierings@hotmail.com>
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index d649a1cf07f5..270c8c47d853 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -469,8 +469,10 @@ static int dw_hdmi_qp_audio_enable(struct drm_bridge *bridge,
> {
> struct dw_hdmi_qp *hdmi = dw_hdmi_qp_from_bridge(bridge);
>
> - if (hdmi->tmds_char_rate)
> - dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
> + if (!hdmi->tmds_char_rate)
> + return -EOPNOTSUPP;
> +
> + dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
>
> return 0;
> }
> @@ -484,7 +486,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_bridge *bridge,
> bool ref2stream = false;
>
> if (!hdmi->tmds_char_rate)
> - return -ENODEV;
> + return -EOPNOTSUPP;
>
> if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
> dev_err(hdmi->dev, "unsupported clock settings\n");
>
> ---
> base-commit: 1a2ab0feaa23147e347b4d4cb79cb3fc392118eb
> change-id: 20260519-fix-hdmi-audio-warnings-139062ec00b9
>
> Best regards,
> --
> Detlev Casanova <detlev.casanova@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
2026-06-01 11:17 ` Sebastian Reichel
2026-07-06 8:24 ` Maud Spierings
@ 2026-08-06 13:25 ` Detlev Casanova
2026-08-08 11:28 ` Diederik de Haas
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Detlev Casanova @ 2026-08-06 13:25 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Heiko Stuebner
Cc: dri-devel, linux-kernel, kernel
Hi all,
On Tuesday, 19 May 2026 14:00:11 EDT Detlev Casanova wrote:
> -EOPNOTSUPP is not logged as an error by the ASoC subsystem, but -ENODEV
> is.
> It also better represents the situation: The operation is currently not
> supported (because clocks are not enabled and tmds_char_rate is
> unavailable), but the hardware is present.
>
> Using -EOPNOTSUPP in the audio_prepare callback removes possible repeated
> warning log lines when HDMI is not connected.
>
> Returning -EOPNOTSUPP in the audio_enable callback is also needed as it
> avoids logging 0-valued ELD errors.
>
> When tmds_char_rate is available, the clocks are enabled and the
> functions will keep returning 0 as before.
>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Gentle nudge on this one.
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index
> d649a1cf07f5..270c8c47d853 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -469,8 +469,10 @@ static int dw_hdmi_qp_audio_enable(struct drm_bridge
> *bridge, {
> struct dw_hdmi_qp *hdmi = dw_hdmi_qp_from_bridge(bridge);
>
> - if (hdmi->tmds_char_rate)
> - dw_hdmi_qp_mod(hdmi, 0,
AVP_DATAPATH_PACKET_AUDIO_SWDISABLE,
> GLOBAL_SWDISABLE); + if (!hdmi->tmds_char_rate)
> + return -EOPNOTSUPP;
> +
> + dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE,
> GLOBAL_SWDISABLE);
>
> return 0;
> }
> @@ -484,7 +486,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_bridge
> *bridge, bool ref2stream = false;
>
> if (!hdmi->tmds_char_rate)
> - return -ENODEV;
> + return -EOPNOTSUPP;
>
> if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
> dev_err(hdmi->dev, "unsupported clock settings\n");
>
> ---
> base-commit: 1a2ab0feaa23147e347b4d4cb79cb3fc392118eb
> change-id: 20260519-fix-hdmi-audio-warnings-139062ec00b9
>
> Best regards,
> --
> Detlev Casanova <detlev.casanova@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
` (2 preceding siblings ...)
2026-08-06 13:25 ` Detlev Casanova
@ 2026-08-08 11:28 ` Diederik de Haas
2026-09-06 14:39 ` Maud Spierings
2026-09-07 13:01 ` Igor Paunovic
5 siblings, 0 replies; 8+ messages in thread
From: Diederik de Haas @ 2026-08-08 11:28 UTC (permalink / raw)
To: Detlev Casanova, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel, kernel, linux-rockchip
Hi Detlev,
On Tue May 19, 2026 at 8:00 PM CEST, Detlev Casanova wrote:
> -EOPNOTSUPP is not logged as an error by the ASoC subsystem, but -ENODEV
> is.
> It also better represents the situation: The operation is currently not
> supported (because clocks are not enabled and tmds_char_rate is
> unavailable), but the hardware is present.
>
> Using -EOPNOTSUPP in the audio_prepare callback removes possible repeated
> warning log lines when HDMI is not connected.
IME/IMO that's a bit of an understatement as I got 10/100/1000s of these:
hdmi-audio-codec hdmi-audio-codec.6.auto: ASoC error (-19): at snd_soc_dai_prepare() on i2s-hifi
In my test without this patch, I booted up my SBCs, logged in quickly and
still got 60/120/270 of these errors in dmesg ... and I wasn't actually
using HDMI at that time. Previously, more then once did it completely
fill the dmesg buffer, removing/hiding the things I actually wanted to see.
> Returning -EOPNOTSUPP in the audio_enable callback is also needed as it
> avoids logging 0-valued ELD errors.
I've seen those too, multiple times, although it didn't annoy me as much
as the above one ... due to the (much) lower frequency. So
1) Thanks a LOT for this patch :-D
2) Feel free to include my
Tested-by: Diederik de Haas <diederik@cknow-tech.com> # Rock 5B, NanoPC-T6 LTS & Plus
Cheers,
Diederik
> When tmds_char_rate is available, the clocks are enabled and the
> functions will keep returning 0 as before.
>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index d649a1cf07f5..270c8c47d853 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -469,8 +469,10 @@ static int dw_hdmi_qp_audio_enable(struct drm_bridge *bridge,
> {
> struct dw_hdmi_qp *hdmi = dw_hdmi_qp_from_bridge(bridge);
>
> - if (hdmi->tmds_char_rate)
> - dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
> + if (!hdmi->tmds_char_rate)
> + return -EOPNOTSUPP;
> +
> + dw_hdmi_qp_mod(hdmi, 0, AVP_DATAPATH_PACKET_AUDIO_SWDISABLE, GLOBAL_SWDISABLE);
>
> return 0;
> }
> @@ -484,7 +486,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_bridge *bridge,
> bool ref2stream = false;
>
> if (!hdmi->tmds_char_rate)
> - return -ENODEV;
> + return -EOPNOTSUPP;
>
> if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
> dev_err(hdmi->dev, "unsupported clock settings\n");
>
> ---
> base-commit: 1a2ab0feaa23147e347b4d4cb79cb3fc392118eb
> change-id: 20260519-fix-hdmi-audio-warnings-139062ec00b9
>
> Best regards,
> --
> Detlev Casanova <detlev.casanova@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
` (3 preceding siblings ...)
2026-08-08 11:28 ` Diederik de Haas
@ 2026-09-06 14:39 ` Maud Spierings
2026-09-07 13:01 ` Igor Paunovic
5 siblings, 0 replies; 8+ messages in thread
From: Maud Spierings @ 2026-09-06 14:39 UTC (permalink / raw)
To: detlev.casanova
Cc: Laurent.pinchart, airlied, andrzej.hajda, dri-devel,
jernej.skrabec, jonas, kernel, linux-kernel, maarten.lankhorst,
mripard, neil.armstrong, rfoss, simona, tzimmermann
Hi everyone,
Another month, another reminder.
Or is there some reason why this isn't getting picked up?
kind regards,
Maud
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-05-19 18:00 [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions Detlev Casanova
` (4 preceding siblings ...)
2026-09-06 14:39 ` Maud Spierings
@ 2026-09-07 13:01 ` Igor Paunovic
2026-09-14 17:07 ` Detlev Casanova
5 siblings, 1 reply; 8+ messages in thread
From: Igor Paunovic @ 2026-09-07 13:01 UTC (permalink / raw)
To: Detlev Casanova
Cc: Igor Paunovic, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Sebastian Reichel, Maud Spierings,
Diederik de Haas, Cristian Ciocaltea, Frank Zhang, kernel,
dri-devel, linux-kernel
Hi Detlev,
One more data point for this one, from an Orange Pi 5 Plus (RK3588).
Without the patch, every prepare on an HDMI PCM whose output is not lit
(tmds_char_rate == 0: early in boot before the compositor enables the
output, or with the output disabled in the compositor) logs
hdmi-audio-codec hdmi-audio-codec.N.auto: ASoC error (-19): at snd_soc_dai_prepare() on i2s-hifi
On two boots here with the link perfectly fine that was 115 and 114 lines,
in two bursts each (60 and 55 prepares ~1 ms apart at 15.7 s and 28.1 s
after boot on one, 60 and 54 at 14.8 s and 22.0 s on the other) - as far
as I can tell PipeWire probing the cards from the greeter session before
the compositor had lit the outputs. On the boot just before those two,
where the sink had also failed SCDC, there were four of them and then the
SError described in [2].
Disabling one output in the compositor and opening its PCM reproduces
it on demand: exactly one line per prepare - and, on the close that
follows, the abort in clear_audio_infoframe() described in [2].
With the patch applied (rebuilt dw_hdmi_qp module, same kernel), opening
the PCM of an output disabled in the compositor now fails right away in
hdmi_codec_startup() with EOPNOTSUPP - nothing from ASoC or the bridge
in the kernel log, aplay says "Operation not supported" - and audio on
the output that has a link works as before.
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
One more reason I think this and Frank Zhang's patch [1] belong together:
since the startup now fails, ASoC never marks the DAI as started, so for
a PCM opened on a dead link the close never reaches hdmi_codec_shutdown()
-> dw_hdmi_qp_audio_disable() -> clear_audio_infoframe(). That is the
same class of bug as the SError we hit here on 02.09 (PCM closed after a
failed prepare, register access with the PHY down -> SError, panic; full
trace in [2]). I can't be certain this patch alone would have prevented
that particular crash - a PCM that is already open when the output goes
down still walks that path, which is what Frank's guard is for - so both
still look needed to me. (I saw Cristian's question on v4 about
open-coding the clear; either shape works for the crash I hit.)
[1] https://lore.kernel.org/all/20260512103153.8861-1-rmxpzlb@gmail.com/
[2] https://lore.kernel.org/all/20260907153000.hdmiqp-audio-1-royalnet026@gmail.com/
Thanks,
Igor
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/bridge: dw-hdmi-qp: Return -EOPNOTSUPP in HDMI audio functions
2026-09-07 13:01 ` Igor Paunovic
@ 2026-09-14 17:07 ` Detlev Casanova
0 siblings, 0 replies; 8+ messages in thread
From: Detlev Casanova @ 2026-09-14 17:07 UTC (permalink / raw)
To: Igor Paunovic
Cc: Igor Paunovic, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Sebastian Reichel, Maud Spierings,
Diederik de Haas, Cristian Ciocaltea, Frank Zhang, kernel,
dri-devel, linux-kernel
Hi Igor,
Thank you for testing !
On Monday, 7 September 2026 09:01:30 EDT Igor Paunovic wrote:
> Hi Detlev,
>
[...]
>
> One more reason I think this and Frank Zhang's patch [1] belong together:
> since the startup now fails, ASoC never marks the DAI as started, so for
> a PCM opened on a dead link the close never reaches hdmi_codec_shutdown()
> -> dw_hdmi_qp_audio_disable() -> clear_audio_infoframe(). That is the
> same class of bug as the SError we hit here on 02.09 (PCM closed after a
> failed prepare, register access with the PHY down -> SError, panic; full
> trace in [2]). I can't be certain this patch alone would have prevented
> that particular crash - a PCM that is already open when the output goes
> down still walks that path, which is what Frank's guard is for - so both
> still look needed to me. (I saw Cristian's question on v4 about
> open-coding the clear; either shape works for the crash I hit.)
Yes, Frank's patch is still needed, this is not fixing the SError, only giving
asoc and userspace the right error code.
The situation you describe on opened PCM that goes down can indeed still
happen (This patch may just decrease the probability of seeing an SError)
> [1] https://lore.kernel.org/all/20260512103153.8861-1-rmxpzlb@gmail.com/
> [2]
> https://lore.kernel.org/all/20260907153000.hdmiqp-audio-1-royalnet026@gmail
> .com/
Detlev.
^ permalink raw reply [flat|nested] 8+ messages in thread