public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ALSA: hda: fix snd_hda_bus_reset when single_cmd is not supported
@ 2024-08-21  1:42 soxiebing
  2024-08-21  7:11 ` Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: soxiebing @ 2024-08-21  1:42 UTC (permalink / raw)
  To: tiwai; +Cc: linux-sound, linux-kernel, songxiebing

From: songxiebing <songxiebing@kylinos.cn>

When an azx_get_desponse timeout occurs, ensure that bus_reset
can be used when fallback_to_single_cmd is not supported.

Signed-off-by: songxiebing <songxiebing@kylinos.cn>
---
 sound/pci/hda/hda_controller.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 5d86e5a9c814..5ea198d67bda 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -809,10 +809,6 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
 		return -EIO;
 	}
 
-	/* no fallback mechanism? */
-	if (!chip->fallback_to_single_cmd)
-		return -EIO;
-
 	/* a fatal communication error; need either to reset or to fallback
 	 * to the single_cmd mode
 	 */
@@ -824,6 +820,10 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
 		return -EAGAIN; /* give a chance to retry */
 	}
 
+	/* no fallback mechanism? */
+	if (!chip->fallback_to_single_cmd)
+		return -EIO;
+
 	dev_err(chip->card->dev,
 		"azx_get_response timeout, switching to single_cmd mode: last cmd=0x%08x\n",
 		bus->last_cmd[addr]);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-27  5:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21  1:42 [PATCH v1] ALSA: hda: fix snd_hda_bus_reset when single_cmd is not supported soxiebing
2024-08-21  7:11 ` Takashi Iwai
2024-08-26  9:19 ` [PATCH] " soxiebing
2024-08-26 10:01   ` Takashi Iwai
2024-08-27  3:30 ` soxiebing
2024-08-27  5:53   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox