Merge branch 'fix/hda' into for-linus

+18 -3
+18 -3
sound/pci/hda/hda_intel.c
··· 426 427 /* flags */ 428 int position_fix; 429 unsigned int running :1; 430 unsigned int initialized :1; 431 unsigned int single_cmd :1; ··· 507 #define get_azx_dev(substream) (substream->runtime->private_data) 508 509 static int azx_acquire_irq(struct azx *chip, int do_disconnect); 510 - 511 /* 512 * Interface for HD codec 513 */ ··· 665 { 666 struct azx *chip = bus->private_data; 667 unsigned long timeout; 668 669 again: 670 timeout = jiffies + msecs_to_jiffies(1000); 671 for (;;) { 672 - if (chip->polling_mode) { 673 spin_lock_irq(&chip->reg_lock); 674 azx_update_rirb(chip); 675 spin_unlock_irq(&chip->reg_lock); ··· 678 if (!chip->rirb.cmds[addr]) { 679 smp_rmb(); 680 bus->rirb_error = 0; 681 return chip->rirb.res[addr]; /* the last value */ 682 } 683 if (time_after(jiffies, timeout)) ··· 692 cond_resched(); 693 } 694 } 695 696 if (!chip->polling_mode) { 697 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " ··· 2058 { 2059 if (request_irq(chip->pci->irq, azx_interrupt, 2060 chip->msi ? 0 : IRQF_SHARED, 2061 - "HDA Intel", chip)) { 2062 printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " 2063 "disabling device\n", chip->pci->irq); 2064 if (do_disconnect)
··· 426 427 /* flags */ 428 int position_fix; 429 + int poll_count; 430 unsigned int running :1; 431 unsigned int initialized :1; 432 unsigned int single_cmd :1; ··· 506 #define get_azx_dev(substream) (substream->runtime->private_data) 507 508 static int azx_acquire_irq(struct azx *chip, int do_disconnect); 509 + static int azx_send_cmd(struct hda_bus *bus, unsigned int val); 510 /* 511 * Interface for HD codec 512 */ ··· 664 { 665 struct azx *chip = bus->private_data; 666 unsigned long timeout; 667 + int do_poll = 0; 668 669 again: 670 timeout = jiffies + msecs_to_jiffies(1000); 671 for (;;) { 672 + if (chip->polling_mode || do_poll) { 673 spin_lock_irq(&chip->reg_lock); 674 azx_update_rirb(chip); 675 spin_unlock_irq(&chip->reg_lock); ··· 676 if (!chip->rirb.cmds[addr]) { 677 smp_rmb(); 678 bus->rirb_error = 0; 679 + 680 + if (!do_poll) 681 + chip->poll_count = 0; 682 return chip->rirb.res[addr]; /* the last value */ 683 } 684 if (time_after(jiffies, timeout)) ··· 687 cond_resched(); 688 } 689 } 690 + 691 + if (!chip->polling_mode && chip->poll_count < 2) { 692 + snd_printdd(SFX "azx_get_response timeout, " 693 + "polling the codec once: last cmd=0x%08x\n", 694 + chip->last_cmd[addr]); 695 + do_poll = 1; 696 + chip->poll_count++; 697 + goto again; 698 + } 699 + 700 701 if (!chip->polling_mode) { 702 snd_printk(KERN_WARNING SFX "azx_get_response timeout, " ··· 2043 { 2044 if (request_irq(chip->pci->irq, azx_interrupt, 2045 chip->msi ? 0 : IRQF_SHARED, 2046 + "hda_intel", chip)) { 2047 printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " 2048 "disabling device\n", chip->pci->irq); 2049 if (do_disconnect)