diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 79d63c99f09..ce75e07aaa2 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"); |