diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/lola/lola.c | 12 | ||||
-rw-r--r-- | sound/pci/lola/lola.h | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 8ee22be..34b2428 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c @@ -153,8 +153,14 @@ static int rirb_get_response(struct lola *chip, unsigned int *val, { unsigned long timeout; + again: timeout = jiffies + msecs_to_jiffies(1000); for (;;) { + if (chip->polling_mode) { + spin_lock_irq(&chip->reg_lock); + lola_update_rirb(chip); + spin_unlock_irq(&chip->reg_lock); + } if (!chip->rirb.cmds) { *val = chip->res; if (extval) @@ -175,9 +181,13 @@ static int rirb_get_response(struct lola *chip, unsigned int *val, break; udelay(20); cond_resched(); - lola_update_rirb(chip); } printk(KERN_WARNING SFX "RIRB response error\n"); + if (!chip->polling_mode) { + printk(KERN_WARNING SFX "switching to polling mode\n"); + chip->polling_mode = 1; + goto again; + } return -EIO; } diff --git a/sound/pci/lola/lola.h b/sound/pci/lola/lola.h index 400ab5e..d5708e2 100644 --- a/sound/pci/lola/lola.h +++ b/sound/pci/lola/lola.h @@ -374,8 +374,9 @@ struct lola { unsigned int sample_rate_max; /* flags */ - unsigned int initialized :1; - unsigned int cold_reset :1; + unsigned int initialized:1; + unsigned int cold_reset:1; + unsigned int polling_mode:1; /* for debugging */ unsigned int debug_res; |