diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c index f2a997ea13df..551526270ec0 100644 --- a/sys/dev/scsipi/atapi_wdc.c +++ b/sys/dev/scsipi/atapi_wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: atapi_wdc.c,v 1.42 2001/06/13 18:17:41 bjh21 Exp $ */ +/* $NetBSD: atapi_wdc.c,v 1.43 2001/06/27 13:22:36 bouyer Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -754,7 +754,15 @@ again: xfer->c_bcount -= sc_xfer->datalen; } sc_xfer->resid = xfer->c_bcount; - if (chp->ch_status & WDCS_ERR) { + /* + * Some drive occasionally set WDCS_ERR with + * "ATA illegal length indication" in the error + * register. If we read some data the sense is valid + * anyway, so don't report the error. + */ + if (chp->ch_status & WDCS_ERR && + ((sc_xfer->xs_control & XS_CTL_REQSENSE) == 0 || + sc_xfer->resid == sc_xfer->datalen)) { /* save the short sense */ sc_xfer->error = XS_SHORTSENSE; sc_xfer->sense.atapi_sense = chp->ch_error;