Reduce the amount of memory reported to busdma.

This made the requirements for bouncebuffers too big with PAE.
Cleanup the way size defines for transfers are implemented.
This commit is contained in:
Søren Schmidt 2004-09-10 10:31:37 +00:00
parent ca219d048a
commit 1d535cd590
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135034
2 changed files with 10 additions and 8 deletions

View file

@ -546,7 +546,7 @@ ata_cyrix_setmode(struct ata_device *atadev, int mode)
int error;
atadev->channel->dma->alignment = 16;
atadev->channel->dma->max_iosize = 63 * 1024;
atadev->channel->dma->max_iosize = 126 * DEV_BSIZE;
mode = ata_limit_mode(atadev, mode, ATA_UDMA2);
@ -1067,7 +1067,7 @@ ata_national_setmode(struct ata_device *atadev, int mode)
int error;
atadev->channel->dma->alignment = 16;
atadev->channel->dma->max_iosize = 63 * 1024;
atadev->channel->dma->max_iosize = 126 * DEV_BSIZE;
mode = ata_limit_mode(atadev, mode, ATA_UDMA2);
@ -2157,8 +2157,10 @@ ata_sii_allocate(device_t dev, struct ata_channel *ch)
if (ctlr->chip->max_dma >= ATA_SA150)
ch->flags |= ATA_NO_SLAVE;
if ((ctlr->chip->cfg2 & SIIBUG) && ch->dma)
ch->dma->boundary = 8 * 1024;
if ((ctlr->chip->cfg2 & SIIBUG) && ch->dma) {
ch->dma->boundary = 16 * DEV_BSIZE;
ch->dma->max_iosize = 15 * DEV_BSIZE;
}
ata_generic_hw(ch);

View file

@ -75,8 +75,8 @@ ata_dmainit(struct ata_channel *ch)
ch->dma->load = ata_dmaload;
ch->dma->unload = ata_dmaunload;
ch->dma->alignment = 2;
ch->dma->max_iosize = 64 * 1024;
ch->dma->boundary = 64 * 1024;
ch->dma->max_iosize = 128 * DEV_BSIZE;
ch->dma->boundary = 128 * DEV_BSIZE;
}
}
@ -96,7 +96,7 @@ ata_dmaalloc(struct ata_channel *ch)
if (bus_dma_tag_create(NULL, ch->dma->alignment, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, 16*1024*1024,
NULL, NULL, 256 * DEV_BSIZE,
ATA_DMA_ENTRIES, ch->dma->max_iosize,
BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->dmatag))
goto error;
@ -109,7 +109,7 @@ ata_dmaalloc(struct ata_channel *ch)
if (bus_dma_tag_create(ch->dma->dmatag,ch->dma->alignment,ch->dma->boundary,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
NULL, NULL, 16*1024*1024,
NULL, NULL, 256 * DEV_BSIZE,
ATA_DMA_ENTRIES, ch->dma->max_iosize,
BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->ddmatag))
goto error;