[8803] in linux-scsi channel archive
Re: questions on error handling
daemon@ATHENA.MIT.EDU (Eric Youngdale)
Sat May 13 16:39:01 2000
Message-ID: <004901bfbd1b$154037c0$0f17a8c0@eric.home>
From: "Eric Youngdale" <eric@andante.org>
To: "Oliver Neukum" <Oliver.Neukum@lrz.uni-muenchen.de>,
<linux-scsi@vger.rutgers.edu>
Date: Sat, 13 May 2000 16:37:40 -0400
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
----- Original Message -----
From: "Oliver Neukum" <Oliver.Neukum@lrz.uni-muenchen.de>
To: <linux-scsi@vger.rutgers.edu>
Sent: Sunday, May 14, 2000 4:18 PM
Subject: questions on error handling
> Hello gurus,
>
> I have a lot of questions on scsi error handling and scsi in general.
>
> 1. Do we have to provide a scsi_command method() ?
No. In fact, I would rather you didn't - if you have a queuecommand
method, it is wasted space.
> 2. Where are the error returns of scsi_queuecommand() defined ?
I am assuming here you are using the new error handling code. Basically
return 0 if everything went OK, and the command is queued. Return non-zero
if the queuecommand is unable to queue the command (i.e. host busy).
> 3. What method should we provide if the only action we can undertake is a
> generic reset ?
A generic bus reset, a generic device reset, or a generic host reset?
Define only the entrypoints that you are able to implement:
int (*eh_device_reset_handler)(Scsi_Cmnd *);
int (*eh_bus_reset_handler)(Scsi_Cmnd *);
int (*eh_host_reset_handler)(Scsi_Cmnd *);
> 4. Is there a consensus on how to handle a short transfer ? Can we set the
> resid field and report an error ? Will the data be transfered up
> nevertheless ?
This depends a lot on the upper level drivers. Offhand I don't know for
certain. Some (such as tape and generics) will probably handle it
correctly. Disk and cdrom probably won't.
> 5. Under which conditions is an error reported to user space ?
That depends a lot. On the nature of the error, the type of device and
which driver (generics, disk, etc) is pushing the command through. There
are some types of failures for which the mid-level will retry the operation
a limited number of times. Others are passed directly through to the upper
level.
> 6. Is gathering sense data still optional ?
Technically yes, but it is strongly encouraged. There will be a
performance penalty if you fail to gather sense data in that the error
handler thread will have to wake up and request it, and all I/O to the bus
will be blocked while this is taking place.
-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu