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