public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: Douglas Gilbert <dougg@torque.net>,
	wrlk@riede.org, linux-scsi@vger.kernel.org,
	Kai.Makisara@kolumbus.fi
Subject: Re: devices with more than one node
Date: Fri, 16 Jan 2004 01:59:34 -0800	[thread overview]
Message-ID: <20040116095934.GA1855@beaverton.ibm.com> (raw)
In-Reply-To: <20040115232104.GA23253@kroah.com>

Greg KH [greg@kroah.com] wrote:
> > To test it I modded scsi_debug to fake OnStream tape
> > drives and ran a 2.6.1-mm2 kernel. The attached
> > output of "cd /sys/class; tree scsi* osst" is instructive.
> > Two peculiar entries are:
> >     scsi_generic/sg0/driver -> ../../../bus/scsi/drivers/osst
> >     scsi_generic/sg1/driver -> ../../../bus/scsi/drivers/osst
> > 
> > This symlink only appears if the osst driver is loaded
> > _before_ the sg driver! It is also left dangling by
> > "rmmod osst". It seems that sysfs is still not happy
> > with multiple drivers controlling the one device.
> 
> The driver model does not allow this, and probably will not in the
> future.
> 
> Just keep sg as a "class", like this patch does.  That should fix your
> issues, right?
> 

Greg a clarification check. There is a scsi_device class already that sg
registers an interface with. The interface of scsi_device class is used
to add / remove the scsi_generic simple class devices and this is ok to
keep doing (not that there is another easy way to do this since sg does not
bind).

> > The scsi subsystem solution to this is to relegate sg to be a sysfs
> > "non" driver. Hence sg has no entry under
> > /sys/bus/scsi/drivers and thus no obvious place to
> > put its driver parameters. Sg driver parameters could be
> > placed in the /sys/class/scsi_generic directory (with
> > class_create_file() ). Suggestions?
> 
> That's a good place for them.  Unfortunatly the changes I made to the
> class_simple.c code does not provide you the ability to do this.  If you
> want to do this (and I think it is a good idea) you will have to write
> your own class code (like the usb_host class code).
> 

Another option that should work is that sg could register as a
scsi_driver and use bus_match to ensure it never binds. The only
difference between the other upper level drivers would be the links to
the devices in bus/scsi/driver/sg would not exist like other upper level
drivers. You would have a place though for driver attributes.

-andmike
--
Michael Anderson
andmike@us.ibm.com


  reply	other threads:[~2004-01-16  9:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040113193842.GA29887@suse.de>
     [not found] ` <20040113194631.GA3818@kroah.com>
     [not found]   ` <20040113211122.GA28100@suse.de>
     [not found]     ` <20040113212058.GA2595@kroah.com>
2004-01-13 23:01       ` devices with more than one node Patrick Mansfield
2004-01-13 23:18         ` Greg KH
2004-01-14  1:12           ` dougg
2004-01-14  1:26             ` Greg KH
2004-01-14  3:08             ` Willem Riede
2004-01-15  8:04               ` Douglas Gilbert
2004-01-15 23:21                 ` Greg KH
2004-01-16  9:59                   ` Mike Anderson [this message]
2004-01-18 22:08                 ` Willem Riede

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=20040116095934.GA1855@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=dougg@torque.net \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wrlk@riede.org \
    /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