Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358479
b: refs/heads/master
c: 522d974
h: refs/heads/master
i:
  358477: 0e779e2
  358475: f6c6ee4
  358471: f8736a7
  358463: b2d6f93
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Vinod Koul committed Jan 8, 2013
1 parent 90b80eb commit 8d9376f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35fa4dbc8c877c69144736cfe144a95a1e7ccc1a
refs/heads/master: 522d974451743abcf674cbebd7c29d44fbd63586
11 changes: 7 additions & 4 deletions trunk/drivers/dma/ioat/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,14 +833,14 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device)

dma_src = dma_map_single(dev, src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
dma_dest = dma_map_single(dev, dest, IOAT_TEST_SIZE, DMA_FROM_DEVICE);
flags = DMA_COMPL_SRC_UNMAP_SINGLE | DMA_COMPL_DEST_UNMAP_SINGLE |
flags = DMA_COMPL_SKIP_SRC_UNMAP | DMA_COMPL_SKIP_DEST_UNMAP |
DMA_PREP_INTERRUPT;
tx = device->common.device_prep_dma_memcpy(dma_chan, dma_dest, dma_src,
IOAT_TEST_SIZE, flags);
if (!tx) {
dev_err(dev, "Self-test prep failed, disabling\n");
err = -ENODEV;
goto free_resources;
goto unmap_dma;
}

async_tx_ack(tx);
Expand All @@ -851,7 +851,7 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device)
if (cookie < 0) {
dev_err(dev, "Self-test setup failed, disabling\n");
err = -ENODEV;
goto free_resources;
goto unmap_dma;
}
dma->device_issue_pending(dma_chan);

Expand All @@ -862,14 +862,17 @@ int __devinit ioat_dma_self_test(struct ioatdma_device *device)
!= DMA_SUCCESS) {
dev_err(dev, "Self-test copy timed out, disabling\n");
err = -ENODEV;
goto free_resources;
goto unmap_dma;
}
if (memcmp(src, dest, IOAT_TEST_SIZE)) {
dev_err(dev, "Self-test copy failed compare, disabling\n");
err = -ENODEV;
goto free_resources;
}

unmap_dma:
dma_unmap_single(dev, dma_src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
dma_unmap_single(dev, dma_dest, IOAT_TEST_SIZE, DMA_FROM_DEVICE);
free_resources:
dma->device_free_chan_resources(dma_chan);
out:
Expand Down

0 comments on commit 8d9376f

Please sign in to comment.