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

On Fri, 2008-03-14 at 12:15 -0500, James Bottomley wrote:
> On Thu, 2008-03-13 at 14:06 -0700, Greg KH wrote:
> > Here's a huge patch from Tony and Kay that converts the scsi layer to
> > use struct device instead of class_device.
> > 
> > It doesn't seem like it could be split up any smaller due to the
> > interconectedness of the whole mess, if you have any suggestions
> > otherwise, it would be appreciated.
> > 
> > If you want, I can take this through my tree as it does depend on a
> > previous IB patch to make that portion of the patch much smaller.
> > 
> > After this, all of the class_device code is now finally gone from the
> > kernel!
> 
> Actually, I have it built and running (actually 2.6.25-rc5-mc5 which
> includes all the changes in your tree).  Amazingly it's pretty much
> fully functional, except ses which seems to have suffered a breakdown in
> the way its model works.  I'll see if I can fix it up.

OK, I looked at converting ses and enclosure, but it looks impossible
given the way you've set all of this up (and at the moment it's almost
non functional).

What it wants is for the enclosure and component devices to be arranged
hierarchically under the enclosure class and then the device link of the
components to be populated if they're actually present (which they might
not be).

Given the fact that you've chosen to have dev->parent point to the
device the original class_device->dev was pointing to, there's almost no
way left to express this relationship.  We can do it by having
kobj->parent point to the enclosure and dev->parent point to the
enclosed device, but I can't encapsulate that information into a struct
device alone.

>From an interface point of view, this dual use of the parent pointer
looks a bit nasty ... and you have some fun code to prove the point in
drivers/base/core.c:get_device_parent()

How about just adding a struct device *peer; entry to struct device and
using it to express the former class relationship?  That way we can do
all the parenting stuff correctly.

Otherwise, I'm going to need something like a device_add_class_parent()
API that allows me to add these former class devices and set up the
kobject parent correctly.

James



  reply	other threads:[~2008-03-14 21:20 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 [this message]
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
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=1205529619.2904.87.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