Skip to contentSkip to conversation

PnP BIOS -- bugfix; update devlist on setpnp

PATCH In review Thomas Hood 8 participants 15 messages Oct 13, 2001 – Oct 17, 2001 Pnp support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PnP BIOS -- bugfix; update devlist on setpnp

Okay, here's a new major patch to the PnP BIOS driver which needs some testing before it's integrated.

Applies against 2.4.10-ac12, perhaps also against 2.4.11-ac1, though I haven't tried.

Please test and let me know whether there are any problems.

Vaio users: Please make sure that this doesn't oops.
Others: Try using setpnp to change the current configuration. Unload and reload the parport drivers to check that they reinitialize with the updated resource information provided by the PnP BIOS driver.

1) Fix bugs in resource reservation:
- end of reserved range too large by 1
- didn't reserve all system board resources
2) Change code so that set_dev_node updates the devlist, so drivers loaded after a setpnp will get up-to-date resource information. Because I haven't protected devlist update code with locks, this feature isn't SMP safe yet. I'd like some advice about how to do the locking. If you're worried, don't use setpnp.
3) Miscellaneous code cleanups. Use "pnpbios" more consistently. Improve printk output. Etc.

The patch:

init/main.c +1 -1
@@ -824,7 +824,7 @@
 	isapnp_init();
 #endif
 #ifdef CONFIG_PNPBIOS
-        pnp_bios_init();
+        pnpbios_init();
 #endif
 
 #ifdef CONFIG_TC
include/linux/pnp_bios.h +30 -30

91 lines not on this page · raw message

drivers/pnp/pnp_bios.c +273 -198

829 lines not on this page · raw message

