summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-lowlevel.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2005-12-05 22:31:55 +0000
committersos <sos@FreeBSD.org>2005-12-05 22:31:55 +0000
commita35284f0f57f93a7260383e3f0f0eb546e54b4c2 (patch)
tree77ac7c1ac5479936f312bc0d8ba073c2123178d4 /sys/dev/ata/ata-lowlevel.c
parentaa9c5f3cddee28919e68f86222476ba0e47fb54e (diff)
downloadFreeBSD-src-a35284f0f57f93a7260383e3f0f0eb546e54b4c2.zip
FreeBSD-src-a35284f0f57f93a7260383e3f0f0eb546e54b4c2.tar.gz
Dont use the BUS_DMA_ALLOCNOW flag. Instead use BUS_DMA_NOWAIT and return
ENOMEM to the upper layers if we run out of memory. This solves part of the trouble with running on >4GB memory systems.
Diffstat (limited to 'sys/dev/ata/ata-lowlevel.c')
-rw-r--r--sys/dev/ata/ata-lowlevel.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 8ece605..2e79ae0 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -73,7 +73,7 @@ ata_begin_transaction(struct ata_request *request)
{
struct ata_channel *ch = device_get_softc(device_get_parent(request->dev));
struct ata_device *atadev = device_get_softc(request->dev);
- int dummy;
+ int dummy, error;
ATA_DEBUG_RQ(request, "begin transaction");
@@ -130,10 +130,11 @@ ata_begin_transaction(struct ata_request *request)
/* ATA DMA data transfer commands */
case ATA_R_DMA:
/* check sanity, setup SG list and DMA engine */
- if (ch->dma->load(ch->dev, request->data, request->bytecount,
- request->flags & ATA_R_READ, ch->dma->sg, &dummy)) {
+ if ((error = ch->dma->load(ch->dev, request->data, request->bytecount,
+ request->flags & ATA_R_READ, ch->dma->sg,
+ &dummy))) {
device_printf(request->dev, "setting up DMA failed\n");
- request->result = EIO;
+ request->result = error;
goto begin_finished;
}
@@ -184,10 +185,11 @@ ata_begin_transaction(struct ata_request *request)
}
/* check sanity, setup SG list and DMA engine */
- if (ch->dma->load(ch->dev, request->data, request->bytecount,
- request->flags & ATA_R_READ, ch->dma->sg, &dummy)) {
+ if ((error = ch->dma->load(ch->dev, request->data, request->bytecount,
+ request->flags & ATA_R_READ, ch->dma->sg,
+ &dummy))) {
device_printf(request->dev, "setting up DMA failed\n");
- request->result = EIO;
+ request->result = error;
goto begin_finished;
}
OpenPOWER on IntegriCloud