Re: Alsa vs ALi5451

Takashi Iwai (tiwai@suse.de)
Wed, 30 Oct 2002 18:37:15 +0100


--Multipart_Wed_Oct_30_18:37:14_2002-1
Content-Type: text/plain; charset=US-ASCII

Hi,

At Tue, 29 Oct 2002 22:40:43 +0100,
Michal Rokos wrote:
>
> Hi,
>
> I'm having problem with ALi5451 audio chipset.
>
> Insmod segfaults and lsmod says that initializing the snd-ali5451. The wierd is the OSS trident module is working just fine (with some limitation - I can't make it work throught the phones), but it's workin'. So I guess it's alsa problem.
>
> All that come to my mind that could be helpfull i attached. (syslog entry, alsa config, dmesg, lspci --v).
>
> Please, keep me in CC - I'm not on list.

does the attached patch cure?

Takashi

--Multipart_Wed_Oct_30_18:37:14_2002-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="ali5451-free-fix.dif"
Content-Transfer-Encoding: 7bit

--- linux/sound/pci/ali5451/ali5451.c 22 Oct 2002 09:37:30 -0000 1.18
+++ linux/sound/pci/ali5451/ali5451.c 30 Oct 2002 17:24:48 -0000 1.19
@@ -233,6 +233,7 @@
unsigned long port;
unsigned char revision;

+ unsigned int hw_initialized: 1;
struct resource *res_port;

struct pci_dev *pci;
@@ -1965,7 +1966,8 @@

static int snd_ali_free(ali_t * codec)
{
- snd_ali_disable_address_interrupt(codec);
+ if (codec->hw_initialized)
+ snd_ali_disable_address_interrupt(codec);
if (codec->irq >= 0) {
synchronize_irq(codec->irq);
free_irq(codec->irq, (void *)codec);
@@ -2036,13 +2038,11 @@
{
snd_ali_printk("resouces allocation ...\n");
if ((codec->res_port = request_region(codec->port, 0x100, "ALI 5451")) == NULL) {
- snd_ali_free(codec);
snd_printk("Unalbe to request io ports.\n");
return -EBUSY;
}

if (request_irq(codec->pci->irq, snd_ali_card_interrupt, SA_INTERRUPT|SA_SHIRQ, "ALI 5451", (void *)codec)) {
- snd_ali_free(codec);
snd_printk("Unable to request irq.\n");
return -EBUSY;
}
@@ -2112,6 +2112,7 @@
pci_set_master(pci);

if (snd_ali_resources(codec)) {
+ snd_ali_free(codec);
return -EBUSY;
}

@@ -2156,7 +2157,6 @@

if ((err = snd_ali_chip_init(codec)) < 0) {
snd_printk("ali create: chip init error.\n");
- snd_ali_free(codec);
return err;
}

@@ -2167,6 +2167,7 @@
#endif

snd_ali_enable_address_interrupt(codec);
+ codec->hw_initialized = 1;

*r_ali = codec;
snd_ali_printk("created.\n");

--Multipart_Wed_Oct_30_18:37:14_2002-1--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/