Re: device/kobject naming

From: Hollis Blanchard
Date: Wed Feb 25 2004 - 10:47:58 EST


On Feb 25, 2004, at 5:34 AM, Benjamin Herrenschmidt wrote:
On Wed, 2004-02-25 at 15:22, Greg KH wrote:
I agree. Is there any reason we _have_ to stick with the OF names? It
seems to me to make more sense here not to, to make it more like the
rest of the kernel.

That is, if the address after the @ is unique. Is that always the case?

One thing though is that it's only unique at a given level of
hierarchy. The Unit Address in OF has no meaning outside of the
context of the parent bus. That may be just fine for sysfs, but
if I take as an example the PCI devices, they do have a globally
unique ID here with the domain number.

Yes, that's certainly the case. Every unit address on the virtual bus will be unique, but device_add() uses dev.bus_id as the kobject name, which is system-wide.

Apparently PCI gets away with multiple busses by encoding the domain and bus IDs into dev.bus_id along with the slot number. Even then, it's just kind of coincidence that nothing else wants to register kobjects with names like 0000:00:0b.0, right? Unless we want to start defining mandatory "domains" for every type of device and prefixing things like that...

At any rate, virtual IO devices effectively have just a slot number and nothing else. Do you really want to start registering kobjects with names like "30000000"? Or what about "vio:30000000", and then have it show up as "/sys/devices/vio/vio:30000000"? Seems redundant to me.

--
Hollis Blanchard
IBM Linux Technology Center

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