diff options
author | sos <sos@FreeBSD.org> | 2004-09-26 11:42:42 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2004-09-26 11:42:42 +0000 |
commit | 63d0be90512a6c68562d6dbe85d2a21993ba4fe2 (patch) | |
tree | 89a4d70e1f3707d5bc66f068e0ae0f08b5d01699 /sys/dev/ata | |
parent | 97e26f3fc1a8dc3c9a416de7369d5d31c390c071 (diff) | |
download | FreeBSD-src-63d0be90512a6c68562d6dbe85d2a21993ba4fe2.zip FreeBSD-src-63d0be90512a6c68562d6dbe85d2a21993ba4fe2.tar.gz |
Rearrange the order of I/O's in dma-start/stop, some chipsets are very
picky on the order of this, especially in error situations.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 07b2208..416afbe 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -436,11 +436,11 @@ ata_pci_dmastart(struct ata_channel *ch) ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) | (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab); + ch->dma->flags |= ATA_DMA_ACTIVE; ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, (ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_WRITE_READ) | ((ch->dma->flags & ATA_DMA_READ) ? ATA_BMCMD_WRITE_READ : 0) | ATA_BMCMD_START_STOP); - ch->dma->flags |= ATA_DMA_ACTIVE; return 0; } @@ -449,10 +449,10 @@ ata_pci_dmastop(struct ata_channel *ch) { int error; - error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP); ch->dma->flags &= ~ATA_DMA_ACTIVE; + error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR); return error; } |