diff options
author | joerg <joerg@FreeBSD.org> | 1996-12-24 11:35:24 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-12-24 11:35:24 +0000 |
commit | 6d981da88aecfa97972620eeeeb16bb7028934d4 (patch) | |
tree | 32ffefb0804834b51fbeddcd525efef184344384 /sys/scsi | |
parent | 92da8dac3dc75774ad4be9c2ce144368c0fc49ec (diff) | |
download | FreeBSD-src-6d981da88aecfa97972620eeeeb16bb7028934d4.zip FreeBSD-src-6d981da88aecfa97972620eeeeb16bb7028934d4.tar.gz |
Slightly re-order the sequence of commands issued, so try to send
the START UNIT command before testing whether the device is ready.
Maybe it should be done even earlier, i'm not 100 % sure.
Again, CD changers will most likely benefit from it.
While i was at it, also made the debugging case a little more verbose
about why the cdopen() yielded an ENXIO. (Only in effect when
SCSIDEBUG is specified.)
Should eventually also go into 2.2.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 1661e55..783bcf9 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: cd.c,v 1.73 1996/09/06 23:09:06 phk Exp $ + * $Id: cd.c,v 1.74 1996/12/13 07:55:14 jkh Exp $ */ #include "opt_bounce.h" @@ -274,12 +274,16 @@ cd_open(dev_t dev, int flags, int fmt, struct proc *p, * forbid re-entry. (may have changed media) */ if ((!(sc_link->flags & SDEV_MEDIA_LOADED)) - && (cd->openparts)) + && (cd->openparts)) { + SC_DEBUG(sc_link, SDEV_DB2, ("unit attn, but openparts?\n")); return (ENXIO); + } /* - * This time actually take notice of error returns + * Start the drive, and take notice of error returns. */ + scsi_start_unit(sc_link, CD_START); + SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted ")); sc_link->flags |= SDEV_OPEN; /* unit attn errors are now errors */ if (scsi_test_unit_ready(sc_link, SCSI_SILENT) != 0) { SC_DEBUG(sc_link, SDEV_DB3, ("not ready\n")); @@ -287,14 +291,7 @@ cd_open(dev_t dev, int flags, int fmt, struct proc *p, goto bad; } SC_DEBUG(sc_link, SDEV_DB3, ("Device present\n")); - /* - * In case it is a funny one, tell it to start - * not needed for some drives - * failure here is ignored. - */ - scsi_start_unit(sc_link, CD_START); scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT); - SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted ")); /* * Load the physical device parameters */ |