All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Patterson <andrew.patterson@hp.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	"Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	LKML-SCSI <linux-scsi@vger.kernel.org>,
	mike.miller@hp.com
Subject: Re: [PATCH 1/1] cciss: resubmit export uid, model, vendor, rev to sysfs
Date: Wed, 08 Apr 2009 16:24:13 +0000	[thread overview]
Message-ID: <1239207853.19984.207.camel@grinch> (raw)
In-Reply-To: <ac3eb2510904080526h36673aa7qb5d530df33a60104@mail.gmail.com>

On Wed, 2009-04-08 at 05:26 -0700, Kay Sievers wrote:
> On Tue, Apr 7, 2009 at 23:19, Jens Axboe <jens.axboe@oracle.com> wrote:
> > On Tue, Apr 07 2009, Mike Miller (OS Dev) wrote:
> 
> > The patch looks fine to me, but my sysfs foo is very weak though. CC'ing
> > Kay, perhaps he can help take a quick look at this.
> 
> >> + * Initialize sysfs for each logical drive.  This sets up and registers
> >> + * the 'c#d#' directory for each individual logical drive under
> >> + * /sys/bus/pci/devices/<dev/ccis#/. We also create a link from
> >> + * /sys/block/cciss!c#d# to this entry.
> >> + */
> >> +static int cciss_create_ld_sysfs_entry(struct ctlr_info *h,
> >> +                                    drive_info_struct *drv,
> >> +                                    int drv_index)
> >> +{
> >> +     device_initialize(&drv->dev);
> >> +     drv->dev.type = &cciss_dev_type;
> >> +     dev_set_name(&drv->dev, "c%dd%d", h->ctlr, drv_index);
> >> +     drv->dev.parent = &h->dev;
> >> +     return device_add(&drv->dev);
> >> +}
> 
> If I read that correctly, you are creating a hierarchy of devices
> where the devices do not belong to any subsystem? This is what we need
> to avoid in almost all cases, we need a "subsystem" link in sysfs.
> 

Yes, but apparently mistakenly.

> I wold expect the cciss devices not to be a magic, silently created,
> subdirectory of a pci device, but to have their own "cciss" bus in
> sysfs, so the created devices get proper events at creation time. All
> the cciss devices would show up in its own directory
> /sys/bus/cciss/devices/*.
> 
> I think, you should name all "cciss bus devices" uniquely, and assign
> them to a "cciss bus_type". We really do not want unclassified devices
> in the chain of parent devices of a block device.
> 

I'll try this.  Although I am wondering whether to put hosts or logical
drives in /sys/bus/cciss/devices (or both). Can I do what I am doing
now, just moving it to /sys/bus/cciss/devices? That
is, /sys/bus/cciss/devices/ccissX/cYdZ.

Andrew

> Or do I missing something here?
> 
> Kay



WARNING: multiple messages have this Message-ID (diff)
From: Andrew Patterson <andrew.patterson@hp.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	"Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	LKML-SCSI <linux-scsi@vger.kernel.org>,
	mike.miller@hp.com
Subject: Re: [PATCH 1/1] cciss: resubmit export uid, model, vendor, rev to  sysfs
Date: Wed, 08 Apr 2009 16:24:13 +0000	[thread overview]
Message-ID: <1239207853.19984.207.camel@grinch> (raw)
In-Reply-To: <ac3eb2510904080526h36673aa7qb5d530df33a60104@mail.gmail.com>

On Wed, 2009-04-08 at 05:26 -0700, Kay Sievers wrote:
> On Tue, Apr 7, 2009 at 23:19, Jens Axboe <jens.axboe@oracle.com> wrote:
> > On Tue, Apr 07 2009, Mike Miller (OS Dev) wrote:
> 
> > The patch looks fine to me, but my sysfs foo is very weak though. CC'ing
> > Kay, perhaps he can help take a quick look at this.
> 
> >> + * Initialize sysfs for each logical drive.  This sets up and registers
> >> + * the 'c#d#' directory for each individual logical drive under
> >> + * /sys/bus/pci/devices/<dev/ccis#/. We also create a link from
> >> + * /sys/block/cciss!c#d# to this entry.
> >> + */
> >> +static int cciss_create_ld_sysfs_entry(struct ctlr_info *h,
> >> +                                    drive_info_struct *drv,
> >> +                                    int drv_index)
> >> +{
> >> +     device_initialize(&drv->dev);
> >> +     drv->dev.type = &cciss_dev_type;
> >> +     dev_set_name(&drv->dev, "c%dd%d", h->ctlr, drv_index);
> >> +     drv->dev.parent = &h->dev;
> >> +     return device_add(&drv->dev);
> >> +}
> 
> If I read that correctly, you are creating a hierarchy of devices
> where the devices do not belong to any subsystem? This is what we need
> to avoid in almost all cases, we need a "subsystem" link in sysfs.
> 

Yes, but apparently mistakenly.

> I wold expect the cciss devices not to be a magic, silently created,
> subdirectory of a pci device, but to have their own "cciss" bus in
> sysfs, so the created devices get proper events at creation time. All
> the cciss devices would show up in its own directory
> /sys/bus/cciss/devices/*.
> 
> I think, you should name all "cciss bus devices" uniquely, and assign
> them to a "cciss bus_type". We really do not want unclassified devices
> in the chain of parent devices of a block device.
> 

I'll try this.  Although I am wondering whether to put hosts or logical
drives in /sys/bus/cciss/devices (or both). Can I do what I am doing
now, just moving it to /sys/bus/cciss/devices? That
is, /sys/bus/cciss/devices/ccissX/cYdZ.

Andrew

> Or do I missing something here?
> 
> Kay



  reply	other threads:[~2009-04-08 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 18:04 [PATCH 1/1] cciss: resubmit export uid, model, vendor, rev to sysfs Mike Miller (OS Dev)
2009-04-08  6:19 ` Jens Axboe
2009-04-08  8:13   ` Jens Axboe
2009-04-08 14:53     ` Mike Miller (OS Dev)
2009-04-08 12:26   ` Kay Sievers
2009-04-08 12:26     ` Kay Sievers
2009-04-08 16:24     ` Andrew Patterson [this message]
2009-04-08 16:24       ` Andrew Patterson
2009-04-08 16:34       ` Kay Sievers
2009-04-08 16:34         ` Kay Sievers
     [not found]     ` <1239258160.19984.217.camel@grinch>
     [not found]       ` <ac3eb2510904090719n730dededp54b25390a9087a79@mail.gmail.com>
     [not found]         ` <1239296221.19984.218.camel@grinch>
     [not found]           ` <ac3eb2510904091005q13e5b5a1j3907de22ad3df70c@mail.gmail.com>
2009-04-09 18:07             ` Andrew Patterson
2009-04-09 18:07               ` Andrew Patterson
2009-04-09 18:12               ` Kay Sievers
2009-04-09 18:12                 ` Kay Sievers
2009-04-10  4:52 ` Andrew Morton
2009-04-10  5:08   ` Andrew Patterson
2009-04-10  5:17     ` Andrew Morton
2009-04-10 17:19       ` Andrew Patterson

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=1239207853.19984.207.camel@grinch \
    --to=andrew.patterson@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=mikem@beardog.cca.cpqcorp.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.