From fce282444d186f06f7656d21a2a2ffea2ce7ed9c Mon Sep 17 00:00:00 2001 From: ken Date: Sun, 9 May 1999 01:25:34 +0000 Subject: 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 --- sys/cam/cam_periph.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'sys/cam/cam_periph.c') 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 @@ -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: -- cgit v1.1