From: Christoph Hellwig <hch@infradead.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
Kurt Garloff <garloff@suse.de>,
Linux SCSI list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] tmscsim: new interfaces
Date: Wed, 26 May 2004 07:45:22 -0400 [thread overview]
Message-ID: <20040526114521.GA24166@infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0405232233490.2248-300000@poirot.grange>
On Sun, May 23, 2004 at 11:19:58PM +0200, Guennadi Liakhovetski wrote:
> > Looks mostly goo to me, one thing I worry about is the complete
> > removal of the scan_device flag, I don't fully understand what it's
> > supposed to do, but we should be able to always set in ->slave_alloc
> > and then clear it in ->slave_configure when we know probing is over
> > for this device.
>
> Right, thanks. I didn't understand at all what scan_devices was doing
> there, so, I tried to preserve its semantics in the driver, and "just"
> overlooked its setting in dc390_SRBdone:-( But, wouldn't it be safer to
> just restore the relevant parts there, rather than moving it in
> slave_alloc / configure? Because... emn, well, I wanted to write "because
> it is tested later on in dc390_SRBdone:
> if (pACB->scan_devices) pACB->DeviceCnt++;
> ", but then I checked, where else this DeviceCnt is used, and found only
> initialisation to 0, the increment above, no decrement, and a proc-output:
>
> SPRINTF("Nr of attached devices: %i, Nr of DCBs: %i\n", pACB->DeviceCnt, pACB->DCBCnt);
>
> Whereas, DCBCnt is incremented on slave_alloc, decremented on
> slave_destroy and used in a couple more places. So, is it safe to assume
> that DeviceCnt is redundant and remove it in a next patch?... Then it
> might be already safe to move scan_devices as you suggest?
Looks like a way to go. I'm not sure what scan_device is supposed to
do as I already wrote, but from looking at when it's set/cleared I'm
pretty sure it tries to indicate whethere we're currently scanning for
devices. And useing slave_alloc/slave_configure is a much safer way to
find that out then guessing from the commands sent.
> > In dc390_init_one you don't call pci_disable_device on failure,
> > best switch to goto for a single shared error path to avoid all
> > these leaks.
>
> Done. Actually, I copied this (and other) new function(s) from dc395x, so,
> they have this bug too...
There's quite a lot drivers missing it, because it's not nessecary
on most PCs.
> And, I asume, it has to be done in remove_one too, right?
Yes.
> RCS file: /usr/src/cvs/linux-2_6/include/scsi/scsi_host.h,v
> retrieving revision 1.1.1.3
> diff -u -r1.1.1.3 scsi_host.h
> --- include/scsi/scsi_host.h 19 May 2004 16:08:49 -0000 1.1.1.3
> +++ include/scsi/scsi_host.h 23 May 2004 20:18:31 -0000
> @@ -151,7 +151,7 @@
> * here then you will get a call to slave_configure(), then the
> * device will be used for however long it is kept around, then when
> * the device is removed from the system (or * possibly at reboot
> - * time), you will then get a call to slave_detach(). This is
> + * time), you will then get a call to slave_destroy(). This is
> * assuming you implement slave_configure and slave_destroy.
> * However, if you allocate memory and hang it off the device struct,
> * then you must implement the slave_destroy() routine at a minimum
> @@ -185,7 +185,7 @@
> * specific setup basis...
> * 6. Return 0 on success, non-0 on error. The device will be marked
> * as offline on error so that no access will occur. If you return
> - * non-0, your slave_detach routine will never get called for this
> + * non-0, your slave_destroy routine will never get called for this
This looks okay, but can you please send it to the list as a separate patch?
Rest of the patch also looks go to go in as-is, the additional items
can be fixed in followup-patches.
next prev parent reply other threads:[~2004-05-26 11:45 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040518184527.GC4859@tpkurt.garloff.de>
2004-05-18 19:47 ` [BK PATCH] SCSI updates for 2.6.6 Guennadi Liakhovetski
2004-05-18 20:38 ` James Bottomley
2004-05-19 19:50 ` [PATCH] tmscsim: 64-bit cleanup Guennadi Liakhovetski
2004-05-19 21:34 ` [PATCH] tmscsim: no internal queue Guennadi Liakhovetski
2004-05-21 15:15 ` [PATCH] tmscsim: 64-bit cleanup James Bottomley
2004-05-21 22:53 ` Guennadi Liakhovetski
2004-05-22 8:09 ` Kurt Garloff
2004-05-22 15:43 ` James Bottomley
2004-05-22 18:10 ` Kurt Garloff
2004-05-22 19:34 ` [PATCH] tmscsim: new interfaces Guennadi Liakhovetski
2004-05-23 10:37 ` Christoph Hellwig
2004-05-23 21:19 ` Guennadi Liakhovetski
2004-05-26 11:45 ` Christoph Hellwig [this message]
2004-05-26 19:37 ` [PATCH] fix comment in scsi_host.h Guennadi Liakhovetski
2004-05-26 21:07 ` [PATCH] tmscsim: new interfaces Guennadi Liakhovetski
2004-05-27 21:20 ` Guennadi Liakhovetski
2004-05-28 13:00 ` Christoph Hellwig
2004-05-29 15:36 ` James Bottomley
2004-05-30 21:01 ` [PATCH] tmscsim: Store pDCB in device->hostdata Guennadi Liakhovetski
2004-05-31 9:22 ` Christoph Hellwig
2004-05-31 21:13 ` [PATCH] tmscsim: init / exit cleanup Guennadi Liakhovetski
2004-06-03 13:38 ` Christoph Hellwig
2004-06-03 20:23 ` Guennadi Liakhovetski
2004-06-06 17:09 ` Christoph Hellwig
2004-06-08 6:37 ` Kurt Garloff
2004-05-22 19:38 ` [PATCH] tmscsim: 64-bit cleanup Guennadi Liakhovetski
2004-06-04 22:17 ` Guennadi Liakhovetski
2004-06-05 8:12 ` Guennadi Liakhovetski
2004-06-05 14:02 ` James Bottomley
2004-06-05 20:37 ` Guennadi Liakhovetski
2004-06-05 21:06 ` James Bottomley
2004-06-06 15:06 ` Guennadi Liakhovetski
2004-06-14 21:37 ` Guennadi Liakhovetski
2004-05-21 1:06 ` [BK PATCH] SCSI updates for 2.6.6 Chiaki
2004-05-18 22:17 ` Matthew Wilcox
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=20040526114521.GA24166@infradead.org \
--to=hch@infradead.org \
--cc=James.Bottomley@steeleye.com \
--cc=g.liakhovetski@gmx.de \
--cc=garloff@suse.de \
--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