lkml.org 
[lkml]   [2003]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Flaw in the driver-model implementation of attributes
Alan Stern [stern@rowland.harvard.edu] wrote:
> Right now they don't. For example, I have a SCSI card in my system. It
> shows up as /sys/devices/pci0/0000:00:0d.0/ -- that's the PCI bus driver's
> view of the card. It also shows up as
> /sys/devices/pci0/0000:00:0d.0/host1/ -- that's the SCSI core's view of
> the same card. So there are two devices representing the same physical
> object, and neither of them is created by the aic7xxx driver.

Actually host1 is created by the aic7xxx driver through registration
with the SCSI subsystem. The aic7xxx allocates the structure, registers
it, unregisters it, and drops the ref on it when it is done with it.

The SCSI subsystems view of hosts that have registered with the subsystem
is through /class/scsi_host.

> To change the topic slightly, consider this small inconsistency in sysfs.
> The IDE bus driver creates entries for each IDE channel. So for example,
> /sys/devices/pci0/0000:00:07.1/ide0/0.0/ represents the master device on
> channel 0 whereas /sys/devices/pci0/0000:00:07.1/ide1/1.1 represents the
> slave device on channel 1. The SCSI bus driver, on the other hand, does
> not create intermediate levels in the hierarchy for channels or targets.
> So for example, /sys/devices/pci0/0000:00:0d.0/host1/1:0:5:0/ is the entry
> for host 1, channel 0, target 5, LUN 0. There's nothing in between the
> host level and the LUN level.
>

Currently the scsi device in the SCSI subsystem is LUN. While the
future may lead to having a having a target as a child of the host it
would be a large change for 2.5 / 2.6.

> Is that the sort of decision that's left up to the bus driver author?
> Should there be any sort of enforced consistency, or doesn't it matter?

Each transport / bus may have a unique nexus between a parent and child.
Interpretation of a name outside of the name space registering or
owning the name would lead to bad info (i.e. interpretation of these
two child nodes using the same policy "pci0/0000:00:07.1"
"host1/1:0:5:0/") Enforcing a overall consistency could lead to
creating pseudo hierarchies just to fit a consistency model.

-andmike
--
Michael Anderson
andmike@us.ibm.com

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

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.060 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site