Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Revert part of 1.102:



details:   https://anonhg.NetBSD.org/src/rev/7e8a4834228b
branches:  trunk
changeset: 566109:7e8a4834228b
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Apr 27 18:15:37 2004 +0000

description:
Revert part of 1.102:
Don't decrease/check xs_retries when the device report "Power On, Reset, or
Bus Device Reset" sense condition, just retry the command. The initial bus
reset would cause the first TEST_UNIT_READY to report this condition,
and as xs_retries is set to 0 when XS_CTL_DISCOVERY is set, it would report an
error instead of being retried, causing the disk probe to report "drive
offline" instead of the geometry and capacity. Checking/decreasing
xs_retries on the bus reset reported by the adapter is enouth to avoid the
problem reported by rev 1.102.

Problem analysed by Paul Kranenburg, fix confirmed by Anders Hjalmars,
and explaination as to why the INQUIRY wasn't affected by this provided by
Bill Studenmund.

diffstat:

 sys/dev/scsipi/scsipi_base.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (32 lines):

diff -r a831e6154393 -r 7e8a4834228b sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Tue Apr 27 17:51:17 2004 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Tue Apr 27 18:15:37 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.104 2004/03/16 19:10:43 bouyer Exp $ */
+/*     $NetBSD: scsipi_base.c,v 1.105 2004/04/27 18:15:37 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.104 2004/03/16 19:10:43 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.105 2004/04/27 18:15:37 bouyer Exp $");
 
 #include "opt_scsi.h"
 
@@ -938,12 +938,7 @@
                        if (sense->add_sense_code == 0x29 &&
                            sense->add_sense_code_qual == 0x00) {
                                /* device or bus reset */
-                               if (xs->xs_retries != 0) {
-                                       xs->xs_retries--;
-                                       error = ERESTART;
-                               } else
-                                       error = EIO;
-                               return (error);
+                               return (ERESTART);
                        }
                        if ((periph->periph_flags & PERIPH_REMOVABLE) != 0)
                                periph->periph_flags &= ~PERIPH_MEDIA_LOADED;



Home | Main Index | Thread Index | Old Index