All of lore.kernel.org
 help / color / mirror / Atom feed
* 0.9.7c, cs4236b and kernel oops
@ 2003-10-15  1:24 Dennis Veatch
  2003-10-15 10:33 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Dennis Veatch @ 2003-10-15  1:24 UTC (permalink / raw)
  To: alsa-devel

This is a Dell GX1 with a cs4236b integrated sound card. Running kernel 
version 2.4.20. I have tried recompiling the kernel any number of ways making 
the sound stuff modules and part of the kernel all with the same results. I 
have wiped out /lib/modules and /usr/src/linux entirely, re-downloaded all 
the kernel stuff and still had the same results. If I use the 0.9.6 version 
of alsa-driver there are no problems.

During boot up it does show the cs4236b being detected correctly. I can 
install Mandrake 9.1 on this box and there is not kernel oops.

If I comment out the alsa line in /etc/modules.conf the system will boot. Then 
if I modprobe soundcore, things are still fine. If I try modprobing the 
snd-cs4236, boom, kernel oops.

Up until alsa-driver version 0.9.6 the sound card worked fine. No problems.  
So I am reasonable sure this has nothing to do with the kernel.

Since versions 0.9.7a, b and c any attempt to load the cs4236 stuff causes a 
kernel oops. Below is some of the oops.

I have looked over the alsa web site and googled on this issue only to find 
some what dated information that leads me to believe this was an issue at one 
time but was supposed to have been corrected by now.
_______________________________________________________
Staring sound driver: snd-cs4236 Unable to handle kernel NULL point 
dereference at virtual address 00000060
printing eip:
f887752b
*pde = 00000000
Oops: 0000
.
.
.
.
.
.

and ends with;

<0>Kernel panis: Aiee, killing interrupt handler!
In interrupt handler - not syncing
-- 
Registered Linux user 193414
http://counter.li.org

"Trying"? My contribution was much closer to a "feeble wave in the general 
direction of something that might lead you one step closer to a solution 
if you squint really hard and do all of the work."



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-15  1:24 0.9.7c, cs4236b and kernel oops Dennis Veatch
@ 2003-10-15 10:33 ` Takashi Iwai
  2003-10-15 13:20   ` Dennis Veatch
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-10-15 10:33 UTC (permalink / raw)
  To: dveatch; +Cc: alsa-devel

At Tue, 14 Oct 2003 21:24:56 -0400,
Dennis Veatch wrote:
> 
> This is a Dell GX1 with a cs4236b integrated sound card. Running kernel 
> version 2.4.20. I have tried recompiling the kernel any number of ways making 
> the sound stuff modules and part of the kernel all with the same results. I 
> have wiped out /lib/modules and /usr/src/linux entirely, re-downloaded all 
> the kernel stuff and still had the same results. If I use the 0.9.6 version 
> of alsa-driver there are no problems.

is it a pnp device or non-pnp?

there are no big changes in the cs423x codes.
so the problem must be in either pnp layer or the change in the core
part.

if it's pnp card, please try to replace snd-pnp.o with the old one in
0.9.6.


Takashi

> 
> During boot up it does show the cs4236b being detected correctly. I can 
> install Mandrake 9.1 on this box and there is not kernel oops.
> 
> If I comment out the alsa line in /etc/modules.conf the system will boot. Then 
> if I modprobe soundcore, things are still fine. If I try modprobing the 
> snd-cs4236, boom, kernel oops.
> 
> Up until alsa-driver version 0.9.6 the sound card worked fine. No problems.  
> So I am reasonable sure this has nothing to do with the kernel.
> 
> Since versions 0.9.7a, b and c any attempt to load the cs4236 stuff causes a 
> kernel oops. Below is some of the oops.
> 
> I have looked over the alsa web site and googled on this issue only to find 
> some what dated information that leads me to believe this was an issue at one 
> time but was supposed to have been corrected by now.
> _______________________________________________________
> Staring sound driver: snd-cs4236 Unable to handle kernel NULL point 
> dereference at virtual address 00000060
> printing eip:
> f887752b
> *pde = 00000000
> Oops: 0000
> .
> .
> .
> .
> .
> .
> 
> and ends with;
> 
> <0>Kernel panis: Aiee, killing interrupt handler!
> In interrupt handler - not syncing
> -- 
> Registered Linux user 193414
> http://counter.li.org
> 
> "Trying"? My contribution was much closer to a "feeble wave in the general 
> direction of something that might lead you one step closer to a solution 
> if you squint really hard and do all of the work."
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-15 10:33 ` Takashi Iwai
@ 2003-10-15 13:20   ` Dennis Veatch
  2003-10-15 14:21     ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Dennis Veatch @ 2003-10-15 13:20 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Wednesday 15 October 2003 06:33 am, Takashi Iwai wrote:
