Messages in this thread Patch in this message |  | | Subject | Re: Linux 2.2.17pre19 | From | Marcus Sundberg <> | Date | 20 Aug 2000 02:12:55 +0200 |
| |
alan@lxorguk.ukuu.org.uk (Alan Cox) writes:
> o Fix a couple of kfree and follow the pointer > bugs in the i810 audio driver (Bob Frey)
There are still a few bugs in the 810 driver.
The wake_up() fix is taken from trident.c and prevents xmms from using 100% CPU.
The last two hunks contains one obviously correct fix (changing count-- to --count) and one change which is necessary on my Toshiba laptop with a 82443MX-100 (aka 440MX) chipset and a SigmaTel STAC9744 codec. On this machine (inl(card->iobase + GLOB_STA) & 0x0100) is always true, causing a 10ms busywait for every ac97 access... Why was the GLOB_STA check added in the first place? It's IIRC not present in 2.2.16.
Also, on the games I've tried (rocksndiamonds, mirrormagic, xkoules) the audio output is completely broken (sound seems to get stuck in a short loop). That I haven't managed to fix.
--- i810_audio.c.orig Sun Aug 20 00:54:36 2000 +++ i810_audio.c Sun Aug 20 01:52:56 2000 @@ -836,8 +836,10 @@ memset (dmabuf->rawbuf + swptr, silence, clear_cnt); dmabuf->endcleared = 1; } - } - wake_up(&dmabuf->wait); + } + if (dmabuf->count < (signed)dmabuf->dmasize/2) { + wake_up(&dmabuf->wait); + } } } /* error handling and process wake up for DAC */ @@ -857,7 +859,9 @@ // printk("DMA overrun on send\n"); dmabuf->error++; } - wake_up(&dmabuf->wait); + if (dmabuf->count < (signed)dmabuf->dmasize/2) { + wake_up(&dmabuf->wait); + } } }SigmaTel STAC9744 } @@ -1592,12 +1596,14 @@ struct i810_card *card = dev->private_data; int count = 1000; - while(count-- && (inl(card->iobase + GLOB_STA) & 0x0100)) - udelay(10); - if(!count) - printk("i810_audio: AC97 access failed.\n"); - count=1000; - while(count-- && (inb(card->iobase + CAS) & 1)) + if (card->pci_id != INTEL440MX) { + while(--count && (inl(card->iobase + GLOB_STA) & 0x0100)) + udelay(10); + if(!count) + printk("i810_audio: AC97 access failed.\n"); + count=1000; + } + while(--count && (inb(card->iobase + CAS) & 1)) udelay(10); if(!count) printk("i810_audio: AC97 access failed.\n"); @@ -1609,13 +1615,15 @@ struct i810_card *card = dev->private_data; int count = 1000; - while(count-- && (inl(card->iobase + GLOB_STA) & 0x0100)) - udelay(10); - if(!count) - printk("i810_audio: AC97 write access failed.\n"); + if (card->pci_id != INTEL440MX) { + while(--count && (inl(card->iobase + GLOB_STA) & 0x0100)) + udelay(10); + if(!count) + printk("i810_audio: AC97 write access failed.\n"); - count=1000; - while(count-- && (inb(card->iobase + CAS) & 1)) + count=1000; + } + while(--count && (inb(card->iobase + CAS) & 1)) udelay(10); if(!count) printk("i810_audio: AC97 write access failed.\n");
//Marcus -- -------------------------------+----------------------------------- Marcus Sundberg | Phone: +46 707 452062 Embedded Systems Consultant | Email: marcus@cendio.se Cendio Systems AB | http://www.cendio.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |