summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2017-10-10 21:37:49 +0000
committerjdolecek <jdolecek@NetBSD.org>2017-10-10 21:37:49 +0000
commit34bb73b8635f54512893d5f63d9520c1d159e285 (patch)
tree3aed308ada7679a80a3817d7f0222386907aff76 /sys/dev
parent74895bf04ed8ea6ce20424c9d7ef646f04aab0f9 (diff)
revert the logic in wdc_atapi_intr() for wdc_wait_for_unbusy() to what it
was before NCQ merge; it got broken during the efford to remove ch_status and ch_error on the branch fixes atapi timeouts in vbox and with real harware reported separately by Abhinav Upadhyay, Pault Goyette, Chavdar Ivanov, and Rares Aioanei; with a bit of luck it could also fix PR kern/52605 and/or PR kern/52606 by Martin Husemann
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/scsipi/atapi_wdc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c
index 5242b9eb51c..edc93c7d659 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.127 2017/10/08 21:33:38 christos Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.128 2017/10/10 21:37:49 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.127 2017/10/08 21:33:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.128 2017/10/10 21:37:49 jdolecek Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@@ -727,7 +727,7 @@ wdc_atapi_poll(struct ata_channel *chp, struct ata_xfer *xfer)
}
static int
-wdc_atapi_intr(struct ata_channel *chp, struct ata_xfer *xfer, int is)
+wdc_atapi_intr(struct ata_channel *chp, struct ata_xfer *xfer, int irq)
{
struct atac_softc *atac = chp->ch_atac;
struct wdc_softc *wdc = CHAN_TO_WDC(chp);
@@ -736,7 +736,6 @@ wdc_atapi_intr(struct ata_channel *chp, struct ata_xfer *xfer, int is)
struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
int len, phase, i, retries=0;
int ire, tfd;
- int poll = ((xfer->c_flags & C_POLL) != 0);
#if NATA_DMA
int error;
#endif
@@ -792,8 +791,8 @@ wdc_atapi_intr(struct ata_channel *chp, struct ata_xfer *xfer, int is)
bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
if (wdc_wait_for_unbusy(chp,
- poll ? sc_xfer->timeout : 0, AT_POLL, &tfd) == WDCWAIT_TOUT) {
- if (!poll && (xfer->c_flags & C_TIMEOU) == 0) {
+ (irq == 0) ? sc_xfer->timeout : 0, AT_POLL, &tfd) == WDCWAIT_TOUT) {
+ if (irq && (xfer->c_flags & C_TIMEOU) == 0) {
ata_channel_unlock(chp);
return 0; /* IRQ was not for us */
}