> At Tue, 14 Oct 2003 21:24:56 -0400,
>
> Dennis Veatch wrote:
> > This is a Dell GX1 with a cs4236b integrated sound card. Running kernel
> > version 2.4.20. I have tried recompiling the kernel any number of ways
> > making the sound stuff modules and part of the kernel all with the same
> > results. I have wiped out /lib/modules and /usr/src/linux entirely,
> > re-downloaded all the kernel stuff and still had the same results. If I
> > use the 0.9.6 version of alsa-driver there are no problems.
>
> is it a pnp device or non-pnp?
>
> there are no big changes in the cs423x codes.
> so the problem must be in either pnp layer or the change in the core
> part.
>
> if it's pnp card, please try to replace snd-pnp.o with the old one in
> 0.9.6.
>
>

Actually I am not sure if its pnp or not. During boot it says "isapnp: Card 
'CS4236B' so I assume its pnp? 

There is definitely something different in snd-pnp.o between version 0.9.6 and 
0.9.7 on up. Tried your suggestion of copying snd-pnp.o (version 0.9.60) over 
the same of version 0.9.7c and there was no Oops.

One thing I forgot to mention about 0.9.6. As said it boots fine and all. 
During the install of snd-cs4236 there is a non-fatal error that says;

Starting sound driver: snd-cs4236 CS4236+ WSS PnP configure failed for WSS 
(out of resources?)
isapnp detection failed and probing for CS4236+ is not supported.


-- 
Registered Linux user 193414
http://counter.li.org

"Trying"? My contribution was much closer to a "feeble wave in the general 
direction of something that might lead you one step closer to a solution 
if you squint really hard and do all of the work."



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-15 13:20   ` Dennis Veatch
@ 2003-10-15 14:21     ` Takashi Iwai
  2003-10-16 11:22       ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-10-15 14:21 UTC (permalink / raw)
  To: dveatch; +Cc: alsa-devel

At Wed, 15 Oct 2003 09:20:53 -0400,
Dennis Veatch wrote:
> 
> On Wednesday 15 October 2003 06:33 am, Takashi Iwai wrote:
> > At Tue, 14 Oct 2003 21:24:56 -0400,
> >
> > Dennis Veatch wrote:
> > > This is a Dell GX1 with a cs4236b integrated sound card. Running kernel
> > > version 2.4.20. I have tried recompiling the kernel any number of ways
> > > making the sound stuff modules and part of the kernel all with the same
> > > results. I have wiped out /lib/modules and /usr/src/linux entirely,
> > > re-downloaded all the kernel stuff and still had the same results. If I
> > > use the 0.9.6 version of alsa-driver there are no problems.
> >
> > is it a pnp device or non-pnp?
> >
> > there are no big changes in the cs423x codes.
> > so the problem must be in either pnp layer or the change in the core
> > part.
> >
> > if it's pnp card, please try to replace snd-pnp.o with the old one in
> > 0.9.6.
> >
> >
> 
> Actually I am not sure if its pnp or not. During boot it says "isapnp: Card 
> 'CS4236B' so I assume its pnp? 
 
yes.

> There is definitely something different in snd-pnp.o between version 0.9.6 and 
> 0.9.7 on up. Tried your suggestion of copying snd-pnp.o (version 0.9.60) over 
> the same of version 0.9.7c and there was no Oops.

