Re: Flaw in the driver-model implementation of attributes

Kevin P. Fleming (kpfleming@cox.net)
Tue, 17 Jun 2003 18:38:12 -0700


Alan Stern wrote:

> For example, on my system the master device on the first PCI IDE channel
> is a hard disk, hda in fact. This means that
> /sys/devices/pci0/0000:00:07.1/ide0/0.0/ and /sys/block/hda/ refer to the
> same physical device. One is created by the IDE bus driver, the other by
> a block device driver. Granted, there are links from one to the other,
> but it still indicates that the organization of sysfs reflects the
> software organization of the kernel as much as the physical organization
> of the computer system.
>

PMJFI, and I'm not driver model expert, but I can think I can answer
this one. Yes, you are correct, these two sysfs directories are
associated with the same physical devices. However, they are definitely
two different things.

The first is an IDE device. It has attributes common to IDE devices,
like DMA/PIO mode, cable type, bus speed, etc.

The second is a block device. A _generic_ block device. It has
attributes like length, dev (its device number), I/O scheduler settings,
etc.

These are two wildly differing views, but yes, they are the same device.
These differing attributes do _not_ belong in the same directory. An
application looking at your IDE devices does not really care how the
block subsystem perceives those devices (i.e. hdparm). Conversely, an
application looking at your block devices should not care about what
underlying physical devices (if any :-) they are associated with.

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