aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-21 11:57:44 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:42:10 -0400
commite96224ae974844d3f4e84f927ca4b17f1a2079a3 (patch)
tree9b521d379b2ecae8506216ca5b11050d49046718
parent81d3dbde76eedcd3ede8a73eb72790d67fa254a9 (diff)
[ALSA] hda-intel - Switch to polling mode for CORB/RIRB communication
Automatically switch to polling mode for CORB/RIRB communication if the irq-driven mode seems not working well. If the polling mode still doesn't work, switch to single_cmd mode as fallback. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/hda/hda_intel.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 79d63c99f092..ce75e07aaa2a 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -332,6 +332,7 @@ struct azx {
332 int position_fix; 332 int position_fix;
333 unsigned int initialized: 1; 333 unsigned int initialized: 1;
334 unsigned int single_cmd: 1; 334 unsigned int single_cmd: 1;
335 unsigned int polling_mode: 1;
335}; 336};
336 337
337/* driver types */ 338/* driver types */
@@ -518,8 +519,23 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
518 struct azx *chip = codec->bus->private_data; 519 struct azx *chip = codec->bus->private_data;
519 int timeout = 50; 520 int timeout = 50;
520 521
521 while (chip->rirb.cmds) { 522 for (;;) {
523 if (chip->polling_mode) {
524 spin_lock_irq(&chip->reg_lock);
525 azx_update_rirb(chip);
526 spin_unlock_irq(&chip->reg_lock);
527 }
528 if (! chip->rirb.cmds)
529 break;
522 if (! --timeout) { 530 if (! --timeout) {
531 if (! chip->polling_mode) {
532 snd_printk(KERN_WARNING "hda_intel: "
533 "azx_get_response timeout, "
534 "switching to polling mode...\n");
535 chip->polling_mode = 1;
536 timeout = 50;
537 continue;
538 }
523 snd_printk(KERN_ERR 539 snd_printk(KERN_ERR
524 "hda_intel: azx_get_response timeout, " 540 "hda_intel: azx_get_response timeout, "
525 "switching to single_cmd mode...\n"); 541 "switching to single_cmd mode...\n");