ok, it looks like the pnp layer is the cause.
i'll take a look.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-15 14:21     ` Takashi Iwai
@ 2003-10-16 11:22       ` Takashi Iwai
  2003-10-16 11:40         ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-10-16 11:22 UTC (permalink / raw)
  To: dveatch; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

At Wed, 15 Oct 2003 16:21:57 +0200,
私 wrote:
> 
> At Wed, 15 Oct 2003 09:20:53 -0400,
> Dennis Veatch wrote:
> > 
> > On Wednesday 15 October 2003 06:33 am, Takashi Iwai wrote:
> > > At Tue, 14 Oct 2003 21:24:56 -0400,
> > >
> > > Dennis Veatch wrote:
> > > > This is a Dell GX1 with a cs4236b integrated sound card. Running kernel
> > > > version 2.4.20. I have tried recompiling the kernel any number of ways
> > > > making the sound stuff modules and part of the kernel all with the same
> > > > results. I have wiped out /lib/modules and /usr/src/linux entirely,
> > > > re-downloaded all the kernel stuff and still had the same results. If I
> > > > use the 0.9.6 version of alsa-driver there are no problems.
> > >
> > > is it a pnp device or non-pnp?
> > >
> > > there are no big changes in the cs423x codes.
> > > so the problem must be in either pnp layer or the change in the core
> > > part.
> > >
> > > if it's pnp card, please try to replace snd-pnp.o with the old one in
> > > 0.9.6.
> > >
> > >
> > 
> > Actually I am not sure if its pnp or not. During boot it says "isapnp: Card 
> > 'CS4236B' so I assume its pnp? 
>  
> yes.
> 
> > There is definitely something different in snd-pnp.o between version 0.9.6 and 
> > 0.9.7 on up. Tried your suggestion of copying snd-pnp.o (version 0.9.60) over 
> > the same of version 0.9.7c and there was no Oops.
> 
> ok, it looks like the pnp layer is the cause.
> i'll take a look.

could you try the attached patch?


Takashi

[-- Attachment #2: pnp-fix.dif --]
[-- Type: application/octet-stream, Size: 5334 bytes --]

Index: alsa-driver/support/pnp/pnp.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-driver/support/pnp/pnp.c,v
retrieving revision 1.11
diff -u -r1.11 pnp.c
--- alsa-driver/support/pnp/pnp.c	24 Sep 2003 15:59:31 -0000	1.11
+++ alsa-driver/support/pnp/pnp.c	16 Oct 2003 11:13:28 -0000
@@ -158,46 +158,51 @@
 int pnp_register_card_driver(struct pnp_card_driver * drv)
 {
 	unsigned short vendor, device;
+	unsigned short subvendor, subdevice;
 	unsigned int i, res = 0;
 	const struct pnp_card_device_id *cid;
 	struct pnp_card *card;
 	struct pnp_dev *dev;
 	struct pnp_card_driver_instance *ninst = NULL;
 	
+	if (! drv->probe) {
+		printk(KERN_ERR "pnp: no probe function!\n");
+		return -EINVAL;
+	}
+
 	for (cid = drv->id_table; cid->id[0] != '\0'; cid++) {
-	      __next_card:
-		card = NULL;
-		do {
-		      __next:
-			if (parse_id(cid->id, &vendor, &device) < 0)
-				break;
-			card = (struct pnp_card *)isapnp_find_card(vendor, device, (struct isapnp_card *)card);
-			if (card) {
-				if (ninst == NULL) {
-					ninst = kmalloc(sizeof(*ninst), GFP_KERNEL);
-					if (ninst == NULL)
-						return res > 0 ? (int)res : -ENOMEM;
-					memset(ninst, 0, sizeof(*ninst));
-					INIT_LIST_HEAD(&ninst->list);
-				}
-				for (i = 0; i < PNP_MAX_DEVICES; i++)
-					ninst->devs[i] = NULL;
-				for (i = 0; i < PNP_MAX_DEVICES && cid->devs[i].id[0] != '\0'; i++) {
-					if (parse_id(cid->devs[i].id, &vendor, &device) < 0) {
-						cid++;
-						goto __next_card;
-					}
-					dev = ninst->devs[i] = (struct pnp_dev *)isapnp_find_dev((struct isapnp_card *)card, vendor, device, NULL);
-					if (dev == NULL)
-						goto __next;
-					if (! dev->p.active) {
-						if (! (drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) {
-							pnp_activate_dev(dev);
-						}
-					} else {
-						if ((drv->flags & PNP_DRIVER_RES_DISABLE) == PNP_DRIVER_RES_DISABLE) {
-							pnp_disable_dev(dev);
-						}
+		if (parse_id(cid->id, &vendor, &device) < 0)
+			continue;
+		card = NULL; 
+		while ((card = (struct pnp_card *)isapnp_find_card(vendor, device, (struct isapnp_card *)card)) != NULL) {
+			if (ninst == NULL) {
+				ninst = kmalloc(sizeof(*ninst), GFP_KERNEL);
+				if (ninst == NULL)
+					return res > 0 ? (int)res : -ENOMEM;
+				memset(ninst, 0, sizeof(*ninst));
+				INIT_LIST_HEAD(&ninst->list);
+			}
+			for (i = 0; i < PNP_MAX_DEVICES; i++)
+				ninst->devs[i] = NULL;
+			for (i = 0; i < PNP_MAX_DEVICES && cid->devs[i].id[0] != '\0'; i++) {
+				if (parse_id(cid->devs[i].id, &subvendor, &subdevice) < 0)
+					goto __next_card;
+				dev = ninst->devs[i] = (struct pnp_dev *)isapnp_find_dev((struct isapnp_card *)card, subvendor, subdevice, NULL);
+				if (dev == NULL)
+					break;
+			}
+			if (i == PNP_MAX_DEVICES || !cid->devs[i].id[0]) {
+				/* all parsed successfully */
+				/* activate or deactivate devices before probing */
+				for (i = 0; i < PNP_MAX_DEVICES; i++) {
+					dev = ninst->devs[i];
+					if (! dev)
+						break;
+					if ((drv->flags & PNP_DRIVER_RES_DISABLE) != PNP_DRIVER_RES_DISABLE)
+						dev->p.activate((struct isapnp_dev *)dev);
+					else {
+						dev->p.deactivate((struct isapnp_dev *)dev);
+						dev->p.prepare((struct isapnp_dev *)dev);
 					}
 				}
 				ninst->link.card = card;
@@ -209,7 +214,9 @@
 					res++;
 				}
 			}
-		} while (card != NULL);
+		}
+	__next_card:
+		;
 	}
 
 	if (ninst != NULL)
@@ -227,7 +234,8 @@
 		inst = list_entry(p, struct pnp_card_driver_instance, list);
 		if (inst->link.driver == drv) {
 			list_del(p);
-			drv->remove(&inst->link);
+			if (drv->remove)
+				drv->remove(&inst->link);
 			kfree(inst);
 		}
 	}
@@ -321,14 +329,9 @@
 	}
 }
 
-/* FIXME: this function cannot be called many times.  the setting is cleared at each time */
 int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode)
 {
 	unsigned int idx;
-	int err;
-
-	/* prepare the isapnp */
-	err = dev->p.prepare((struct isapnp_dev *)dev);
 
 	for (idx = 0; idx < PNP_MAX_IRQ; idx++)
 		copy_resource(&dev->p.irq_resource[idx], &res->irq_resource[idx]);
@@ -344,30 +347,8 @@
 
 int pnp_activate_dev(struct pnp_dev *dev)
 {
-	struct pnp_resource_table *tmp;
-	unsigned int idx;
-
 	if (dev->p.active)
-		return 0; /* FIXME: should be -EBUSY but 2.6 pnp layer behaves like this */
-
-	/* reserve the manual configuration */
-	tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
-	if (! tmp)
-		return -ENOMEM;
-	pnp_init_resource_table(tmp);
-	for (idx = 0; idx < PNP_MAX_IRQ; idx++)
-		copy_resource(&tmp->irq_resource[idx], &dev->p.irq_resource[idx]);
-	for (idx = 0; idx < PNP_MAX_DMA; idx++)
-		copy_resource(&tmp->dma_resource[idx], &dev->p.dma_resource[idx]);
-	for (idx = 0; idx < PNP_MAX_PORT; idx++)
-		copy_resource(&tmp->port_resource[idx], &dev->p.resource[idx]);
-	for (idx = 0; idx < PNP_MAX_MEM; idx++)
-		copy_resource(&tmp->mem_resource[idx], &dev->p.resource[idx+8]);
-
-	/* restore the manual configuration again */
-	pnp_manual_config_dev(dev, tmp, 0);
-	kfree(tmp);
-
+		return 0; /* 2.6 pnp layer behaves like this */
 	return dev->p.activate((struct isapnp_dev *)dev);
 }
 
@@ -376,7 +357,6 @@
 	if (! dev->p.active)
 		return 0;
 	return dev->p.deactivate((struct isapnp_dev *)dev);
-	/* FIXME: do we need clean up the resources again? */
 }
 
 static int __init pnp_init(void)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-16 11:22       ` Takashi Iwai
