Merge branch 'topic/ioat' into for-linus

This commit is contained in:
Vinod Koul 2016-12-14 09:06:23 +05:30
commit 3f809e844c
2 changed files with 18 additions and 11 deletions

View File

@ -39,6 +39,7 @@
#include "../dmaengine.h" #include "../dmaengine.h"
static char *chanerr_str[] = { static char *chanerr_str[] = {
"DMA Transfer Source Address Error",
"DMA Transfer Destination Address Error", "DMA Transfer Destination Address Error",
"Next Descriptor Address Error", "Next Descriptor Address Error",
"Descriptor Error", "Descriptor Error",
@ -66,7 +67,6 @@ static char *chanerr_str[] = {
"Result Guard Tag verification Error", "Result Guard Tag verification Error",
"Result Application Tag verification Error", "Result Application Tag verification Error",
"Result Reference Tag verification Error", "Result Reference Tag verification Error",
NULL
}; };
static void ioat_eh(struct ioatdma_chan *ioat_chan); static void ioat_eh(struct ioatdma_chan *ioat_chan);
@ -75,13 +75,10 @@ static void ioat_print_chanerrs(struct ioatdma_chan *ioat_chan, u32 chanerr)
{ {
int i; int i;
for (i = 0; i < 32; i++) { for (i = 0; i < ARRAY_SIZE(chanerr_str); i++) {
if ((chanerr >> i) & 1) { if ((chanerr >> i) & 1) {
if (chanerr_str[i]) { dev_err(to_dev(ioat_chan), "Err(%d): %s\n",
dev_err(to_dev(ioat_chan), "Err(%d): %s\n", i, chanerr_str[i]);
i, chanerr_str[i]);
} else
break;
} }
} }
} }

View File

@ -340,11 +340,13 @@ static int ioat_dma_self_test(struct ioatdma_device *ioat_dma)
dma_src = dma_map_single(dev, src, IOAT_TEST_SIZE, DMA_TO_DEVICE); dma_src = dma_map_single(dev, src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma_src)) { if (dma_mapping_error(dev, dma_src)) {
dev_err(dev, "mapping src buffer failed\n"); dev_err(dev, "mapping src buffer failed\n");
err = -ENOMEM;
goto free_resources; goto free_resources;
} }
dma_dest = dma_map_single(dev, dest, IOAT_TEST_SIZE, DMA_FROM_DEVICE); dma_dest = dma_map_single(dev, dest, IOAT_TEST_SIZE, DMA_FROM_DEVICE);
if (dma_mapping_error(dev, dma_dest)) { if (dma_mapping_error(dev, dma_dest)) {
dev_err(dev, "mapping dest buffer failed\n"); dev_err(dev, "mapping dest buffer failed\n");
err = -ENOMEM;
goto unmap_src; goto unmap_src;
} }
flags = DMA_PREP_INTERRUPT; flags = DMA_PREP_INTERRUPT;
@ -827,16 +829,20 @@ static int ioat_xor_val_self_test(struct ioatdma_device *ioat_dma)
op = IOAT_OP_XOR; op = IOAT_OP_XOR;
dest_dma = dma_map_page(dev, dest, 0, PAGE_SIZE, DMA_FROM_DEVICE); dest_dma = dma_map_page(dev, dest, 0, PAGE_SIZE, DMA_FROM_DEVICE);
if (dma_mapping_error(dev, dest_dma)) if (dma_mapping_error(dev, dest_dma)) {
err = -ENOMEM;
goto free_resources; goto free_resources;
}
for (i = 0; i < IOAT_NUM_SRC_TEST; i++) for (i = 0; i < IOAT_NUM_SRC_TEST; i++)
dma_srcs[i] = DMA_ERROR_CODE; dma_srcs[i] = DMA_ERROR_CODE;
for (i = 0; i < IOAT_NUM_SRC_TEST; i++) { for (i = 0; i < IOAT_NUM_SRC_TEST; i++) {
dma_srcs[i] = dma_map_page(dev, xor_srcs[i], 0, PAGE_SIZE, dma_srcs[i] = dma_map_page(dev, xor_srcs[i], 0, PAGE_SIZE,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma_srcs[i])) if (dma_mapping_error(dev, dma_srcs[i])) {
err = -ENOMEM;
goto dma_unmap; goto dma_unmap;
}
} }
tx = dma->device_prep_dma_xor(dma_chan, dest_dma, dma_srcs, tx = dma->device_prep_dma_xor(dma_chan, dest_dma, dma_srcs,
IOAT_NUM_SRC_TEST, PAGE_SIZE, IOAT_NUM_SRC_TEST, PAGE_SIZE,
@ -904,8 +910,10 @@ static int ioat_xor_val_self_test(struct ioatdma_device *ioat_dma)
for (i = 0; i < IOAT_NUM_SRC_TEST + 1; i++) { for (i = 0; i < IOAT_NUM_SRC_TEST + 1; i++) {
dma_srcs[i] = dma_map_page(dev, xor_val_srcs[i], 0, PAGE_SIZE, dma_srcs[i] = dma_map_page(dev, xor_val_srcs[i], 0, PAGE_SIZE,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma_srcs[i])) if (dma_mapping_error(dev, dma_srcs[i])) {
err = -ENOMEM;
goto dma_unmap; goto dma_unmap;
}
} }
tx = dma->device_prep_dma_xor_val(dma_chan, dma_srcs, tx = dma->device_prep_dma_xor_val(dma_chan, dma_srcs,
IOAT_NUM_SRC_TEST + 1, PAGE_SIZE, IOAT_NUM_SRC_TEST + 1, PAGE_SIZE,
@ -957,8 +965,10 @@ static int ioat_xor_val_self_test(struct ioatdma_device *ioat_dma)
for (i = 0; i < IOAT_NUM_SRC_TEST + 1; i++) { for (i = 0; i < IOAT_NUM_SRC_TEST + 1; i++) {
dma_srcs[i] = dma_map_page(dev, xor_val_srcs[i], 0, PAGE_SIZE, dma_srcs[i] = dma_map_page(dev, xor_val_srcs[i], 0, PAGE_SIZE,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma_srcs[i])) if (dma_mapping_error(dev, dma_srcs[i])) {
err = -ENOMEM;
goto dma_unmap; goto dma_unmap;
}
} }
tx = dma->device_prep_dma_xor_val(dma_chan, dma_srcs, tx = dma->device_prep_dma_xor_val(dma_chan, dma_srcs,
IOAT_NUM_SRC_TEST + 1, PAGE_SIZE, IOAT_NUM_SRC_TEST + 1, PAGE_SIZE,