diff options
author | ken <ken@FreeBSD.org> | 1999-05-09 01:25:34 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1999-05-09 01:25:34 +0000 |
commit | fce282444d186f06f7656d21a2a2ffea2ce7ed9c (patch) | |
tree | ccc2498874709e9c885bfb9185013d6bf5a0d116 /sys/cam/cam_periph.c | |
parent | 4a4467575d5f4db43a083085e049267cfaf6ebeb (diff) | |
download | FreeBSD-src-fce282444d186f06f7656d21a2a2ffea2ce7ed9c.zip FreeBSD-src-fce282444d186f06f7656d21a2a2ffea2ce7ed9c.tar.gz |
Add a facility in the CAM error handling code to retry selection timeouts.
If the client requests that the error recovery code retry a selection
timeout, it will be retried after half a second. The delay is to give the
device time to recover.
For most of these drivers, I only added selection timeout retries where
they were also retrying unit attention type errors. The sa(4) driver calls
saerror() in a number of places, but most of them don't request retrying
unit attentions.
Also, bump the default minimum CD changer timeout from 2 to 5 seconds and
the maximum timeout from 10 to 15 seconds. Some Pioneer changers seem to
have trouble with the shorter timeout.
Reviewed by: gibbs
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 02c8785..d365a12 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cam_periph.c,v 1.11 1999/04/06 03:05:36 peter Exp $ + * $Id: cam_periph.c,v 1.12 1999/04/19 21:26:07 gibbs Exp $ */ #include <sys/param.h> @@ -1505,7 +1505,23 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, xpt_async(AC_LOST_DEVICE, newpath, NULL); xpt_free_path(newpath); #endif - error = ENXIO; + if ((sense_flags & SF_RETRY_SELTO) != 0) { + retry = ccb->ccb_h.retry_count > 0; + if (retry) { + ccb->ccb_h.retry_count--; + error = ERESTART; + /* + * Wait half a second to give the device + * time to recover before we try again. + */ + relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; + timeout = 500; + } else { + error = ENXIO; + } + } else { + error = ENXIO; + } break; } case CAM_REQ_INVALID: |