From: Jamie Lenehan <lenehan@twibble.org>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: linux-scsi@vger.kernel.org, willy@debian.org
Subject: Re: final scsi_host_put in ->remove()?
Date: Mon, 29 Sep 2003 23:41:08 +1000 [thread overview]
Message-ID: <20030929134108.GA12018@twibble.org> (raw)
In-Reply-To: <Pine.LNX.4.53.0309290733480.1740@montezuma.fsmlabs.com>
On Mon, Sep 29, 2003 at 07:48:48AM -0400, Zwane Mwaikambo wrote:
[...]
> An updated driver such as NCR_D700 has the following in it's ->remove()
> path. Whilst sym53c8xx_2 doesn't have any scsi_remove_host at all,
> dc395x.c does
Well, I wouldn't trust the dc395x driver since I'm responsible for
that one ;)
> static void NCR_D700_remove_one(struct Scsi_Host *host)
> {
> scsi_remove_host(host);
> NCR_700_release(host);
> kfree((struct NCR_700_Host_Parameters *)host->hostdata[0]);
> free_irq(host->irq, host);
> release_region(host->base, 64);
> }
>
> Is it possible that scsi_remove_host does the final put? In which case
The scsi_remove_host just removes devices from the host (calls back
via the slave_destroy template function) and removes various other
external references to the host structure such as from the scsi bus
in sysfs, and the proc entry etc. It does not remove the host
structure itself, so it's still safe to use the host structure at
this point but nothing else should be using.
> using the host pointer afterwards wouldn't be safe. Otherwise wouldn't a
> scsi_host_put be required in that function? The scsi_remove_host section
Yes. I think it needs a scsi_host_put and the end of the function.
The sym53c8xx_2 looks wrong to me. It appears to need a scsi_host_put
and the end of sym_detach. It also doesn't call scsi_remove_host
either.... which I suspect it probably should be doing.
--
Jamie Lenehan <lenehan@twibble.org>
next prev parent reply other threads:[~2003-09-29 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-29 11:48 final scsi_host_put in ->remove()? Zwane Mwaikambo
2003-09-29 13:41 ` Jamie Lenehan [this message]
2003-09-29 20:46 ` Zwane Mwaikambo
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=20030929134108.GA12018@twibble.org \
--to=lenehan@twibble.org \
--cc=linux-scsi@vger.kernel.org \
--cc=willy@debian.org \
--cc=zwane@arm.linux.org.uk \
/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