Skip to content

Commit c4ca928

Browse files
committed
ASoC: hdac_hdmi: Rate limit logging on connection and disconnection
We currently log parse failures for ELD data and some disconnection events as errors without rate limiting. These log messages can be triggered very frequently in some situations, especially ELD parsing when there is nothing connected to a HDMI port which will generate: hdmi-audio-codec hdmi-audio-codec.1.auto: HDMI: Unknown ELD version 0 While there's doubtless work that could be done on reducing the number of connection notification callbacks it's possible these may be legitimately generated by poor quality physical connections so let's use rate limiting to mitigate the log spam for the parse errors and lower the severity for disconnect logging to debug level. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://patch.msgid.link/20250613-asoc-hdmi-eld-logging-v1-1-76d64154d969@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ac55801 commit c4ca928

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

sound/soc/codecs/hdac_hdmi.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,15 +1231,17 @@ static int hdac_hdmi_parse_eld(struct hdac_device *hdev,
12311231
>> DRM_ELD_VER_SHIFT;
12321232

12331233
if (ver != ELD_VER_CEA_861D && ver != ELD_VER_PARTIAL) {
1234-
dev_err(&hdev->dev, "HDMI: Unknown ELD version %d\n", ver);
1234+
dev_err_ratelimited(&hdev->dev,
1235+
"HDMI: Unknown ELD version %d\n", ver);
12351236
return -EINVAL;
12361237
}
12371238

12381239
mnl = (port->eld.eld_buffer[DRM_ELD_CEA_EDID_VER_MNL] &
12391240
DRM_ELD_MNL_MASK) >> DRM_ELD_MNL_SHIFT;
12401241

12411242
if (mnl > ELD_MAX_MNL) {
1242-
dev_err(&hdev->dev, "HDMI: MNL Invalid %d\n", mnl);
1243+
dev_err_ratelimited(&hdev->dev,
1244+
"HDMI: MNL Invalid %d\n", mnl);
12431245
return -EINVAL;
12441246
}
12451247

@@ -1298,8 +1300,8 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin,
12981300

12991301
if (!port->eld.monitor_present || !port->eld.eld_valid) {
13001302

1301-
dev_err(&hdev->dev, "%s: disconnect for pin:port %d:%d\n",
1302-
__func__, pin->nid, port->id);
1303+
dev_dbg(&hdev->dev, "%s: disconnect for pin:port %d:%d\n",
1304+
__func__, pin->nid, port->id);
13031305

13041306
/*
13051307
* PCMs are not registered during device probe, so don't

0 commit comments

Comments
 (0)