public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI hotplug support
Date: Tue, 15 Oct 2002 16:07:00 -0600	[thread overview]
Message-ID: <20021015220659.GA19530@codepoet.org> (raw)
In-Reply-To: <20021015195516.GE4391@redhat.com>

On Tue Oct 15, 2002 at 03:55:16PM -0400, Doug Ledford wrote:
> On Tue, Oct 15, 2002 at 01:32:16PM -0600, Erik Andersen wrote:
> > > about the scenario I asked about in my last email regarding a second disc 
> > > and the situation where no module needs loaded?  How is that handled?
> > 
> > Same deal.  The 1394 nodemgr invokes /sbin/hotplug.
> 
> That doesn't answer the question.  Your patch provided a kernel interface
> to be called by other kernel code (during module init time if I'm
> correct).  As such, hotplug itself is *not* attaching the disk, it is
> letting the module init take care of it.  If /sbin/hotplug isn't attaching
> the disk, but instead it is being done by the kernel driver during insmod
> (using the facilities provided by your patch), THEN HOW DOES IT HAPPEN
> WHEN THE MODULE IS ALREADY LOADED?  Are you loading *another* copy of the
> same module to handle the additional disk?  Do you have a facility by
> which the hotplug manager can tell an existing module about a new disk?  
> Or does it just not get added?  Or does the 1394 node manager notice that
> the module for the new disk is already loaded and tell the module about
> the new disk without even invoking hotplug?  Please answer this for me.

I added this 
    printk("ieee1394 nodmgr: invoking hotplug in the context "
	    "of '%s' (pid %d)\n", current->comm, current->pid);
to nodemgr_call_policy() in drivers/ieee1394/nodemgr.c.  I stuck
a similar printk into the sbp2 driver for when I was hooking and
unhooking devices into the SCSI subsystem.

When loading the ohci1394 module I see
    ieee1394 nodmgr: invoking hotplug in the context of 'knodemgrd' (pid 24179)

With my 1394 RAID array cold-plugged into my cardbus 1394 card,
the 4 drives are registered with the SCSI subsystem.  Looks like
I forgot to test my sbp2 patch with cold-plugging -- with my
patch in place the 4 drives end up being registered _twice_ with
the SCSI subsystem.  It got one copy of the devices from calling
scsi_register_host (I'm testing with 2.4.x), and then another
copy from me trying to hotplug the devices.  oops.  I'll sort
that bit out.  Anyways, when doing cold-plugging the sbp2 devices
are registered with the SCSI subsystem in the context of
'modprobe' (which was busy loading the sbp2 module at the time
things were registered with the SCSI subsystem).  So in the
coldplug case, /sbin/hotplug was not in any way involved.

Then when I hotplugged and hotunplugged the 1394 devices, hotplug
was again called in the context of 'knodemgrd'.  So I was wrong
about the context from which things were called.  Sorry about
that...

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

  reply	other threads:[~2002-10-15 22:07 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14  5:40 [PATCH] SCSI hotplug support Erik Andersen
2002-10-14  7:06 ` Matthew Dharm
2002-10-14  7:12   ` Erik Andersen
2002-10-14 15:47     ` Kurt Garloff
2002-10-14 16:19       ` Mike Anderson
2002-10-14 20:41         ` Erik Andersen
2002-10-14 22:10           ` Mike Anderson
2002-10-14 20:46       ` Erik Andersen
2002-10-14 15:57 ` James Bottomley
2002-10-14 17:22   ` Mike Anderson
2002-10-14 17:30   ` Matthew Dharm
2002-10-14 17:39     ` James Bottomley
2002-10-14 19:11       ` Oliver Xymoron
2002-10-15  0:42       ` Kurt Garloff
2002-10-14 20:37   ` Erik Andersen
2002-10-14 21:07     ` James Bottomley
2002-10-14 21:54       ` Erik Andersen
2002-10-14 22:25         ` Doug Ledford
2002-10-15  5:25           ` Erik Andersen
2002-10-15 15:33             ` Doug Ledford
2002-10-15 18:18               ` Erik Andersen
2002-10-15 18:22             ` Doug Ledford
2002-10-15 18:45               ` Erik Andersen
2002-10-15 19:13                 ` Doug Ledford
2002-10-15 19:32                   ` Erik Andersen
2002-10-15 19:45                     ` James Bottomley
2002-10-15 19:50                     ` Scott Merritt
2002-10-15 19:55                     ` Doug Ledford
2002-10-15 22:07                       ` Erik Andersen [this message]
2002-10-16  2:40                         ` Doug Ledford
2002-10-18 11:28                           ` Erik Andersen
2002-10-15 21:43                 ` Oliver Neukum
2002-10-15 22:07                   ` Erik Andersen
2002-10-14 22:19       ` Oliver Neukum
2002-10-15  0:22         ` Doug Ledford
2002-10-15  7:53           ` Oliver Neukum
2002-10-15 14:35             ` Doug Ledford
2002-10-15 15:19               ` Oliver Neukum
2002-10-15 15:40                 ` James Bottomley
2002-10-15 17:47               ` Erik Andersen
2002-10-15 18:34                 ` Doug Ledford
2002-10-15 18:22               ` Scott Merritt

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=20021015220659.GA19530@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.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