Skip to contentSkip to conversation

hp100 -- fixes for new probing.

PATCH Applied Cacophonix 3 participants 8 messages Feb 23, 2004 – Feb 27, 2004

Subsystems (2)
lore
Share & tools
lore

Cacophonix

author
#0 lore raw

(resending, copying netdev)

Hi,
Any idea if any of these patches may have broken hp100 when statically built into the kernel (i.e, not as a module)?

Upgrading from 2.6.0-test6 to 2.6.3-mm2 (which does include the latest patchsets for hp100 from Stephen), the kernel locks up at boot at the point where hp100 detection/initialization normally occurs (the driver is compiled into the kernel). However, changing hp100 to a module, and loading it dynamically works.

Any clues about which of the recent patches between 2.6.0-test6 and 2.6.3-mm2 might be causing the lockup? Thanks for any pointers.

cheers,
karthik

The /proc/pci data for my hp100 nic:
Bus 0, device 14, function 0:

    Ethernet controller: Hewlett-Packard Comp J2585B HP 10/100VG P (rev 0).
      IRQ 11.
      Master Capable.  Latency=248.  Min Gnt=8.Max Lat=32.
      I/O at 0xec00 [0xecff].
      Non-prefetchable 32 bit memory at 0xfffac000 [0xfffadfff].

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

#1 lore raw
Quoted 11 lines · On Mon, 23 Feb 2004 00:48:14 -0800 (PST) Cacophonix <[email protected]>…

(resending, copying netdev)

Hi,
Any idea if any of these patches may have broken hp100 when statically built into the kernel (i.e, not as a module)?

Upgrading from 2.6.0-test6 to 2.6.3-mm2 (which does include the latest patchsets for hp100 from Stephen), the kernel locks up at boot at the point where hp100 detection/initialization normally occurs (the driver is compiled into the kernel). However, changing hp100 to a module, and loading it dynamically works.

Quoted 5 lines

Any clues about which of the recent patches between 2.6.0-test6 and 2.6.3-mm2 might be causing the lockup? Thanks for any pointers.

cheers,
karthik

There probably is some bug introduced with the recent changes. The driver tries to handle isa, eisa, and pci all with the same infrastructure. There are two different probe paths, one for the module and one for the non-module ISA case. Could you add some printk's and see if the problem in the hp100_isa_probe code (happens first), or the PCI probe that happens from:

	hp100_module_init -> pci_module_init -> hp100_pci_probe...
author
#2 lore raw

Thanks for the suggestion.

It appears to be locking up at line 309 in hp100.c, i.e,

    hp100_page(ID_MAC_ADDR);
    (called from hp100_isa_probe1() and hp100_read_id() )

thanks,
karthik

Quoted 9 lines · --- Stephen Hemminger

There probably is some bug introduced with the recent changes. The driver tries to handle isa, eisa, and pci all with the same infrastructure. There are two different probe paths, one for the module and one for the non-module ISA case. Could you add some
printk's and see if the problem in the hp100_isa_probe code (happens first), or the PCI probe that happens from:

	hp100_module_init -> pci_module_init -> hp100_pci_probe...

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

#3 lore raw

Does fix the problem? it checks for card before proceeding in hp100_isa_probe

drivers/net/hp100.c +5 -0
diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c
@@ -333,6 +333,11 @@
 
 	if (!request_region(addr, HP100_REGION_SIZE, "hp100"))
 		goto err;
+	
+	if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) {
+		release_region(addr, HP100_REGION_SIZE);
+		goto err;
+	}
 
 	sig = hp100_read_id(addr);
 	release_region(addr, HP100_REGION_SIZE);
author
#4 lore raw

Yes, this fixes the lockup issue (once I renamed addr to ioaddr in hp100_isa_probe1() to get it to compile. Thanks for the patch!

Next order of business for me is to figure out why the ordering of device recognition of e100 and hp100 changed between 2.6.0-test* and 2.6.3-mm2 (in the former, hp100 started up first, while in the latter kernel e100 get's to load up first). I guess I could work around this in other ways, but it's a tad disconcerting when eth0, eth1 and eth2 decide to trade places every so often ;)

Thanks again for the patch.
cheers,
karthik

Quoted 7 lines · --- Stephen Hemminger

Does fix the problem? it checks for card before proceeding in hp100_isa_probe

diff -Nru a/drivers/net/hp100.c b/drivers/net/hp100.c

drivers/net/hp100.c +0 -0
@@ -333,6 +333,11 @@
 

drivers/net/hp100.c line 343

Quoted 10 lines
drivers/net/hp100.c +5 -0
 	if (!request_region(addr, HP100_REGION_SIZE, "hp100"))
 		goto err;
+	
+	if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) {
+		release_region(addr, HP100_REGION_SIZE);
+		goto err;
+	}
 
 	sig = hp100_read_id(addr);
 	release_region(addr, HP100_REGION_SIZE);

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

#5 lore raw
Quoted 10 lines · On Wed, 25 Feb 2004 13:33:47 -0800 (PST) Cacophonix <[email protected]>…

Yes, this fixes the lockup issue (once I renamed addr to ioaddr in hp100_isa_probe1() to get it to compile. Thanks for the patch!

Next order of business for me is to figure out why the ordering of device recognition of e100 and hp100 changed between 2.6.0-test* and 2.6.3-mm2 (in the former, hp100 started up first, while in the latter kernel e100 get's to load up first). I guess I could work around this in other ways, but it's a tad disconcerting when eth0, eth1 and eth2 decide to trade places every so often ;)

The naming is a function of initialization order which used to be fixed by a long list of legacy devices. Since the hp100 pci now probes like a proper PCI device, it will happen in a order defined by the load order (ie not well controlled).

Learn to use nameif it will make your life simpler.

#6 lore raw

PATCH 1/1 hp100 -- isa probe fix

In reply to Cacophonix

Jeff, here is a cleaned up version of the 2.6.3 hp100 isa (non-modular) probing. It needs to check for the board being present before reading the signature.

drivers/net/hp100.c +10 -5
@@ -326,16 +326,21 @@ static __init const char *hp100_read_id(
 	return str;
 }
 
-static __init int hp100_isa_probe1(struct net_device *dev, int addr)
+static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
 {
 	const char *sig;
 	int i;
 
-	if (!request_region(addr, HP100_REGION_SIZE, "hp100"))
+	if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100"))
 		goto err;
 
-	sig = hp100_read_id(addr);
-	release_region(addr, HP100_REGION_SIZE);
+	if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) {
+		release_region(ioaddr, HP100_REGION_SIZE);
+		goto err;
+	}
+
+	sig = hp100_read_id(ioaddr);
+	release_region(ioaddr, HP100_REGION_SIZE);
 
 	if (sig == NULL)
 		goto err;
@@ -347,7 +352,7 @@ static __init int hp100_isa_probe1(struc
 	}
 
 	if (i < ARRAY_SIZE(hp100_isa_tbl))
-		return hp100_probe1(dev, addr, HP100_BUS_ISA, NULL);
+		return hp100_probe1(dev, ioaddr, HP100_BUS_ISA, NULL);
  err:
 	return -ENODEV;