Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi Fix a long-standing bug with the ACAP_* flags:
details: https://anonhg.NetBSD.org/src/rev/f2107b61625d
branches: trunk
changeset: 471699:f2107b61625d
user: bouyer <bouyer%NetBSD.org@localhost>
date: Thu Apr 08 11:29:01 1999 +0000
description:
Fix a long-standing bug with the ACAP_* flags:
- the cap field is a u_int8_t, so none of the defined flags would fit in.
Looks like nobody had a drive using 16 bytes commands.
- the ACAP_DRQ_* flags are all wrong. Just remove them and use the definitions
from ata/atareg.h, there's no need to duplicate theses. The effect of this
was that we were always polling for the command phase, even for drives
with interrupt DRQ. This didn't break until the code was changed to support
shared interrupts.
Should fix the lookup problems or 'boot hangs' reported by some users, and
kern/7111.
diffstat:
sys/dev/scsipi/atapi_wdc.c | 9 ++++++---
sys/dev/scsipi/scsipiconf.h | 9 +++------
2 files changed, 9 insertions(+), 9 deletions(-)
diffs (49 lines):
diff -r 8723c2a25db0 -r f2107b61625d sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c Thu Apr 08 10:58:36 1999 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c Thu Apr 08 11:29:01 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.20 1999/04/01 21:46:30 bouyer Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.21 1999/04/08 11:29:01 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -278,11 +278,14 @@
* the interrupt routine. If it is a polled command, call the interrupt
* routine until command is done.
*/
- if ((sc_xfer->sc_link->scsipi_atapi.cap & 0x0300) != ACAP_DRQ_INTR ||
- sc_xfer->flags & SCSI_POLL) {
+ if ((sc_xfer->sc_link->scsipi_atapi.cap & ATAPI_CFG_DRQ_MASK) !=
+ ATAPI_CFG_IRQ_DRQ || (sc_xfer->flags & SCSI_POLL)) {
/* Wait for at last 400ns for status bit to be valid */
DELAY(1);
wdc_atapi_intr(chp, xfer, 0);
+ } else {
+ chp->ch_flags |= WDCF_IRQ_WAIT;
+ timeout(wdctimeout, chp, hz);
}
if (sc_xfer->flags & SCSI_POLL) {
while ((sc_xfer->flags & ITSDONE) == 0) {
diff -r 8723c2a25db0 -r f2107b61625d sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h Thu Apr 08 10:58:36 1999 +0000
+++ b/sys/dev/scsipi/scsipiconf.h Thu Apr 08 11:29:01 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipiconf.h,v 1.29 1999/01/19 10:57:11 bouyer Exp $ */
+/* $NetBSD: scsipiconf.h,v 1.30 1999/04/08 11:29:01 bouyer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -226,11 +226,8 @@
controller */
u_int8_t atapibus;
u_int8_t cap; /* drive capability */
-#define ACAP_DRQ_MPROC 0x0000 /* microprocessor DRQ */
-#define ACAP_DRQ_INTR 0x0200 /* interrupt DRQ */
-#define ACAP_DRQ_ACCEL 0x0400 /* accelerated DRQ */
-#define ACAP_DRQ_MASK 0x0600 /* same as in ataparams */
-#define ACAP_LEN 0x0100 /* 16 bit commands */
+/* 0x20-0x40 reserved for ATAPI_CFG_DRQ_MASK */
+#define ACAP_LEN 0x01 /* 16 bit commands */
} scsipi_atapi;
} _scsipi_link;
TAILQ_HEAD(, scsipi_xfer) pending_xfers;
Home |
Main Index |
Thread Index |
Old Index