summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2008-04-17 12:29:35 +0000
committersos <sos@FreeBSD.org>2008-04-17 12:29:35 +0000
commitb11f9dd52aac5645107b2d8cb24361e9495b17d6 (patch)
treeb12f34c4c9498ff9f554b3fab04f8ac66236b802 /sys/dev/ata/ata-pci.c
parent3f4fde5950af141f4f874f9172842398de81e11d (diff)
downloadFreeBSD-src-b11f9dd52aac5645107b2d8cb24361e9495b17d6.zip
FreeBSD-src-b11f9dd52aac5645107b2d8cb24361e9495b17d6.tar.gz
Go back to preallocating everything possible on init.
This avoids calling busdma in the request processing path which caused a traumatic performance degradation. Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index ab5342b..cb964fb 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -464,7 +464,7 @@ ata_pci_dmastart(struct ata_request *request)
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, request->dma.sg_bus);
+ ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, request->dma->sg_bus);
ch->dma.flags |= ATA_DMA_ACTIVE;
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
(ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_WRITE_READ) |
@@ -609,17 +609,17 @@ ata_pcichannel_attach(device_t dev)
struct ata_channel *ch = device_get_softc(dev);
int error;
- if (ctlr->dmainit) {
+ if (ctlr->dmainit)
ctlr->dmainit(dev);
- ch->dma.alloc(dev);
- }
- if ((error = ctlr->allocate(dev))) {
- ch->dma.free(dev);
+ if ((error = ctlr->allocate(dev)))
return error;
- }
- return ata_attach(dev);
+ if ((error = ata_attach(dev)))
+ return error;
+
+ ch->dma.alloc(dev);
+ return 0;
}
static int
OpenPOWER on IntegriCloud