Commit f43ec25a authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 533d7647
...@@ -789,6 +789,7 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, ...@@ -789,6 +789,7 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
unsigned long timeout; unsigned long timeout;
unsigned long loopcounter; unsigned long loopcounter;
int do_poll = 0; int do_poll = 0;
bool warned = false;
again: again:
timeout = jiffies + msecs_to_jiffies(1000); timeout = jiffies + msecs_to_jiffies(1000);
...@@ -808,9 +809,17 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, ...@@ -808,9 +809,17 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr,
spin_unlock_irq(&bus->reg_lock); spin_unlock_irq(&bus->reg_lock);
if (time_after(jiffies, timeout)) if (time_after(jiffies, timeout))
break; 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 */ msleep(2); /* temporary workaround */
else { } else {
udelay(10); udelay(10);
cond_resched(); cond_resched();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment