summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2005-10-17 06:43:49 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2005-10-17 06:43:49 +0000
commit020b3b581397f0d1fcdd8a656e46560a0d05bff8 (patch)
treed0c2d5f43188d40df65b588dac8289fb98c5152f /sys
parent6e34bd14ea77fddd7cf87abf6cf4eba3adcb1104 (diff)
Don't clear dma_in_progress flag too early, noticed by jason@.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pciide.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index f6d6cc4e6df..656fe91c614 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.208 2005/10/17 06:35:17 grange Exp $ */
+/* $OpenBSD: pciide.c,v 1.209 2005/10/17 06:43:48 grange Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -1464,14 +1464,14 @@ pciide_dma_finish(void *v, int channel, int drive, int force)
struct pciide_dma_maps *dma_maps =
&sc->pciide_channels[channel].dma_maps[drive];
- sc->pciide_channels[channel].dma_in_progress = 0;
-
status = PCIIDE_DMACTL_READ(sc, channel);
WDCDEBUG_PRINT(("pciide_dma_finish: status 0x%x\n", status),
DEBUG_XFERS);
- if (force == 0 && (status & IDEDMA_CTL_INTR) == 0)
- return (WDC_DMAST_NOIRQ);
+ if (force == 0 && (status & IDEDMA_CTL_INTR) == 0) {
+ error = WDC_DMAST_NOIRQ;
+ goto done;
+ }
/* stop DMA channel */
PCIIDE_DMACMD_WRITE(sc, channel,
@@ -1505,6 +1505,9 @@ pciide_dma_finish(void *v, int channel, int drive, int force)
/* data underrun, may be a valid condition for ATAPI */
error |= WDC_DMAST_UNDER;
}
+
+done:
+ sc->pciide_channels[channel].dma_in_progress = 0;
return (error);
}