From: vani.ganji@intel.com To: alsa-devel@alsa-project.org Cc: vani.ganji@intel.com Subject: [PATCH] [PATCH v2] ALSA: hda: Retry codec read on first time failure Date: Fri, 30 Aug 2019 10:53:18 +0530 [thread overview] Message-ID: <20190830052318.25898-1-vani.ganji@intel.com> (raw) From: Vani Ganji <vani.ganji@intel.com> Sometimes HDMI audio fails while fast switching between HDMI and Speaker due to codec Get Power state verb read failure. Verb is codec driver to access codec HW. Since issue scenario involves fast switching between HDMI and speaker, there might be chance to fail read from HW and same happened in the error scenario. Based on Display/Graphics architect suggestion, added a retry mechanism for failure on first attempt. Changes from v1: -Corrected missing braces. Signed-off-by: Vani Ganji <vani.ganji@intel.com> --- sound/hda/hdac_device.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index b26cc93e7e10..3874d54aa686 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -984,10 +984,17 @@ static unsigned int codec_read(struct hdac_device *hdac, hda_nid_t nid, { unsigned int cmd = snd_hdac_make_cmd(hdac, nid, verb, parm); unsigned int res; - - if (snd_hdac_exec_verb(hdac, cmd, flags, &res)) - return -1; - + unsigned int count; + + /* Retry verb once more if it fails first time */ + /* recommended to retry since it is HW related */ + for (count = 0; count <= 1; count++) { + if (snd_hdac_exec_verb(hdac, cmd, flags, &res)) { + if (count == 1) + return -1; + } else + break; + } return res; } -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: vani.ganji@intel.com To: alsa-devel@alsa-project.org Cc: vani.ganji@intel.com Subject: [alsa-devel] [PATCH] [PATCH v2] ALSA: hda: Retry codec read on first time failure Date: Fri, 30 Aug 2019 10:53:18 +0530 [thread overview] Message-ID: <20190830052318.25898-1-vani.ganji@intel.com> (raw) Message-ID: <20190830052318.74x2JoDavkEkcj5TXCbcjokpYAZxjvQ7ZYlVFzBhtsU@z> (raw) From: Vani Ganji <vani.ganji@intel.com> Sometimes HDMI audio fails while fast switching between HDMI and Speaker due to codec Get Power state verb read failure. Verb is codec driver to access codec HW. Since issue scenario involves fast switching between HDMI and speaker, there might be chance to fail read from HW and same happened in the error scenario. Based on Display/Graphics architect suggestion, added a retry mechanism for failure on first attempt. Changes from v1: -Corrected missing braces. Signed-off-by: Vani Ganji <vani.ganji@intel.com> --- sound/hda/hdac_device.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index b26cc93e7e10..3874d54aa686 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -984,10 +984,17 @@ static unsigned int codec_read(struct hdac_device *hdac, hda_nid_t nid, { unsigned int cmd = snd_hdac_make_cmd(hdac, nid, verb, parm); unsigned int res; - - if (snd_hdac_exec_verb(hdac, cmd, flags, &res)) - return -1; - + unsigned int count; + + /* Retry verb once more if it fails first time */ + /* recommended to retry since it is HW related */ + for (count = 0; count <= 1; count++) { + if (snd_hdac_exec_verb(hdac, cmd, flags, &res)) { + if (count == 1) + return -1; + } else + break; + } return res; } -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next reply other threads:[~2019-08-30 5:22 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-30 5:23 vani.ganji [this message] 2019-08-30 5:23 ` [alsa-devel] [PATCH] [PATCH v2] ALSA: hda: Retry codec read on first time failure vani.ganji 2019-08-30 5:38 ` Takashi Iwai
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=20190830052318.25898-1-vani.ganji@intel.com \ --to=vani.ganji@intel.com \ --cc=alsa-devel@alsa-project.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.