public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	viro@parcelfarce.linux.theplanet.co.uk, "Perez-Gonzalez,
	Inaky" <inaky.perez-gonzalez@intel.com>,
	"'Kevin P. Fleming'" <kpfleming@cox.net>,
	"'Patrick Mochel'" <mochel@osdl.org>,
	"'Russell King'" <rmk@arm.linux.org.uk>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Flaw in the driver-model implementation of attributes
Date: Thu, 19 Jun 2003 10:26:42 -0700	[thread overview]
Message-ID: <20030619172641.GA1172@beaverton.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0306190949200.998-100000@ida.rowland.org>

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


  parent reply	other threads:[~2003-06-19 17:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-18  7:48 Flaw in the driver-model implementation of attributes Perez-Gonzalez, Inaky
2003-06-18  8:12 ` viro
2003-06-18 14:32   ` Alan Stern
2003-06-18 17:15     ` Greg KH
2003-06-18 19:50       ` Alan Stern
2003-06-19 16:42         ` Patrick Mochel
2003-06-19 21:18           ` Alan Stern
2003-06-19 14:13       ` Alan Stern
2003-06-19 17:07         ` Patrick Mochel
2003-06-19 21:14           ` Alan Stern
2003-06-19 21:31             ` Greg KH
2003-06-20 14:22               ` Alan Stern
2003-06-20 18:32                 ` Greg KH
2003-07-02 22:12                   ` Greg KH
2003-07-03 14:51                     ` Alan Stern
2003-06-19 17:26         ` Mike Anderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-19 21:18 Perez-Gonzalez, Inaky
2003-06-19  0:06 Clayton Weaver
2003-06-19  0:20 ` Kevin P. Fleming
2003-06-19 16:46   ` Patrick Mochel
2003-06-18 19:52 Perez-Gonzalez, Inaky
2003-06-18  3:44 Perez-Gonzalez, Inaky
2003-06-18  4:18 ` viro
     [not found] <20030616194446.H13312@flint.arm.linux.org.uk>
2003-06-16 19:36 ` Alan Stern
2003-06-16 20:49   ` Patrick Mochel
2003-06-16 21:29     ` Alan Stern
2003-06-16 22:43       ` Patrick Mochel
2003-06-17 19:49         ` Alan Stern
2003-06-18  1:38           ` Kevin P. Fleming
2003-06-16 23:36       ` Greg KH
2003-06-17 17:29         ` Alan Stern
2003-06-17 17:33           ` Greg KH
2003-06-17 20:20             ` Alan Stern
2003-06-15 16:42 Alan Stern
2003-06-15 17:40 ` Jeremy Fitzhardinge
2003-06-16 14:05   ` Alan Stern
2003-06-16 17:08 ` Greg KH
2003-06-16 17:20   ` Russell King
2003-06-16 17:54     ` Alan Stern
2003-06-16 18:00       ` Patrick Mochel
2003-06-16 18:03       ` viro
2003-06-16 18:23         ` Alan Stern
2003-06-16 18:38           ` Patrick Mochel
2003-06-16 19:06             ` Alan Stern
2003-06-16 18:00     ` Martin Diehl
2003-06-16 18:15       ` viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030619172641.GA1172@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=greg@kroah.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=kpfleming@cox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=stern@rowland.harvard.edu \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox