public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>,
	linux-scsi@vger.kernel.org, Tony Jones <tonyj@suse.de>
Subject: Re: [patch] convert the scsi layer to use struct device
Date: Sat, 15 Mar 2008 13:31:21 -0500	[thread overview]
Message-ID: <1205605881.6767.52.camel@localhost.localdomain> (raw)
In-Reply-To: <1205604260.3109.133.camel@lov.site>

On Sat, 2008-03-15 at 19:04 +0100, Kay Sievers wrote:
> On Sat, 2008-03-15 at 11:16 -0500, James Bottomley wrote:
> > > We just need to create something like a "contains" link from the
> > > component to the scsi device, and a "enclosure" link at the scsi device
> > > back to the component, right?
> > 
> > Assuming you're moving to the single tree model, then I can easily do
> > this:
> > 
> > <real enclosure device>/<enclosure>/<enclosure component>/device -> link
> > to component device
> 
> Yes, sounds good. Only that there will be no meaningful "device" link
> with !SYSFS_DEPRECATED, we need a custom link, maintained by the
> enclosure itself, to do that.
> 
> > with a back link in the component device pointing to the enclosure
> > component.
> 
> That sounds fine.
> 
> > The way components work, probably blowing away enclosure_component_class
> > makes the most sense anyway.
> 
> If we go for a single class, can't we express enclosures and components
> in the device name and put them in the same class like:
> /sys/class/enclosure/
> |- enclosure1 -> ../../../devices/<...>/enclosure1
> |- enclosure1.slot1 -> ../../../../devices/<...>/enclosure1/enclosure1.slot1
> |- enclosure1.slot2 -> ../../../../devices/<...>/enclosure1/enclosure1.slot2
> |- enclosure2 -> ../../../devices/<...>/enclosure2
> |- enclosure2.slot1 -> -> ../../../../devices/<...>/enclosure1/enclosure2.slot1
> ...
>  
> while /sys/devices/<...>/enclosure1/enclosure1.slot1/ has a something
> like a "contains" link pointing to the SCSI device, and the SCSI device
> an "enclosure" link back?

OK, I've got a two expander system with six slots each pretending to be
a twelve slot installation.  I've also got two slots populated (slot 1
and 6).  This is what it looks like with the deprecated setting:

sparkweed:/sys/class/enclosure# tree
.
|-- 0:0:1:0
|   |-- SLOT 006
|   |   |-- active
|   |   |-- device -> ../../../../devices/pci0000:01/0000:01:02.0/host0/port-0:0/expander-0:0/port-0:0:0/end_device-0:0:0/target0:0:0/0:0:0:0
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- SLOT 007
|   |   |-- active
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- SLOT 008
|   |   |-- active
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- SLOT 009
|   |   |-- active
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- SLOT 010
|   |   |-- active
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- SLOT 011
|   |   |-- active
|   |   |-- fault
|   |   |-- locate
|   |   |-- power
|   |   |   `-- wakeup
|   |   |-- status
|   |   |-- type
|   |   `-- uevent
|   |-- components
|   |-- device -> ../../../devices/pci0000:01/0000:01:02.0/host0/port-0:0/expander-0:0/port-0:0:12/end_device-0:0:12/target0:0:1/0:0:1:0
|   |-- power
|   |   `-- wakeup
|   |-- subsystem -> ../../enclosure
|   `-- uevent
`-- 0:0:3:0
    |-- SLOT 000
    |   |-- active
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- SLOT 001
    |   |-- active
    |   |-- device -> ../../../../devices/pci0000:01/0000:01:02.0/host0/port-0:1/expander-0:1/port-0:1:11/end_device-0:1:11/target0:0:2/0:0:2:0
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- SLOT 002
    |   |-- active
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- SLOT 003
    |   |-- active
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- SLOT 004
    |   |-- active
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- SLOT 005
    |   |-- active
    |   |-- fault
    |   |-- locate
    |   |-- power
    |   |   `-- wakeup
    |   |-- status
    |   |-- type
    |   `-- uevent
    |-- components
    |-- device -> ../../../devices/pci0000:01/0000:01:02.0/host0/port-0:1/expander-0:1/port-0:1:12/end_device-0:1:12/target0:0:3/0:0:3:0
    |-- power
    |   `-- wakeup
    |-- subsystem -> ../../enclosure
    `-- uevent


And without the deprecated setting:

sparkweed:/sys/class/enclosure# tree
.
|-- 0:0:1:0 -> ../../devices/pci0000:01/0000:01:02.0/host0/port-0:0/expander-0:0/port-0:0:12/end_device-0:0:12/target0:0:1/0:0:1:0/enclosure/0:0:1:0
`-- 0:0:3:0 -> ../../devices/pci0000:01/0000:01:02.0/host0/port-0:1/expander-0:1/port-0:1:12/end_device-0:1:12/target0:0:3/0:0:3:0/enclosure/0:0:3:0

sparkweed:/sys/class/enclosure/0:0:1:0# tree
.
|-- SLOT 006
|   |-- active
|   |-- device -> ../../../../../../../port-0:0:0/end_device-0:0:0/target0:0:0/0:0:0:0
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- SLOT 007
|   |-- active
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- SLOT 008
|   |-- active
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- SLOT 009
|   |-- active
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- SLOT 010
|   |-- active
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- SLOT 011
|   |-- active
|   |-- fault
|   |-- locate
|   |-- power
|   |   `-- wakeup
|   |-- status
|   |-- type
|   `-- uevent
|-- components
|-- device -> ../../../0:0:1:0
|-- power
|   `-- wakeup
|-- subsystem -> ../../../../../../../../../../../../class/enclosure
`-- uevent


So are we now all happy?

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-03-15 18:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 21:06 [patch] convert the scsi layer to use struct device Greg KH
2008-03-14 14:13 ` Hannes Reinecke
2008-03-14 17:15 ` James Bottomley
2008-03-14 21:20   ` James Bottomley
2008-03-14 21:58     ` Kay Sievers
2008-03-15 14:19       ` James Bottomley
2008-03-15 15:17         ` Kay Sievers
2008-03-15 16:16           ` James Bottomley
2008-03-15 18:01             ` James Bottomley
2008-03-15 18:26               ` Kay Sievers
2008-03-15 18:34                 ` James Bottomley
2008-03-15 20:38                   ` Stefan Richter
2008-03-15 18:04             ` Kay Sievers
2008-03-15 18:31               ` James Bottomley [this message]
2008-03-15 18:56                 ` Kay Sievers
2008-03-15 19:33                   ` James Bottomley
2008-03-15 19:43                     ` Kay Sievers
2008-03-16 20:21               ` James Smart
2008-03-16 21:04                 ` Kay Sievers
2008-03-17  4:15                   ` James Smart
2008-03-17  5:35                     ` Greg KH
2008-03-17 12:18                       ` James Smart
2008-03-17 13:40                         ` Kay Sievers
2008-03-17 13:55                           ` James Bottomley
2008-03-17 17:57   ` James Bottomley
2008-03-19  0:48     ` Greg KH
2008-03-19 20:38       ` James Bottomley

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=1205605881.6767.52.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tonyj@suse.de \
    /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