Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi In cdopen: make the test for media presence a...



details:   https://anonhg.NetBSD.org/src/rev/2e45777cae12
branches:  trunk
changeset: 779144:2e45777cae12
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 06 16:42:19 2012 +0000

description:
In cdopen: make the test for media presence always silent. In all cases
requiring a message, we will most likely get that from the spinup attempt
anyway.
This avoids the spurious "Check Condition on CDB, Not Ready, Medium Not
Present, Tray Closed" messages at boot/shutdown time.

diffstat:

 sys/dev/scsipi/cd.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (50 lines):

diff -r edd6b1a6f9ce -r 2e45777cae12 sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Sun May 06 16:33:02 2012 +0000
+++ b/sys/dev/scsipi/cd.c       Sun May 06 16:42:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $  */
+/*     $NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -382,17 +382,10 @@
                        goto bad3;
                }
        } else {
-               int silent;
-
-               if (rawpart)
-                       silent = XS_CTL_SILENT;
-               else
-                       silent = 0;
-
                /* Check that it is still responding and ok. */
                error = scsipi_test_unit_ready(periph,
                    XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_MEDIA_CHANGE |
-                   silent);
+                   XS_CTL_SILENT);
 
                /*
                 * Start the pack spinning if necessary. Always allow the
@@ -401,6 +394,12 @@
                 */
                if (error == EIO) {
                        int error2;
+                       int silent;
+
+                       if (rawpart)
+                               silent = XS_CTL_SILENT;
+                       else
+                               silent = 0;
 
                        error2 = scsipi_start(periph, SSS_START, silent);
                        switch (error2) {



Home | Main Index | Thread Index | Old Index