@ 2003-10-16 11:40         ` Takashi Iwai
  2003-10-16 12:46           ` Stumbles
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2003-10-16 11:40 UTC (permalink / raw)
  To: dveatch; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

At Thu, 16 Oct 2003 13:22:37 +0200,
I wrote:
> 
> could you try the attached patch?

found one more potential bug.  use this one instead.


Takashi

[-- Attachment #2: pnp-fix2.dif --]
[-- Type: application/octet-stream, Size: 5884 bytes --]

Index: alsa-driver/support/pnp/pnp.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-driver/support/pnp/pnp.c,v
retrieving revision 1.11
diff -u -r1.11 pnp.c
--- alsa-driver/support/pnp/pnp.c	24 Sep 2003 15:59:31 -0000	1.11
+++ alsa-driver/support/pnp/pnp.c	16 Oct 2003 11:36:49 -0000
@@ -158,46 +158,51 @@
 int pnp_register_card_driver(struct pnp_card_driver * drv)
 {
 	unsigned short vendor, device;
+	unsigned short subvendor, subdevice;
 	unsigned int i, res = 0;
 	const struct pnp_card_device_id *cid;
 	struct pnp_card *card;
 	struct pnp_dev *dev;
 	struct pnp_card_driver_instance *ninst = NULL;
 	
+	if (! drv->probe) {
+		printk(KERN_ERR "pnp: no probe function!\n");
+		return -EINVAL;
+	}
+
 	for (cid = drv->id_table; cid->id[0] != '\0'; cid++) {
-	      __next_card:
-		card = NULL;
-		do {
-		      __next:
-			if (parse_id(cid->id, &vendor, &device) < 0)
-				break;
-			card = (struct pnp_card *)isapnp_find_card(vendor, device, (struct isapnp_card *)card);
-			if (card) {
-				if (ninst == NULL) {
-					ninst = kmalloc(sizeof(*ninst), GFP_KERNEL);
-					if (ninst == NULL)
-						return res > 0 ? (int)res : -ENOMEM;
-					memset(ninst, 0, sizeof(*ninst));
-					INIT_LIST_HEAD(&ninst->list);
-				}
-				for (i = 0; i < PNP_MAX_DEVICES; i++)
-					ninst->devs[i] = NULL;
-				for (i = 0; i < PNP_MAX_DEVICES && cid->devs[i].id[0] != '\0'; i++) {
-					if (parse_id(cid->devs[i].id, &vendor, &device) < 0) {
-						cid++;
-						goto __next_card;
-					}
-					dev = ninst->devs[i] = (struct pnp_dev *)isapnp_find_dev((struct isapnp_card *)card, vendor, device, NULL);
-					if (dev == NULL)
-						goto __next;
-					if (! dev->p.active) {
-						if (! (drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) {
-							pnp_activate_dev(dev);
-						}
-					} else {
-						if ((drv->flags & PNP_DRIVER_RES_DISABLE) == PNP_DRIVER_RES_DISABLE) {
-							pnp_disable_dev(dev);
-						}
+		if (parse_id(cid->id, &vendor, &device) < 0)
+			continue;
+		card = NULL; 
+		while ((card = (struct pnp_card *)isapnp_find_card(vendor, device, (struct isapnp_card *)card)) != NULL) {
+			if (ninst == NULL) {
+				ninst = kmalloc(sizeof(*ninst), GFP_KERNEL);
+				if (ninst == NULL)
+					return res > 0 ? (int)res : -ENOMEM;
+				memset(ninst, 0, sizeof(*ninst));
+				INIT_LIST_HEAD(&ninst->list);
+			}
+			for (i = 0; i < PNP_MAX_DEVICES; i++)
+				ninst->devs[i] = NULL;
+			for (i = 0; i < PNP_MAX_DEVICES && cid->devs[i].id[0] != '\0'; i++) {
+				if (parse_id(cid->devs[i].id, &subvendor, &subdevice) < 0)
+					goto __next_card;
+				dev = ninst->devs[i] = (struct pnp_dev *)isapnp_find_dev((struct isapnp_card *)card, subvendor, subdevice, NULL);
+				if (dev == NULL)
+					break;
+			}
+			if (i == PNP_MAX_DEVICES || !cid->devs[i].id[0]) {
+				/* all parsed successfully */
+				/* activate or deactivate devices before probing */
+				for (i = 0; i < PNP_MAX_DEVICES; i++) {
+					dev = ninst->devs[i];
+					if (! dev)
+						break;
+					if ((drv->flags & PNP_DRIVER_RES_DISABLE) != PNP_DRIVER_RES_DISABLE)
+						dev->p.activate((struct isapnp_dev *)dev);
+					else {
+						dev->p.deactivate((struct isapnp_dev *)dev);
+						dev->p.prepare((struct isapnp_dev *)dev);
 					}
 				}
 				ninst->link.card = card;
@@ -209,7 +214,9 @@
 					res++;
 				}
 			}
-		} while (card != NULL);
+		}
+	__next_card:
+		;
 	}
 
 	if (ninst != NULL)
@@ -227,7 +234,8 @@
 		inst = list_entry(p, struct pnp_card_driver_instance, list);
 		if (inst->link.driver == drv) {
 			list_del(p);
-			drv->remove(&inst->link);
+			if (drv->remove)
+				drv->remove(&inst->link);
 			kfree(inst);
 		}
 	}
@@ -284,11 +292,14 @@
 
 static void copy_resource(struct resource *dst, const struct resource *src)
 {
-	dst->name = src->name;
-	dst->start = src->start;
-	dst->end = src->end;
-	dst->flags = (dst->flags & ~IORESOURCE_AUTO) |
-		(dst->flags & src->flags & IORESOURCE_AUTO);
+	/* copy if set manually */
+	if (src->name)
+		dst->name = src->name;
+	if (! (src->flags & IORESOURCE_AUTO)) {
+		dst->start = src->start;
+		dst->end = src->end;
+		dst->flags &= ~IORESOURCE_AUTO;
+	}
 }
 
 void pnp_init_resource_table(struct pnp_resource_table *table)
@@ -321,14 +332,9 @@
 	}
 }
 
-/* FIXME: this function cannot be called many times.  the setting is cleared at each time */
 int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode)
 {
 	unsigned int idx;
-	int err;
-
-	/* prepare the isapnp */
-	err = dev->p.prepare((struct isapnp_dev *)dev);
 
 	for (idx = 0; idx < PNP_MAX_IRQ; idx++)
 		copy_resource(&dev->p.irq_resource[idx], &res->irq_resource[idx]);
@@ -344,30 +350,8 @@
 
 int pnp_activate_dev(struct pnp_dev *dev)
 {
-	struct pnp_resource_table *tmp;
-	unsigned int idx;
-
 	if (dev->p.active)
-		return 0; /* FIXME: should be -EBUSY but 2.6 pnp layer behaves like this */
-
-	/* reserve the manual configuration */
-	tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
-	if (! tmp)
-		return -ENOMEM;
-	pnp_init_resource_table(tmp);
-	for (idx = 0; idx < PNP_MAX_IRQ; idx++)
-		copy_resource(&tmp->irq_resource[idx], &dev->p.irq_resource[idx]);
-	for (idx = 0; idx < PNP_MAX_DMA; idx++)
-		copy_resource(&tmp->dma_resource[idx], &dev->p.dma_resource[idx]);
-	for (idx = 0; idx < PNP_MAX_PORT; idx++)
-		copy_resource(&tmp->port_resource[idx], &dev->p.resource[idx]);
-	for (idx = 0; idx < PNP_MAX_MEM; idx++)
-		copy_resource(&tmp->mem_resource[idx], &dev->p.resource[idx+8]);
-
-	/* restore the manual configuration again */
-	pnp_manual_config_dev(dev, tmp, 0);
-	kfree(tmp);
-
+		return 0; /* 2.6 pnp layer behaves like this */
 	return dev->p.activate((struct isapnp_dev *)dev);
 }
 
@@ -376,7 +360,6 @@
 	if (! dev->p.active)
 		return 0;
 	return dev->p.deactivate((struct isapnp_dev *)dev);
-	/* FIXME: do we need clean up the resources again? */
 }
 
 static int __init pnp_init(void)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-16 11:40         ` Takashi Iwai
@ 2003-10-16 12:46           ` Stumbles
  2003-10-16 12:54             ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Stumbles @ 2003-10-16 12:46 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Thursday 16 October 2003 07:40 am, Takashi Iwai wrote:
> At Thu, 16 Oct 2003 13:22:37 +0200,
>
> I wrote:
> > could you try the attached patch?
>
> found one more potential bug.  use this one instead.
>
>
> Takashi

Glad I waited. Is it, move to /usr/src/alsa-driver-0.9.7c/support/pnp and 
"patch -p1 < file"? Another dumb question, how do I get patch not to ask 
about skipping it and do it anyway? The reason is I have a script that 
automates the build.


-- 
Registered Linux user 193414
http://counter.li.org

"Trying"? My contribution was much closer to a "feeble wave in the general 
direction of something that might lead you one step closer to a solution 
if you squint really hard and do all of the work."



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 0.9.7c, cs4236b and kernel oops
  2003-10-16 12:46           ` Stumbles
@ 2003-10-16 12:54             ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2003-10-16 12:54 UTC (permalink / raw)
  To: dveatch; +Cc: alsa-devel

At Thu, 16 Oct 2003 08:46:38 -0400,
Stumbles wrote:
> 
> On Thursday 16 October 2003 07:40 am, Takashi Iwai wrote:
> > At Thu, 16 Oct 2003 13:22:37 +0200,
> >
> > I wrote:
> > > could you try the attached patch?
> >
> > found one more potential bug.  use this one instead.
> >
> >
> > Takashi
> 
> Glad I waited. Is it, move to /usr/src/alsa-driver-0.9.7c/support/pnp and 
> "patch -p1 < file"?

/usr/src/alsa-driver-0.9.7c, if you use -p1.

>  Another dumb question, how do I get patch not to ask 
> about skipping it and do it anyway? The reason is I have a script that 
> automates the build.

patch asks to skip if the corresponding file is not found.
that is, something is wrong, e.g. the wrong path.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-16 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-15  1:24 0.9.7c, cs4236b and kernel oops Dennis Veatch
2003-10-15 10:33 ` Takashi Iwai
2003-10-15 13:20   ` Dennis Veatch
2003-10-15 14:21     ` Takashi Iwai
2003-10-16 11:22       ` Takashi Iwai
2003-10-16 11:40         ` Takashi Iwai
2003-10-16 12:46           ` Stumbles
2003-10-16 12:54             ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.