summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pciide.c
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2002-03-01 20:01:36 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2002-03-01 20:01:36 +0000
commitd0281a3ced86b9f7541ca7166fb7e3371be66794 (patch)
treeb577e5efccd9842a3404247b3f3a8b11e4155d81 /sys/dev/pci/pciide.c
parentd698988afd41f93ed0b3ec284b3bddca19793a0e (diff)
From NetBSD, noticed by Alexander Yurchenko
"In hpt_pci_intr(): There is interrupt pending once IDEDMA_CTL_ACT is turned off. It seems that IDEDMA_CTL_INTR is asserted before DMA transfer is complete, leading to race condition in case of interrupt sharing. Discovered reading the FreeBSD code."
Diffstat (limited to 'sys/dev/pci/pciide.c')
-rw-r--r--sys/dev/pci/pciide.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index f875c3ad59f..b77fd0907c3 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.78 2002/02/16 08:18:57 chris Exp $ */
+/* $OpenBSD: pciide.c,v 1.79 2002/03/01 20:01:35 chris Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -3610,7 +3610,8 @@ hpt_pci_intr(arg)
for (i = 0; i < sc->sc_wdcdev.nchannels; i++) {
dmastat = bus_space_read_1(sc->sc_dma_iot, sc->sc_dma_ioh,
IDEDMA_CTL + IDEDMA_SCH_OFFSET * i);
- if ((dmastat & IDEDMA_CTL_INTR) == 0)
+ if((dmastat & ( IDEDMA_CTL_ACT | IDEDMA_CTL_INTR)) !=
+ IDEDMA_CTL_INTR)
continue;
cp = &sc->pciide_channels[i];
wdc_cp = &cp->wdc_channel;