drivers/pnp/pnp_proc.c +19 -19
@@ -31,10 +31,10 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
 	for (i=0,nodenum=0;i<0xff && nodenum!=0xff; i++) {
-		if ( pnp_bios_get_dev_node(&nodenum, 1, node) )
+		if ( pnpbios_get_dev_node(&nodenum, 1, node) )
 			break;
 		p += sprintf(p, "%02x\t%08x\t%02x:%02x:%02x\t%04x\n",
 			     node->handle, node->eisa_id,
@@ -57,9 +57,9 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	len = node->size - sizeof(struct pnp_bios_node);
 	memcpy(buf, node->data, len);
@@ -74,22 +74,25 @@
 	int boot = (long)data >> 8;
 	u8 nodenum = (long)data;
 
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	if (count != node->size - sizeof(struct pnp_bios_node))
 		return -EINVAL;
 	memcpy(node->data, buf, count);
-	if (pnp_bios_set_dev_node(node->handle, boot, node) != 0)
+	if (pnpbios_set_dev_node(node->handle, boot, node) != 0)
 	    return -EINVAL;
 	kfree(node);
 	return count;
 }
 
-static int pnp_proc_dont_use_current_config;
-
-void pnp_proc_init( int dont_use_current )
+/*
+ * When this is called, pnpbios functions are assumed to
+ * work and the pnpbios_dont_use_current_config flag
+ * should already have been set to the appropriate value
+ */
+void pnpbios_proc_init( void )
 {
 	struct pnp_bios_node *node;
 	struct proc_dir_entry *ent;
@@ -97,10 +100,7 @@
 	int i;
 	u8 nodenum;
 
-	pnp_proc_dont_use_current_config = dont_use_current;
-
-	if (!pnp_bios_present()) return;
-	if (pnp_bios_dev_node_info(&node_info) != 0) return;
+	if (pnpbios_dev_node_info(&node_info) != 0) return;
 	
 	proc_pnp = proc_mkdir("pnp", proc_bus);
 	if (!proc_pnp) return;
@@ -108,13 +108,13 @@
 	if (!proc_pnp_boot) return;
 	create_proc_read_entry("devices", 0, proc_pnp, proc_read_devices, NULL);
 	
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return;
 	for (i=0,nodenum = 0; i<0xff && nodenum != 0xff; i++) {
-		if (pnp_bios_get_dev_node(&nodenum, 1, node) != 0)
+		if (pnpbios_get_dev_node(&nodenum, 1, node) != 0)
 			break;
 		sprintf(name, "%02x", node->handle);
-		if ( !pnp_proc_dont_use_current_config ) {
+		if ( !pnpbios_dont_use_current_config ) {
 			ent = create_proc_entry(name, 0, proc_pnp);
 			if (ent) {
 				ent->read_proc = proc_read_node;
@@ -132,7 +132,7 @@
 	kfree(node);
 }
 
-void pnp_proc_done(void)
+void pnpbios_proc_done(void)
 {
 	int i;
 	char name[3];
@@ -141,7 +141,7 @@
 
 	for (i=0; i<0xff; i++) {
 		sprintf(name, "%02x", i);
-		if ( !pnp_proc_dont_use_current_config )
+		if ( !pnpbios_dont_use_current_config )
 			remove_proc_entry(name, proc_pnp);
 		remove_proc_entry(name, proc_pnp_boot);
 	}
#1 lore raw
Quoted 4 lines · Thomas Hood

Okay, here's a new major patch to the PnP BIOS driver which needs some testing before it's integrated. [...]
Vaio users: Please make sure that this doesn't oops.

Patched against 2.4.12-ac1, it works and doesn't oops my VAIO PCG-N505VE.

-j

Signature · 3 lines
Jürgen Botz                       | While differing widely in the various
[email protected]                   | little bits we know, in our infinite
                                  | ignorance we are all equal. -Karl Popper
#2 lore raw
In reply to Thomas Hood
Quoted 8 lines · Jurgen Botz
Quoted 4 lines · Thomas Hood

Okay, here's a new major patch to the PnP BIOS driver which needs some testing before it's integrated. [...]
Vaio users: Please make sure that this doesn't oops.

Patched against 2.4.12-ac1, it works and doesn't oops my VAIO PCG-N505VE.

Same for me (against a 2.4.10-ac12), on a VAIO PCG-C1VE.

Relevant (maybe) output:

...
Sony Vaio laptop detected.
BIOS strings suggest APM reports battery life in minutes and wrong byte order.
PCI: PCI BIOS revision 2.10 entry at 0xfd98e, last bus=0
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Using IRQ router PIIX [8086/7110] at 00:07.0
PCI: Found IRQ 9 for device 00:08.0
PCI: Sharing IRQ 9 with 00:07.2
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
PnPBIOS: Found PnP BIOS installation structure at 0xc00f8120.
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xb25f, dseg 0x400.
PnPBIOS: 14 nodes reported by PnP BIOS; 14 recorded by driver.
PnPBIOS: PNP0c02: 0xfff80000-0xffffffff was already reserved
PnPBIOS: PNP0c02: 0xfff7f600-0xfff7ffff was already reserved
PnPBIOS: PNP0c02: 0x398-0x399 has been reserved
PnPBIOS: PNP0c02: 0x4d0-0x4d1 has been reserved
PnPBIOS: PNP0c02: 0x8000-0x804f was already reserved
PnPBIOS: PNP0c02: 0x1040-0x104f has been reserved
PnPBIOS: PNP0c01: 0xe8000-0xfffff was already reserved
PnPBIOS: PNP0c01: 0x100000-0x70ffbff was already reserved
PnPBIOS: PNP0c02: 0xdc000-0xdffff was already reserved
PnPBIOS: PNP0c02: 0xd1000-0xd3fff was already reserved
Linux NET4.0 for Linux 2.4
...

Stelian.

Signature · 4 lines
Stelian Pop <[email protected]>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|
#3 lore raw
In reply to Thomas Hood
Quoted 15 lines · Stelian Pop
Quoted 8 lines · Jurgen Botz
Quoted 4 lines · Thomas Hood

Okay, here's a new major patch to the PnP BIOS driver which needs some testing before it's integrated. [...]
Vaio users: Please make sure that this doesn't oops.

Patched against 2.4.12-ac1, it works and doesn't oops my VAIO PCG-N505VE.

Same for me (against a 2.4.10-ac12), on a VAIO PCG-C1VE.

Relevant (maybe) output:

Quoted 15 lines

...
Sony Vaio laptop detected.
BIOS strings suggest APM reports battery life in minutes and wrong byte order.
PCI: PCI BIOS revision 2.10 entry at 0xfd98e, last bus=0
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Using IRQ router PIIX [8086/7110] at 00:07.0
PCI: Found IRQ 9 for device 00:08.0
PCI: Sharing IRQ 9 with 00:07.2
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
PnPBIOS: Found PnP BIOS installation structure at 0xc00f8120.
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xb25f, dseg 0x400.
PnPBIOS: 14 nodes reported by PnP BIOS; 14 recorded by driver.
PnPBIOS: PNP0c02: 0xfff80000-0xffffffff was already reserved

		    ^^^^^^^^^^^^^^^^^^^^^

Looks wrong for me, we are trying to reserve _memory_ range with request_region(). Patch attached.

Quoted 13 lines

PnPBIOS: PNP0c02: 0xfff7f600-0xfff7ffff was already reserved
PnPBIOS: PNP0c02: 0x398-0x399 has been reserved
PnPBIOS: PNP0c02: 0x4d0-0x4d1 has been reserved
PnPBIOS: PNP0c02: 0x8000-0x804f was already reserved
PnPBIOS: PNP0c02: 0x1040-0x104f has been reserved
PnPBIOS: PNP0c01: 0xe8000-0xfffff was already reserved
PnPBIOS: PNP0c01: 0x100000-0x70ffbff was already reserved
PnPBIOS: PNP0c02: 0xdc000-0xdffff was already reserved
PnPBIOS: PNP0c02: 0xd1000-0xd3fff was already reserved Linux NET4.0 for Linux 2.4
...

Stelian.

Signature · 2 lines
Andrey Panin            | Embedded systems software engineer
[email protected]        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
drivers/pnp/pnp_bios.c +5 -2
diff -ur linux.old/drivers/pnp/pnp_bios.c linux/drivers/pnp/pnp_bios.c
@@ -1052,8 +1052,8 @@
 	 * example do reserve stuff they know about too, so we may well
 	 * have double reservations.
 	 */
-	printk(
-		"PnPBIOS: %s: 0x%x-0x%x %s reserved\n",
+	printk( 
+		KERN_INFO "PnPBIOS: %s: 0x%x-0x%x %s reserved\n",
 		pnpid, start, end,
 		NULL != res ? "has been" : "was already"
 	);
@@ -1069,6 +1069,9 @@
 		if ( dev->resource[i].flags & IORESOURCE_UNSET )
 			/* resource record not used */
 			break;
+		if (!(dev->resource[i].flags & IORESOURCE_IO))
+			/* memory resource */
+			continue;
 		if ( dev->resource[i].start == 0 )
 			/* resource disabled */
 			continue;
#4 lore raw
Quoted 3 lines
		    ^^^^^^^^^^^^^^^^^^^^^

Looks wrong for me, we are trying to reserve _memory_ range with request_re= gion().

We should be creating memory and I/O regions as unused but exist rather than requesting them as owned. We do want to reserve memory regions as present but unused to void assigning PCI devices over them

#5 lore raw
Quoted 7 lines · Alan Cox
Quoted 2 lines · Andrey Panin

Looks wrong for me, we are trying to reserve _memory_ range with request_re= gion().

We should be creating memory and I/O regions as unused but exist rather than requesting them as owned. We do want to reserve memory regions as present but unused to void assigning PCI devices over them

Yes, we should.

The patch I submitted does not address that issue. It addresses the issue of runtime devlist updating (plus the other small things mentioned in my changelog), which is a big enough deal on its own. Here's the changelog again for your reference:

1) Fix bugs in resource reservation:
- end of reserved range off by +1
- didn't reserve _all_ system board resources
2) Change code so that set_dev_node updates the devlist, so drivers loaded after a setpnp will get up-to-date resource information. Because I haven't protected devlist update code with locks, this feature isn't SMP safe yet.
3) Miscellaneous code cleanups. Use "pnpbios" more consistently. Improve printk output. Etc.

Alan: I think the patch can go in as-is, since the much-appreciated beta testers report no calamities. :) I append it here: it applies correctly to 2.4.12-ac2 with one hunk offset by two lines.

As noted in (2), however, the patched driver allows updating of the devlist even though it doesn't use any locks; so I conclude that the code isn't SMP safe as it is. My secret wish is that someone else will submit a patch for this, because I'm aware that my understanding of SMP issues isn't really adequate.

The "flag as present but unused" issue can be addressed in a future patch. Once again, if someone wants to submit that patch they're very welcome to do so. Otherwise it'll have to wait for me to figure out exactly what Alan means. ;)

--
Thomas

The patch again:

init/main.c +1 -1
@@ -824,7 +824,7 @@
 	isapnp_init();
 #endif
 #ifdef CONFIG_PNPBIOS
-        pnp_bios_init();
+        pnpbios_init();
 #endif
 
 #ifdef CONFIG_TC
include/linux/pnp_bios.h +30 -30

91 lines not on this page · raw message

drivers/pnp/pnp_bios.c +273 -198

829 lines not on this page · raw message

drivers/pnp/pnp_proc.c +19 -19
@@ -31,10 +31,10 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
 	for (i=0,nodenum=0;i<0xff && nodenum!=0xff; i++) {
-		if ( pnp_bios_get_dev_node(&nodenum, 1, node) )
+		if ( pnpbios_get_dev_node(&nodenum, 1, node) )
 			break;
 		p += sprintf(p, "%02x\t%08x\t%02x:%02x:%02x\t%04x\n",
 			     node->handle, node->eisa_id,
@@ -57,9 +57,9 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	len = node->size - sizeof(struct pnp_bios_node);
 	memcpy(buf, node->data, len);
@@ -74,22 +74,25 @@
 	int boot = (long)data >> 8;
 	u8 nodenum = (long)data;
 
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	if (count != node->size - sizeof(struct pnp_bios_node))
 		return -EINVAL;
 	memcpy(node->data, buf, count);
-	if (pnp_bios_set_dev_node(node->handle, boot, node) != 0)
+	if (pnpbios_set_dev_node(node->handle, boot, node) != 0)
 	    return -EINVAL;
 	kfree(node);
 	return count;
 }
 
-static int pnp_proc_dont_use_current_config;
-
-void pnp_proc_init( int dont_use_current )
+/*
+ * When this is called, pnpbios functions are assumed to
+ * work and the pnpbios_dont_use_current_config flag
+ * should already have been set to the appropriate value
+ */
+void pnpbios_proc_init( void )
 {
 	struct pnp_bios_node *node;
 	struct proc_dir_entry *ent;
@@ -97,10 +100,7 @@
 	int i;
 	u8 nodenum;
 
-	pnp_proc_dont_use_current_config = dont_use_current;
-
-	if (!pnp_bios_present()) return;
-	if (pnp_bios_dev_node_info(&node_info) != 0) return;
+	if (pnpbios_dev_node_info(&node_info) != 0) return;
 	
 	proc_pnp = proc_mkdir("pnp", proc_bus);
 	if (!proc_pnp) return;
@@ -108,13 +108,13 @@
 	if (!proc_pnp_boot) return;
 	create_proc_read_entry("devices", 0, proc_pnp, proc_read_devices, NULL);
 	
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return;
 	for (i=0,nodenum = 0; i<0xff && nodenum != 0xff; i++) {
-		if (pnp_bios_get_dev_node(&nodenum, 1, node) != 0)
+		if (pnpbios_get_dev_node(&nodenum, 1, node) != 0)
 			break;
 		sprintf(name, "%02x", node->handle);
-		if ( !pnp_proc_dont_use_current_config ) {
+		if ( !pnpbios_dont_use_current_config ) {
 			ent = create_proc_entry(name, 0, proc_pnp);
 			if (ent) {
 				ent->read_proc = proc_read_node;
@@ -132,7 +132,7 @@
 	kfree(node);
 }
 
-void pnp_proc_done(void)
+void pnpbios_proc_done(void)
 {
 	int i;
 	char name[3];
@@ -141,7 +141,7 @@
 
 	for (i=0; i<0xff; i++) {
 		sprintf(name, "%02x", i);
-		if ( !pnp_proc_dont_use_current_config )
+		if ( !pnpbios_dont_use_current_config )
 			remove_proc_entry(name, proc_pnp);
 		remove_proc_entry(name, proc_pnp_boot);
 	}
#6 lore raw

PATCH 1/1 PnP BIOS patch against 2.4.12-ac2

In reply to Alan Cox

Here's an updated patch, now against 2.4.12-ac2.

In addition to:
1) Fix bugs in resource reservation:
- end of reserved range off by +1
- didn't reserve _all_ system board resources
2) Change code so that set_dev_node updates the devlist, so drivers loaded after a setpnp will get up-to-date resource information. Because I haven't protected devlist update code with locks, this feature isn't SMP safe yet.
3) Miscellaneous code cleanups. Use "pnpbios" more consistently. Improve printk output. Etc.
plus (I forget to mention):
4) Don't EXPORT_SYMBOL lowlevel PnP BIOS access functions since they aren't used by anything except the proc routines which don't need them to be EXPORT_SYMBOL to link to them.

this patch adds:
5) Declare announce_device in header (since it is EXPORT_SYMBOL in pnp_bios.c, presumably for a reason).

--
Thomas

The patch:

init/main.c +1 -1
@@ -822,7 +822,7 @@
 	isapnp_init();
 #endif
 #ifdef CONFIG_PNPBIOS
-        pnp_bios_init();
+        pnpbios_init();
 #endif
 
 #ifdef CONFIG_TC
include/linux/pnp_bios.h +34 -27

93 lines not on this page · raw message

drivers/pnp/pnp_bios.c +274 -200

838 lines not on this page · raw message

drivers/pnp/pnp_proc.c +19 -19
@@ -31,10 +31,10 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
 	for (i=0,nodenum=0;i<0xff && nodenum!=0xff; i++) {
-		if ( pnp_bios_get_dev_node(&nodenum, 1, node) )
+		if ( pnpbios_get_dev_node(&nodenum, 1, node) )
 			break;
 		p += sprintf(p, "%02x\t%08x\t%02x:%02x:%02x\t%04x\n",
 			     node->handle, node->eisa_id,
@@ -57,9 +57,9 @@
 	    *eof = 1;
 	    return 0;
 	}
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	len = node->size - sizeof(struct pnp_bios_node);
 	memcpy(buf, node->data, len);
@@ -74,22 +74,25 @@
 	int boot = (long)data >> 8;
 	u8 nodenum = (long)data;
 
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return -ENOMEM;
-	if ( pnp_bios_get_dev_node(&nodenum, boot, node) )
+	if ( pnpbios_get_dev_node(&nodenum, boot, node) )
 		return -EIO;
 	if (count != node->size - sizeof(struct pnp_bios_node))
 		return -EINVAL;
 	memcpy(node->data, buf, count);
-	if (pnp_bios_set_dev_node(node->handle, boot, node) != 0)
+	if (pnpbios_set_dev_node(node->handle, boot, node) != 0)
 	    return -EINVAL;
 	kfree(node);
 	return count;
 }
 
-static int pnp_proc_dont_use_current_config;
-
-void pnp_proc_init( int dont_use_current )
+/*
+ * When this is called, pnpbios functions are assumed to
+ * work and the pnpbios_dont_use_current_config flag
+ * should already have been set to the appropriate value
+ */
+void pnpbios_proc_init( void )
 {
 	struct pnp_bios_node *node;
 	struct proc_dir_entry *ent;
@@ -97,10 +100,7 @@
 	int i;
 	u8 nodenum;
 
-	pnp_proc_dont_use_current_config = dont_use_current;
-
-	if (!pnp_bios_present()) return;
-	if (pnp_bios_dev_node_info(&node_info) != 0) return;
+	if (pnpbios_dev_node_info(&node_info) != 0) return;
 	
 	proc_pnp = proc_mkdir("pnp", proc_bus);
 	if (!proc_pnp) return;
@@ -108,13 +108,13 @@
 	if (!proc_pnp_boot) return;
 	create_proc_read_entry("devices", 0, proc_pnp, proc_read_devices, NULL);
 	
-	node = kmalloc(node_info.max_node_size, GFP_KERNEL);
+	node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL);
 	if (!node) return;
 	for (i=0,nodenum = 0; i<0xff && nodenum != 0xff; i++) {
-		if (pnp_bios_get_dev_node(&nodenum, 1, node) != 0)
+		if (pnpbios_get_dev_node(&nodenum, 1, node) != 0)
 			break;
 		sprintf(name, "%02x", node->handle);
-		if ( !pnp_proc_dont_use_current_config ) {
+		if ( !pnpbios_dont_use_current_config ) {
 			ent = create_proc_entry(name, 0, proc_pnp);
 			if (ent) {
 				ent->read_proc = proc_read_node;
@@ -132,7 +132,7 @@
 	kfree(node);
 }
 
-void pnp_proc_done(void)
+void pnpbios_proc_done(void)
 {
 	int i;
 	char name[3];
@@ -141,7 +141,7 @@
 
 	for (i=0; i<0xff; i++) {
 		sprintf(name, "%02x", i);
-		if ( !pnp_proc_dont_use_current_config )
+		if ( !pnpbios_dont_use_current_config )
 			remove_proc_entry(name, proc_pnp);
 		remove_proc_entry(name, proc_pnp_boot);
 	}
#7 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

In reply to Alan Cox

Hi,

I tested the updated patch against 2.4.12-ac2 on a Sony Vaio PCG-FX205K.

You can see in the appendix output, no oops.

But, one Problem:
If I attach an USB device to the laptop it will not initialize and I get the kernel messages, you will find in the last 10 lines of the output.
Amazing: If I cause permament traffic with a working device on IRQ 9 (e.g. a ping via eth0), the USB device will be recognized and works, even though muuuuch slower.

Ideas ?

Bye,

Signature · 184 lines
J. Ziuber
[email protected]



APPENDIX:
---------
/var/log/boot.msg

...
<4>Local APIC disabled by BIOS -- reenabling.
<4>Found and enabled local APIC!
...
<6>Sony Vaio laptop detected.
<4>PCI: PCI BIOS revision 2.10 entry at 0xfd9b0, last bus=1
<4>PCI: Using configuration type 1
<4>PCI: Probing PCI hardware
<3>Unknown bridge resource 2: assuming transparent
<6>PCI: Using IRQ router PIIX [8086/244c] at 00:1f.0
<6>PnPBIOS: Found PnP BIOS installation structure at 0xc00f71a0.
<6>PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0x8f27, dseg 0x400.
<6>PnPBIOS: 20 nodes reported by PnP BIOS; 20 recorded by driver.
<4>PnPBIOS: PNP0c01: 0xe0000-0xfffff was already reserved
<4>PnPBIOS: PNP0c01: 0x100000-0xfbfffff was already reserved
<4>PnPBIOS: PNP0c02: 0x4d0-0x4d1 has been reserved
<4>PnPBIOS: PNP0c02: 0x1000-0x105f has been reserved
<4>PnPBIOS: PNP0c02: 0x1060-0x107f has been reserved
<4>PnPBIOS: PNP0c02: 0x1180-0x11bf has been reserved
<4>PnPBIOS: PNP0c02: 0xdc000-0xdffff was already reserved
<4>PnPBIOS: PNP0c02: 0xd8000-0xdbfff was already reserved
...
<6>PCI: Found IRQ 9 for device 00:1f.6
<6>PCI: Sharing IRQ 9 with 00:1f.3
<6>PCI: Sharing IRQ 9 with 00:1f.5
...

/proc/interrupts:

           CPU0       
  0:      44393          XT-PIC  timer
  1:       3023          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  9:          9          XT-PIC  eth0, usb-uhci, usb-uhci
 12:          0          XT-PIC  PS/2 Mouse
 14:       3185          XT-PIC  ide0
 15:          1          XT-PIC  ide1
NMI:          0 
LOC:      44350 
ERR:          0
MIS:          0


/var/log/messages:

Oct 16 09:18:58 shep syslogd 1.3-3: restart.
Oct 16 09:19:00 shep usbmgr[278]: start 0.4.6
Oct 16 09:19:00 shep usbmgr[280]: "usb-uhci" was loaded
Oct 16 09:19:00 shep usbmgr[295]: mount /proc/bus/usb
Oct 16 09:19:00 shep usbmgr[280]: class:0x9 subclass:0x0 protocol:0x0
Oct 16 09:19:01 shep usbmgr[280]: USB device is matched the
configuration
Oct 16 09:19:01 shep usbmgr[280]: "none" isn't loaded
Oct 16 09:19:01 shep rpc.statd[338]: Version 0.3.1 Starting
Oct 16 09:19:01 shep kernel: klogd 1.3-3, log source = /proc/kmsg
started.
Oct 16 09:19:01 shep kernel: Inspecting /boot/System.map
Oct 16 09:19:01 shep kernel: Symbol table has incorrect version number. 
Oct 16 09:19:01 shep kernel: Inspecting /System.map
Oct 16 09:19:01 shep kernel: Loaded 13123 symbols from /System.map.
Oct 16 09:19:01 shep kernel: Symbols match kernel version 2.4.12.
Oct 16 09:19:01 shep kernel: Loaded 423 symbols from 7 modules.
Oct 16 09:19:01 shep kernel: eepro100.c:v1.09j-t 9/29/99 Donald Becker
http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html
Oct 16 09:19:01 shep kernel: eepro100.c: $Revision: 1.36 $ 2000/11/17
Modified by Andrey V. Savochkin <[email protected]> and others
Oct 16 09:19:01 shep kernel: PCI: Found IRQ 9 for device 01:08.0
Oct 16 09:19:01 shep kernel: eth0: Intel Corporation 82820 (ICH2)
Chipset Ethernet Controller, 08:00:46:2B:FE:50, IRQ 9.
Oct 16 09:19:01 shep kernel:   Board assembly 000000-000, Physical
connectors present: RJ45
Oct 16 09:19:01 shep kernel:   Primary interface chip i82555 PHY #1.
Oct 16 09:19:01 shep kernel:   General self-test: passed.
Oct 16 09:19:01 shep kernel:   Serial sub-system self-test: passed.
Oct 16 09:19:01 shep kernel:   Internal registers self-test: passed.
Oct 16 09:19:01 shep kernel:   ROM checksum self-test: passed
(0x04f4518b).
Oct 16 09:19:01 shep kernel: IPv6 v0.8 for NET4.0
Oct 16 09:19:01 shep kernel: IPv6 over IPv4 tunneling driver
Oct 16 09:19:01 shep kernel: usb.c: registered new driver usbdevfs
Oct 16 09:19:01 shep kernel: usb.c: registered new driver hub
Oct 16 09:19:01 shep kernel: usb-uhci.c: $Revision: 1.268 $ time
09:11:00 Oct 16 2001
Oct 16 09:19:01 shep kernel: usb-uhci.c: High bandwidth mode enabled
Oct 16 09:19:01 shep kernel: PCI: Found IRQ 10 for device 00:1f.2
Oct 16 09:19:01 shep kernel: IRQ routing conflict for 00:1f.2, have irq
9, want irq 10
Oct 16 09:19:01 shep kernel: PCI: Setting latency timer of device
00:1f.2 to 64
Oct 16 09:19:01 shep kernel: usb-uhci.c: USB UHCI at I/O 0x1820, IRQ 9
Oct 16 09:19:01 shep kernel: usb-uhci.c: Detected 2 ports
Oct 16 09:19:01 shep kernel: usb.c: new USB bus registered, assigned bus
number 1
Oct 16 09:19:01 shep kernel: usb.c: kmalloc IF cf7aeb40, numif 1
Oct 16 09:19:01 shep kernel: usb.c: new device strings: Mfr=0,
Product=2, SerialNumber=1
Oct 16 09:19:01 shep kernel: usb.c: USB device number 1 default language
ID 0x0
Oct 16 09:19:01 shep kernel: Product: USB UHCI Root Hub
Oct 16 09:19:01 shep kernel: SerialNumber: 1820
Oct 16 09:19:01 shep kernel: hub.c: USB hub found
Oct 16 09:19:01 shep kernel: hub.c: 2 ports detected
Oct 16 09:19:01 shep kernel: hub.c: standalone hub
Oct 16 09:19:01 shep kernel: hub.c: ganged power switching
Oct 16 09:19:01 shep kernel: hub.c: global over-current protection
Oct 16 09:19:01 shep kernel: hub.c: Port indicators are not supported
Oct 16 09:19:01 shep kernel: hub.c: power on to power good time: 2ms
Oct 16 09:19:01 shep kernel: hub.c: hub controller current requirement:
0mA
Oct 16 09:19:01 shep kernel: hub.c: port removable status: RR
Oct 16 09:19:01 shep kernel: hub.c: local power source is good
Oct 16 09:19:01 shep kernel: hub.c: no over-current condition exists
Oct 16 09:19:01 shep kernel: hub.c: enabling power on all ports
Oct 16 09:19:01 shep kernel: usb.c: hub driver claimed interface
cf7aeb40
Oct 16 09:19:01 shep kernel: usb.c: kusbd: /sbin/hotplug add 1
Oct 16 09:19:01 shep kernel: usb.c: kusbd policy returned 0xfffffffe
Oct 16 09:19:01 shep kernel: PCI: Found IRQ 9 for device 00:1f.4
Oct 16 09:19:01 shep kernel: PCI: Setting latency timer of device
00:1f.4 to 64
Oct 16 09:19:01 shep kernel: usb-uhci.c: USB UHCI at I/O 0x2400, IRQ 9
Oct 16 09:19:01 shep kernel: usb-uhci.c: Detected 2 ports
Oct 16 09:19:01 shep kernel: usb.c: new USB bus registered, assigned bus
number 2
Oct 16 09:19:01 shep kernel: usb.c: kmalloc IF cf7aec60, numif 1
Oct 16 09:19:01 shep kernel: usb.c: new device strings: Mfr=0,
Product=2, SerialNumber=1
Oct 16 09:19:01 shep kernel: usb.c: USB device number 1 default language
ID 0x0
Oct 16 09:19:01 shep kernel: Product: USB UHCI Root Hub
Oct 16 09:19:01 shep kernel: SerialNumber: 2400
Oct 16 09:19:01 shep kernel: hub.c: USB hub found
Oct 16 09:19:01 shep kernel: hub.c: 2 ports detected
Oct 16 09:19:01 shep kernel: hub.c: standalone hub
Oct 16 09:19:01 shep kernel: hub.c: ganged power switching
Oct 16 09:19:01 shep kernel: hub.c: global over-current protection
Oct 16 09:19:01 shep kernel: hub.c: Port indicators are not supported
Oct 16 09:19:01 shep kernel: hub.c: power on to power good time: 2ms
Oct 16 09:19:01 shep kernel: hub.c: hub controller current requirement:
0mA
Oct 16 09:19:01 shep kernel: hub.c: port removable status: RR
Oct 16 09:19:01 shep kernel: hub.c: local power source is good
Oct 16 09:19:01 shep kernel: hub.c: no over-current condition exists
Oct 16 09:19:01 shep kernel: hub.c: enabling power on all ports
Oct 16 09:19:01 shep kernel: usb.c: hub driver claimed interface
cf7aec60
Oct 16 09:19:01 shep kernel: usb.c: kusbd: /sbin/hotplug add 1
Oct 16 09:19:01 shep kernel: usb.c: kusbd policy returned 0xfffffffe
Oct 16 09:19:01 shep kernel: usb-uhci.c: v1.268:USB Universal Host
Controller Interface driver
Oct 16 09:19:01 shep kernel: Installing knfsd (copyright (C) 1996
[email protected]).
Oct 16 09:19:02 shep /usr/sbin/cron[403]: (CRON) STARTUP (fork ok) 
Oct 16 09:19:03 shep /sbin/SuSEpersonal-firewall: SuSEpersonal-firewall:
Loading of module ipchains was not successful.
Oct 16 09:19:03 shep /sbin/SuSEpersonal-firewall: Aborting. No action
taken.
Oct 16 09:19:09 shep kernel: eth0: no IPv6 routers present
Oct 16 09:20:24 shep kernel: hub.c: port 2 connection change
Oct 16 09:20:24 shep kernel: hub.c: port 2, portstatus 101, change 1, 12
Mb/s
Oct 16 09:20:24 shep kernel: hub.c: port 2, portstatus 103, change 0, 12
Mb/s
Oct 16 09:20:24 shep kernel: hub.c: USB new device connect on bus1/2,
assigned device number 2
Oct 16 09:20:27 shep kernel: usb_control/bulk_msg: timeout
Oct 16 09:20:27 shep kernel: usb.c: USB device not accepting new
address=2 (error=-110)
Oct 16 09:20:27 shep kernel: hub.c: port 2, portstatus 103, change 0, 12
Mb/s
Oct 16 09:20:27 shep kernel: hub.c: USB new device connect on bus1/2,
assigned device number 3
Oct 16 09:20:30 shep kernel: usb_control/bulk_msg: timeout
Oct 16 09:20:30 shep kernel: usb.c: USB device not accepting new
address=3 (error=-110)
#8 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

Quoted 9 lines · Jörg Ziuber

I tested the updated patch against 2.4.12-ac2 on a Sony Vaio PCG-FX205K. You can see in the appendix output, no oops.

But, one Problem:
If I attach an USB device to the laptop it will not initialize and I get the kernel messages, you will find in the last 10 lines of the output.
Amazing: If I cause permament traffic with a working device on IRQ 9 (e.g. a ping via eth0), the USB device will be recognized and works, even though muuuuch slower.

Is this problem related to the PnP BIOS patch? That is, do you have the same problem with a kernel that lacks the patch?

#9 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

In reply to Alan Cox
Quoted 12 lines · Thomas Hood
Quoted 9 lines · Jörg Ziuber

I tested the updated patch against 2.4.12-ac2 on a Sony Vaio PCG-FX205K. You can see in the appendix output, no oops.

But, one Problem:
If I attach an USB device to the laptop it will not initialize and I get the kernel messages, you will find in the last 10 lines of the output.
Amazing: If I cause permament traffic with a working device on IRQ 9 (e.g. a ping via eth0), the USB device will be recognized and works, even though muuuuch slower.

Quoted 3 lines

Is this problem related to the PnP BIOS patch? That is, do you have the same problem with a kernel that lacks the patch?

Maybe it is related.
This is at least a Sony Vaio problem, because attaching the same USB device to other PCs with the same (kernel)installation works without problems.
It was checked to be USB-device-independent with the Vaio (same problem with any device).
Because USB even works on the Vaio under Windows, the USB developers (uhci) told me to look in linux-kernel for the PCI/IRQ programmers due to a potentially broken BIOS ("IRQ routing problem")- that's where I am now (?).

A kernel without the patch results in the same non-recognition (non-USB-number-assignment) of the USB device, but when booting I get errors concerning a multiple reservation of IRQ9. With the patch there are no errors of that kind (see last mail). And the "feature", that USB works when the shared interrupt is busy (same effect with unpatched kernel), makes me feel that there is a IRQ problem, specific to Sony Vaio. So, the PnP-BIOS-patch is my hope because it cares about Sony Vaio (BIOS/IRQ?) specials.

Very hopefully,

Signature · 2 lines
J. Ziuber
[email protected]
#10 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

Quoted 16 lines · Jörg Ziuber
Quoted 3 lines · Thomas Hood

Is this problem related to the PnP BIOS patch? That is, do you have the same problem with a kernel that lacks the patch?

Maybe it is related.
This is at least a Sony Vaio problem, because attaching the same USB device to other PCs with the same (kernel)installation works without problems.
It was checked to be USB-device-independent with the Vaio (same problem with any device).
Because USB even works on the Vaio under Windows, the USB developers (uhci) told me to look in linux-kernel for the PCI/IRQ programmers due to a potentially broken BIOS ("IRQ routing problem")- that's where I am now (?).

Quoted 4 lines

A kernel without the patch results in the same non-recognition (non-USB-number-assignment) of the USB device, but when booting I get errors concerning a multiple reservation of IRQ9. With the patch there are no errors of that kind (see last mail).

That puzzles me. I'm not sure how my patch could affect IRQ handling. Could you please try the version of the patch that I submitted last night under the title "[PATCH] PnP BIOS -- new"? Let me know whether you do or you do not get the error messages concerning multiple reservations of IRQ9.

Quoted 5 lines

And the "feature", that USB
works when the shared interrupt is busy (same effect with unpatched kernel), makes me feel that there is a IRQ problem, specific to Sony Vaio. So, the PnP-BIOS-patch is my hope because it cares about Sony Vaio (BIOS/IRQ?) specials.

I wouldn't hope too strongly that my patch will help you.

Just to be clear. IIUC you are saying that my patch isn't the cause of your problem; it's just that it doesn't solve your problem. Is that right?

--
Thomas

#11 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

In reply to Alan Cox
Quoted 3 lines · Thomas Hood

Just to be clear. IIUC you are saying that my patch isn't the cause of your problem; it's just that it doesn't solve your problem. Is that right?

Exactly.
As I understand you, it's not made to solve my problem - but, who else can help me ?

The "IRQ error" output with/without your last patch is to come later.

Bye,

Signature · 4 lines
Jörg Ziuber			Institut für Chemische Technik
				Universität Karlsruhe
[email protected]	Kaiserstrasse 12
Tel. 0721 / 608-2399		76128 Karlsruhe
#12 lore raw

Re: [PATCH] PnP BIOS patch against 2.4.12-ac2

Quoted 6 lines · Jörg Ziuber
Quoted 3 lines · Thomas Hood

Just to be clear. IIUC you are saying that my patch isn't the cause of your problem; it's just that it doesn't solve your problem. Is that right?

Exactly.
As I understand you, it's not made to solve my problem

Correct.

#13 lore raw
In reply to Thomas Hood
Quoted 5 lines · Thomas Hood

Vaio users: Please make sure that this doesn't oops.
Others: Try using setpnp to change the current configuration. Unload and reload the parport drivers to check that they reinitialize with the updated resource information provided by the PnP BIOS driver.

Works here on the inspiron 5k. Parport detects its config correctly, even after multiple loads/unloads, lspnp and setpnp seem to be doing the right thing, parport detects the new parameters after changing them with setpnp.

Relevant dmesg output:

PnPBIOS: Found PnP BIOS installation structure at 0xc00f7230.
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xa610, dseg 0x400.
PnPBIOS: 17 nodes reported by PnP BIOS; 17 recorded by driver.
PnPBIOS: PNP0c02: 0xfff80000-0xffffffff was already reserved
PnPBIOS: PNP0c01: 0xe8000-0xfffff was already reserved
PnPBIOS: PNP0c01: 0x100000-0xbffffff was already reserved
PnPBIOS: PNP0c02: 0x4d0-0x4d1 has been reserved
PnPBIOS: PNP0c02: 0x1000-0x103f has been reserved
PnPBIOS: PNP0c02: 0x1040-0x104f has been reserved
SBF: ACPI BOOT descriptor is wrong length (39)
SBF: Simple Boot Flag extension found and enabled.
SBF: Setting boot flags 0x1
parport: PnP BIOS reports device PNPBIOS PNP0401 (node number 0x16) is configured to use io 0x0378, io 0x0778, irq 7, dma 3
[and then after 'setpnp 16 dma 1']
parport: PnP BIOS reports device PNPBIOS PNP0401 (node number 0x16) is configured to use io 0x0378, io 0x0778, irq 7, dma 1

Thanks,
Ion

Signature · 2 lines
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.
#14 lore raw
In reply to Thomas Hood

Thomas:
Just to let you know I still have the same problem with a resource conflict between the PnPBIOS code and the i2c/lm_sensors stuff at 1040 with this latest patch. Again, this is on a Intel Lancewood (L440GX) motherboard. I also have a system with a Intel STL2 motherboard (successor to the Lancewood) so I will test that under the same conditions later tonight.

modprobe i2c-piix4
/lib/modules/2.4.10-ac12/kernel/drivers/i2c/i2c-piix4.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.10-ac12/kernel/drivers/i2c/i2c-piix4.o: insmod /lib/modules/2.4.10-ac12/kernel/drivers/i2c/i2c-piix4.o failed /lib/modules/2.4.10-ac12/kernel/drivers/i2c/i2c-piix4.o: insmod i2c-piix4 failed

dmesg

.
.
.
i2c-piix4.o version 2.6.1 (20010830) i2c-piix4.o: Found PIIX4 device
i2c-piix4.o: SMB region 0x1040 already in use! i2c-piix4.o: Device not detected, module not inserted.

cat /proc/ioports
.
.
.
0c00-0c3f : Intel Corporation 82371AB PIIX4 ACPI
0c00-0c3f : PnPBIOS PNP0c02
0ca0-0ca3 : PnPBIOS PNP0c02
0cb8-0cbf : PnPBIOS PNP0c02
0cf8-0cff : PCI conf1
1000-103f : PnPBIOS PNP0c02
1040-105f : Intel Corporation 82371AB PIIX4 ACPI
1040-104f : PnPBIOS PNP0c02
.
.
.

Signature · 5 lines
Steven A. DuChene	[email protected]
			[email protected]
			[email protected]

	http://www.mindspring.com/~sduchene/