From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: Christoph Hellwig <hch@lst.de>, James.Bottomley@steeleye.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] allow drivers to hook into watchdog timeout
Date: Tue, 10 Feb 2004 09:34:18 -0700 [thread overview]
Message-ID: <2432440000.1076430858@aslan.btc.adaptec.com> (raw)
In-Reply-To: <20040120132052.GA6740@lst.de>
> We all know talk is cheap, so here's a first draft patch to allow LLDDs
> to get control first after a command timeout. Justin, does this look
> okay for you? BTW, your drivers are the last ones using scsi_add_timer
> from outside the midlayer, if we could get rid of that we'd be able to
> keep the interface private.
[ Sorry for taking so long to get back to you. Things are still very
hectic here... ]
I would rather not lose the ability for LLDs to setup/modify/etc.
timers. This is because in an ideal world, the mid-layer and peripheral
drivers would specify the timeout value and let the LLD start and stop
the timer as it sees fit. I say this because the mid-layer just can't
know all of the information that the HBA driver does:
o When should the timer start? If the HBA controls the timer, the timer
can be started only once the command is actually issued to the end device.
The watchdog is supposed to ensure that the transport/device doesn't
lockup, so the timer should only cover this period. The mid-layer
can't have this precision. This is even more crucial for drivers that
must temporarily hold back I/O to handle a topology change, LIP, or
other transport specific event that the mid-layer is unaware of.
o When should the timer be stopped? On command completion, of course,
but there are other, transport specific, times when the timer may need
to be stopped prematurely or given a completely different value than
what was originally given. For example, on transports that do not
provide error/sense data with every completion, the HBA may have to
issue another command, without the knowledge of the mid-layer, to
retrieve this data. Since the original command has already completed,
the original timer should not be running. A new timer, tailored to
the characteristics of retrieving sense data should be running instead.
If the old timer is left running and expires, which command timed out?
The original command or the request sense command? The HBA knows,
but the mid-layer does not.
If you just allow the LLD drivers to claim responsibility for setting
and tearing down timers, there is no need to redirect the timer
action. All that would be required is a check of a flag in the host
structure in scsi_add_timer to avoid starting the timer at all and
another check in scsi_done that doesn't enforce that a timer be
active on completion.
--
Justin
next prev parent reply other threads:[~2004-02-10 16:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-20 13:20 [PATCH] allow drivers to hook into watchdog timeout Christoph Hellwig
2004-01-20 15:53 ` Mike Anderson
2004-01-20 16:00 ` Christoph Hellwig
2004-01-20 16:47 ` Mike Anderson
2004-01-22 13:59 ` Christoph Hellwig
2004-01-22 14:27 ` Justin T. Gibbs
2004-01-20 17:00 ` Brian King
2004-01-20 18:06 ` Christoph Hellwig
2004-02-10 16:34 ` Justin T. Gibbs [this message]
2004-02-10 16:42 ` James Bottomley
2004-02-10 17:47 ` Justin T. Gibbs
2004-02-10 18:41 ` James Bottomley
2004-02-10 19:44 ` Justin T. Gibbs
2004-02-10 20:05 ` James Bottomley
2004-02-10 20:26 ` Justin T. Gibbs
2004-02-10 22:47 ` Clay Haapala
2004-02-11 20:05 ` James Bottomley
2004-02-12 0:15 ` Justin T. Gibbs
2004-02-12 14:42 ` James Bottomley
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=2432440000.1076430858@aslan.btc.adaptec.com \
--to=gibbs@scsiguy.com \
--cc=James.Bottomley@steeleye.com \
--cc=hch@lst.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