From: Kay Sievers <kay.sievers@vrfy.org>
To: Andrew Patterson <andrew.patterson@hp.com>
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, 8 Apr 2009 09:34:37 -0700 [thread overview]
Message-ID: <ac3eb2510904080934o46a5375qf70ee77ec3ab7171@mail.gmail.com> (raw)
In-Reply-To: <1239207853.19984.207.camel@grinch>
On Wed, Apr 8, 2009 at 09:24, Andrew Patterson <andrew.patterson@hp.com> wrote:
> 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.
Do what you have today, just make sure all your devices are uniquely
named, and assigned to the cciss bus_type. There can be no hierarchies
in /sys/bus/*/devices, there are only symlinks. The hierarchy is only
in /sys/devices/, and if I correctly look at what you have, you have
that already.
Kay
next prev parent reply other threads:[~2009-04-08 16:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-07 18:04 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 16:24 ` Andrew Patterson
2009-04-08 16:34 ` Kay Sievers [this message]
[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: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=ac3eb2510904080934o46a5375qf70ee77ec3ab7171@mail.gmail.com \
--to=kay.sievers@vrfy.org \
--cc=akpm@linux-foundation.org \
--cc=andrew.patterson@hp.com \
--cc=jens.axboe@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®