From b8ee770cfbb7e43cfb4a1e517c136a19cea2710b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 3 May 2011 17:06:53 +0200 Subject: [PATCH] --- yaml --- r: 248131 b: refs/heads/master c: fe4af1b55ed76e3051bbd8abce7d6b3c504272a5 h: refs/heads/master i: 248129: cbda70ca317e5ddd8e58a3a2d914a43b72b6a727 248127: 1d4fb3b19f3d5df4dfc3e12c2eb87dea0a88b864 v: v3 --- [refs] | 2 +- trunk/sound/pci/lola/lola.c | 12 +++++++++++- trunk/sound/pci/lola/lola.h | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c226eedc6df0..dcacf19248d0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2db3002029d6c8fbd8ad4ab21f501475cd8c96f9 +refs/heads/master: fe4af1b55ed76e3051bbd8abce7d6b3c504272a5 diff --git a/trunk/sound/pci/lola/lola.c b/trunk/sound/pci/lola/lola.c index 8ee22bee10c9..34b24286d279 100644 --- a/trunk/sound/pci/lola/lola.c +++ b/trunk/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/trunk/sound/pci/lola/lola.h b/trunk/sound/pci/lola/lola.h index 400ab5ef4c6c..d5708e29b16d 100644 --- a/trunk/sound/pci/lola/lola.h +++ b/trunk/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;