Naming devices

From: Anton Blanchard (anton@samba.org)
Date: Sun May 18 2003 - 16:33:59 EST


Hi,

I just spent 2 hours trying to make a machine boot. It had one bad disk
and one bad network card. Normally not a problem, but this thing had 40
cards in it so identifying the problem ones was not straight forward.

I was wondering why we dont have a consistent way of printing a device
location? If all drivers used the same thing, eg:

struct pci_dev *foo;
...
printf("%s: could not enable card\n", PCI_LOCATION(foo));

Which by default would print pci bus/devfn and an arch could override eg
on ppc64 it would also print a location code:

U1.6-P1-I2/E1 (90:0c.0)

This sounds like the domain of the event logging guys but I havent seen
anything from them in a while. The nice thing about this is that when we
get pci domains nothing needs to be changed in the driver, we just
update the PCI_LOCATION macro.

Also the tendency of network drivers to print "eth0: foo" during
initialisation is even more of a problem. If you get a bad card then you
could end up reusing the eth0 name for a subsequent device, making
pinpointing the problem card difficult. On top of that some drivers use
dev->name between calling alloc_netdev() and register_netdev() so that
you end up with error messages like "eth%d: failed".

Anton
-
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/



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:31 EST