From: James Bottomley <James.Bottomley@SteelEye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>,
SCSI development list <linux-scsi@vger.kernel.org>,
Luben Tuikov <luben_tuikov@adaptec.com>,
Mike Anderson <andmike@us.ibm.com>
Subject: Re: Synchronizing scsi_remove_host and the error handler
Date: Mon, 08 Aug 2005 17:23:00 -0500 [thread overview]
Message-ID: <1123539780.8235.13.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0508081517000.4454-100000@iolanthe.rowland.org>
On Mon, 2005-08-08 at 16:41 -0400, Alan Stern wrote:
> > > Would you agree to a patch adding such a kref?
> >
> > Well, not really. The host template usually exists as a variable in the
> > module, so its lifetime is tied to the lifetime of the module. Adding a
> > kref wouldn't help because it will still be freed when the module is
> > removed. If there's a case where the template is being freed
> > prematurely because the module is being removed, then we have the module
> > refcounting wrong somewhere. Have you run across such a case?
>
> I tried to provoke such a case, but failed. Evidently I've been barking
> up the wrong tree. Normally the SCSI core doesn't call the LLD unless
> some process has opened a device file for something on that host. This
> will automatically do try_module_get on the LLD, making it impossible for
> the LLD to be removed from memory.
>
> I'm not certain this reasoning is 100% reliable, though -- does it cover
> _every_ case where the core calls the LLD? Maybe something like this
> little patch would be a good idea:
Yes, I was considering something similar, since all the last put of a
driver does is send the completion that driver_unregister() should be
waiting for
> + struct device_driver *parent_driver;
I don't think we need this. The underlying device has to be the parent
of shost_gendev, so you can get the parent driver as
shost_gendev.parent->driver
> + if (shost->parent_driver)
> + put_driver(shost->parent_driver);
And just before this would be the place to do the final release of all
the resources the HBA is holding.
James
next prev parent reply other threads:[~2005-08-08 22:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-07 14:59 Synchronizing scsi_remove_host and the error handler Alan Stern
2005-08-07 15:36 ` James Bottomley
2005-08-07 18:43 ` Alan Stern
2005-08-07 21:57 ` James Bottomley
2005-08-08 18:24 ` Luben Tuikov
2005-08-08 19:54 ` Mike Anderson
2005-08-08 20:25 ` Luben Tuikov
2005-08-08 20:06 ` Mike Anderson
2005-08-07 22:15 ` Stefan Richter
2005-08-08 20:41 ` Alan Stern
2005-08-08 21:36 ` Mike Anderson
2005-08-08 22:36 ` Alan Stern
2005-08-08 23:10 ` Stefan Richter
2005-08-09 14:23 ` Alan Stern
2005-08-09 19:37 ` Stefan Richter
2005-08-09 20:07 ` Alan Stern
2005-08-09 20:45 ` Stefan Richter
2005-08-08 23:59 ` Stefan Richter
2005-08-09 14:40 ` Alan Stern
2005-08-09 18:21 ` Stefan Richter
2005-08-09 18:49 ` Alan Stern
2005-08-08 21:49 ` Stefan Richter
2005-08-08 22:20 ` Luben Tuikov
2005-08-08 22:30 ` Alan Stern
2005-08-09 0:49 ` Luben Tuikov
2005-08-09 14:50 ` Alan Stern
2005-08-08 22:23 ` James Bottomley [this message]
2005-08-08 22:40 ` Alan Stern
2005-08-08 18:07 ` Luben Tuikov
2005-08-08 18:04 ` Luben Tuikov
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=1123539780.8235.13.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=andmike@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=luben_tuikov@adaptec.com \
--cc=stefanr@s5r6.in-berlin.de \
--cc=stern@rowland.harvard.edu \
/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.