From: Luben Tuikov <luben@splentec.com>
To: Mike Anderson <andmike@us.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH / RFC] scsi_error handler update. (1/4)
Date: Tue, 11 Feb 2003 14:05:27 -0500 [thread overview]
Message-ID: <3E494977.1070706@splentec.com> (raw)
In-Reply-To: 20030211172256.GC3164@beaverton.ibm.com
Mike Anderson wrote:
>
> I could change the name.
>
> I wanted a list just for the error handler I was concerned in the
> timeout (cancel cases) that until ownership was reclaimed that I did not
> want to risk modification of another scsi_cmnd list_head. We should be
> protected by the scsi_done scsi_delete_timer so I could possibly use the
> other list head.
Yes, I see the predicament.
I also wanted to make note as to the choice of names of variables.
This is very important, not so much judging from kernel use, but in
general. I've been known to change my var names over 10 times until
they've gotten to represent *and* mean what they represent and mean.
I.e. their usage == their name as close as possible.
E.g. this is why we use Leibniz's calculus notation rather than
Newton's. Sorry for the example, but this is my background.
I.e. symbols carry out meaning in and of themselves.
In fact cmd_list is actually a cmd_q (cmd queue) and eh_cmd_list
is actually eh_cmd_q. Since both are ordered lists of commands by
arrival time. And will soon become priority queues when SCSI Core
gets up to date with sending down HOQ (Head Of Queue) commands,
as per SAM-2/3. It would be nice if someone renamed those...
(back to linux-scsi :-) )
> A command becomes a member of the eh_cmd_list:
> - If a scsi_cmnd times out.
> - A call to scsi_set_device_offline with scsi_cmnds active.
> - A command completes with DID_TIME_OUT and is not a TUR or
> Inquiry.
> - A command completes with message byte of != COMMAND_COMPLETE.
> - A few other cases in scsi_decide_disposition. I will document
> them.
>
> A command is removed from this list when:
> - Legacy request sense is done.
> - Abort was successful.
> - A function in the sequence done by scsi_eh_ready_devs is
> successful.
Aaah, very nice. This should be documented in the code.
Here is some comments (this means that they are comments, just that,
they don't mean that this is necessarily how I want things to be or
that I think it would be a better design... it may be worse -- the
point is to expand the brainstorm pool).
1. Is it possible that when a command times out, or when the application
client sends ABORT_TASK TMF (future), the eh thread wakes up and calls the driver's
abort function, without actually shutting down queueing or any other workings
of the host/driver/device? Then let the LLDD cancel this command, all the while
the rest of the things can go on.
2. If the device is set off line, then there would be no point in moving
the commands from the cmd_list to eh_cmd_list, since cmd_list _becomes_
eh_cmd_list by the nature of the state of the device.
1 and 2 would mean that we don't really need the eh_cmd_list. (we do
in a different context...)
3. Why are TUR and INQUIRY treated differently on timeout?
4. If a command ``returns'' from a LLDD, and has in the message
byte something of the sort ``task not complete'' this almost
certainly means Service Response of SERVICE DELIVERY OR TARGET FAILURE.
In this case SCSI Core now owns the command and it should bubble up
to the application client and/or cancel the *other* queued commands
and/or fire a hot plug event.
In fact I've wanted for a long time a service_response byte in cmd struct
and status byte as per SAM-2/3. This would make things so much easier
for SCSI Core. All LLDDs would need tweaking but it is not that bad.
What are your thoughts that queuecommand() become void queuecommand()?
I.e. the only way a command is given ownerhip to a LLDD is via
queuecommand() and the only way a command is given back to SCSI Core
is via a call to scsi_done()?
Side-side comments:
I saw your done_list -- nice name. What it the story with this list?
--
Luben
next prev parent reply other threads:[~2003-02-11 19:05 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-11 8:13 [PATCH / RFC] scsi_error handler update. (1/4) Mike Anderson
2003-02-11 8:15 ` [PATCH / RFC] scsi_error handler update. (2/4) Mike Anderson
2003-02-11 8:17 ` [PATCH / RFC] scsi_error handler update. (3/4) Mike Anderson
2003-02-11 8:19 ` [PATCH / RFC] scsi_error handler update. (4/4) Mike Anderson
2003-02-11 22:38 ` [PATCH / RFC] scsi_error handler update. (3/4) James Bottomley
2003-02-12 7:16 ` Mike Anderson
2003-02-12 14:26 ` Luben Tuikov
2003-02-12 14:37 ` James Bottomley
2003-02-12 22:34 ` James Bottomley
2003-02-13 8:24 ` Mike Anderson
2003-02-11 16:49 ` [PATCH / RFC] scsi_error handler update. (1/4) Luben Tuikov
2003-02-11 17:22 ` Mike Anderson
2003-02-11 19:05 ` Luben Tuikov [this message]
2003-02-11 20:14 ` Luben Tuikov
2003-02-11 21:14 ` Mike Anderson
[not found] ` <3E495862.3050709@splentec.com>
2003-02-11 21:20 ` Mike Anderson
2003-02-11 21:22 ` Luben Tuikov
2003-02-11 22:41 ` Christoph Hellwig
2003-02-12 20:10 ` Luben Tuikov
2003-02-12 20:46 ` Christoph Hellwig
2003-02-12 21:23 ` Mike Anderson
2003-02-12 22:15 ` Luben Tuikov
2003-02-12 21:46 ` Luben Tuikov
2003-02-13 15:47 ` Christoph Hellwig
2003-02-13 18:55 ` Luben Tuikov
2003-02-14 0:24 ` Doug Ledford
2003-02-14 16:38 ` Patrick Mansfield
2003-02-14 16:58 ` Mike Anderson
2003-02-14 18:50 ` Doug Ledford
2003-02-14 19:35 ` Luben Tuikov
2003-02-14 21:20 ` James Bottomley
2003-02-17 17:20 ` Luben Tuikov
2003-02-17 17:58 ` James Bottomley
2003-02-17 18:29 ` Luben Tuikov
2003-02-18 5:37 ` Andre Hedrick
2003-02-18 19:46 ` Luben Tuikov
2003-02-18 22:16 ` Andre Hedrick
2003-02-18 23:35 ` Luben Tuikov
2003-02-17 20:17 ` Doug Ledford
2003-02-17 20:19 ` Matthew Jacob
2003-02-17 21:12 ` Luben Tuikov
2003-02-17 17:35 ` Luben Tuikov
2003-02-14 21:27 ` James Bottomley
2003-02-17 17:28 ` Luben Tuikov
2003-02-16 4:23 ` Andre Hedrick
2003-02-11 18:00 ` Patrick Mansfield
2003-02-11 18:44 ` Mike Anderson
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=3E494977.1070706@splentec.com \
--to=luben@splentec.com \
--cc=andmike@us.ibm.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