[3/3] ALSA: hda/hdmi - add retry logic to parse_intel_hdmi()
diff mbox series

Message ID 20200116140610.7247-4-kai.vehmanen@linux.intel.com
State New
Headers show
Series
  • SOF: Fix HDMI probe errors on GLK devices
Related show

Commit Message

Kai Vehmanen Jan. 16, 2020, 2:06 p.m. UTC
The initial snd_hda_get_sub_node() can fail on certain
devices (e.g. some Chromebook models using Intel GLK).
The failure rate is very low, but as this is is part of
the probe process, end-user impact is high.

In observed cases, related hardware status registers have
expected values, but the node query still fails. Retrying
the node query does seem to help, so fix the problem by
adding retry logic to the query. This does not impact
non-Intel platforms.

BugLink: https://github.com/thesofproject/linux/issues/1642
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Takashi Iwai Jan. 16, 2020, 3:11 p.m. UTC | #1
On Thu, 16 Jan 2020 15:06:10 +0100,
Kai Vehmanen wrote:
> 
> The initial snd_hda_get_sub_node() can fail on certain
> devices (e.g. some Chromebook models using Intel GLK).
> The failure rate is very low, but as this is is part of
> the probe process, end-user impact is high.
> 
> In observed cases, related hardware status registers have
> expected values, but the node query still fails. Retrying
> the node query does seem to help, so fix the problem by
> adding retry logic to the query. This does not impact
> non-Intel platforms.
> 
> BugLink: https://github.com/thesofproject/linux/issues/1642
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

Looks like a less ugly workaround.
I can take this, but maybe better together with other two, so Mark,
feel free to take through your tree.

Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi


> ---
>  sound/pci/hda/patch_hdmi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index ce3c212ee467..48bddc218829 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -2833,9 +2833,12 @@ static int alloc_intel_hdmi(struct hda_codec *codec)
>  /* parse and post-process for Intel codecs */
>  static int parse_intel_hdmi(struct hda_codec *codec)
>  {
> -	int err;
> +	int err, retries = 3;
> +
> +	do {
> +		err = hdmi_parse_codec(codec);
> +	} while (err < 0 && retries--);
>  
> -	err = hdmi_parse_codec(codec);
>  	if (err < 0) {
>  		generic_spec_free(codec);
>  		return err;
> -- 
> 2.17.1
>

Patch
diff mbox series

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index ce3c212ee467..48bddc218829 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2833,9 +2833,12 @@  static int alloc_intel_hdmi(struct hda_codec *codec)
 /* parse and post-process for Intel codecs */
 static int parse_intel_hdmi(struct hda_codec *codec)
 {
-	int err;
+	int err, retries = 3;
+
+	do {
+		err = hdmi_parse_codec(codec);
+	} while (err < 0 && retries--);
 
-	err = hdmi_parse_codec(codec);
 	if (err < 0) {
 		generic_spec_free(codec);
 		return err;