summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchris <chris@openbsd.org>2002-03-01 20:01:35 +0000
committerchris <chris@openbsd.org>2002-03-01 20:01:35 +0000
commitfd06e7bd59a762cc89e51aa07195f975af39079c (patch)
treeab58018df67c4d8b74099ae2bc141c362800358a
parentChange a config(8) reference to a more appropriate boot_config(8) reference. (diff)
downloadwireguard-openbsd-fd06e7bd59a762cc89e51aa07195f975af39079c.tar.xz
wireguard-openbsd-fd06e7bd59a762cc89e51aa07195f975af39079c.zip
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."
-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;