Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28a0d9df0706c523d3bb8de18892c76b78c2e428
Commit:     28a0d9df0706c523d3bb8de18892c76b78c2e428
Parent:     7cda8ba9f4e471dfba914ecf67fd14ebffb17c16
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 18 15:32:32 2008 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:30:05 2008 +0100

    [ALSA] hda-intel - Make azx_get_response() a bit more robust
    
    In azx_[rirb_]get_response(), the timeout is checked at the end of the loop.
    It's better to be checked just after the check of the RIRB index to avoid
    a bogus error with a too long msleep().
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/hda/hda_intel.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index fe07bdf..be5cbbc 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -551,7 +551,7 @@ static unsigned int azx_rirb_get_response(struct hda_codec 
*codec)
 
  again:
        timeout = jiffies + msecs_to_jiffies(1000);
-       do {
+       for (;;) {
                if (chip->polling_mode) {
                        spin_lock_irq(&chip->reg_lock);
                        azx_update_rirb(chip);
@@ -559,13 +559,15 @@ static unsigned int azx_rirb_get_response(struct 
hda_codec *codec)
                }
                if (!chip->rirb.cmds)
                        return chip->rirb.res; /* the last value */
+               if (time_after(jiffies, timeout))
+                       break;
                if (codec->bus->needs_damn_long_delay)
                        msleep(2); /* temporary workaround */
                else {
                        udelay(10);
                        cond_resched();
                }
-       } while (time_after_eq(timeout, jiffies));
+       }
 
        if (chip->msi) {
                snd_printk(KERN_WARNING "hda_intel: No response from codec, "
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to