summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-08-09 17:13:16 +0300
committerTakashi Iwai <tiwai@suse.de>2019-08-09 17:50:29 +0300
commitf43ec25aa5480515a39a405084ca8cb5e2c408aa (patch)
treea9ce4fa64a578f32caa74f856c750efe00e03b81 /sound/pci
parent533d7647a1dbefc2eacf76df9f183b48e4549506 (diff)
downloadlinux-f43ec25aa5480515a39a405084ca8cb5e2c408aa.tar.xz
ALSA: hda - Inform too slow responses
For the sake of debugging, show each response that took too long time and its corresponding last verb. Since such an error happens in series once when started, use the ratelimited variant for suppressing the flood. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_controller.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 156930d0c9d3..ec0608d44263 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -789,6 +789,7 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
unsigned long timeout;
unsigned long loopcounter;
int do_poll = 0;
+ bool warned = false;
again:
timeout = jiffies + msecs_to_jiffies(1000);
@@ -808,9 +809,17 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
spin_unlock_irq(&bus->reg_lock);
if (time_after(jiffies, timeout))
break;
- if (hbus->needs_damn_long_delay || loopcounter > 3000)
+#define LOOP_COUNT_MAX 3000
+ if (hbus->needs_damn_long_delay ||
+ loopcounter > LOOP_COUNT_MAX) {
+ if (loopcounter > LOOP_COUNT_MAX && !warned) {
+ dev_dbg_ratelimited(chip->card->dev,
+ "too slow response, last cmd=%#08x\n",
+ bus->last_cmd[addr]);
+ warned = true;
+ }
msleep(2); /* temporary workaround */
- else {
+ } else {
udelay(10);
cond_resched();
}