Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi Only lock the pack in if the disk device is a...



details:   https://anonhg.NetBSD.org/src/rev/e1f92642028a
branches:  trunk
changeset: 506949:e1f92642028a
user:      explorer <explorer%NetBSD.org@localhost>
date:      Fri Mar 09 16:07:39 2001 +0000

description:
Only lock the pack in if the disk device is a removable one.  This fixes a
problem with Hitachi SCA drives

diffstat:

 sys/dev/scsipi/sd.c |  23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 9564e27081b3 -r e1f92642028a sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Fri Mar 09 16:07:20 2001 +0000
+++ b/sys/dev/scsipi/sd.c       Fri Mar 09 16:07:39 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.169 2001/01/08 02:03:48 fvdl Exp $    */
+/*     $NetBSD: sd.c,v 1.170 2001/03/09 16:07:39 explorer Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -409,11 +409,14 @@
 
                sc_link->flags |= SDEV_OPEN;
 
-               /* Lock the pack in. */
-               error = scsipi_prevent(sc_link, PR_PREVENT,
-                   XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_MEDIA_CHANGE);
-               if (error)
-                       goto bad;
+               if (sd->sc_link->flags & SDEV_REMOVABLE) {
+                       /* Lock the pack in. */
+                       error = scsipi_prevent(sc_link, PR_PREVENT,
+                                              XS_CTL_IGNORE_ILLEGAL_REQUEST
+                                              | XS_CTL_IGNORE_MEDIA_CHANGE);
+                       if (error)
+                               goto bad;
+               }
 
                if ((sc_link->flags & SDEV_MEDIA_LOADED) == 0) {
                        sc_link->flags |= SDEV_MEDIA_LOADED;
@@ -526,8 +529,12 @@
 
                scsipi_wait_drain(sd->sc_link);
 
-               scsipi_prevent(sd->sc_link, PR_ALLOW,
-                   XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
+               if (sd->sc_link->flags & SDEV_REMOVABLE) {
+                       scsipi_prevent(sd->sc_link, PR_ALLOW,
+                                      XS_CTL_IGNORE_ILLEGAL_REQUEST
+                                      | XS_CTL_IGNORE_NOT_READY);
+               }
+
                sd->sc_link->flags &= ~SDEV_OPEN;
 
                if (! (sd->sc_link->flags & SDEV_KEEP_LABEL))



Home | Main Index | Thread Index | Old Index