diff options
Diffstat (limited to 'drivers/dma/ioat_dma.c')
-rw-r--r-- | drivers/dma/ioat_dma.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 6607fdd00b1c..b3759c4b6536 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c | |||
@@ -734,8 +734,7 @@ static void ioat2_dma_massage_chan_desc(struct ioat_dma_chan *ioat_chan) | |||
734 | * ioat_dma_alloc_chan_resources - returns the number of allocated descriptors | 734 | * ioat_dma_alloc_chan_resources - returns the number of allocated descriptors |
735 | * @chan: the channel to be filled out | 735 | * @chan: the channel to be filled out |
736 | */ | 736 | */ |
737 | static int ioat_dma_alloc_chan_resources(struct dma_chan *chan, | 737 | static int ioat_dma_alloc_chan_resources(struct dma_chan *chan) |
738 | struct dma_client *client) | ||
739 | { | 738 | { |
740 | struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan); | 739 | struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan); |
741 | struct ioat_desc_sw *desc; | 740 | struct ioat_desc_sw *desc; |
@@ -1341,12 +1340,11 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan) | |||
1341 | */ | 1340 | */ |
1342 | #define IOAT_TEST_SIZE 2000 | 1341 | #define IOAT_TEST_SIZE 2000 |
1343 | 1342 | ||
1344 | DECLARE_COMPLETION(test_completion); | ||
1345 | static void ioat_dma_test_callback(void *dma_async_param) | 1343 | static void ioat_dma_test_callback(void *dma_async_param) |
1346 | { | 1344 | { |
1347 | printk(KERN_ERR "ioatdma: ioat_dma_test_callback(%p)\n", | 1345 | struct completion *cmp = dma_async_param; |
1348 | dma_async_param); | 1346 | |
1349 | complete(&test_completion); | 1347 | complete(cmp); |
1350 | } | 1348 | } |
1351 | 1349 | ||
1352 | /** | 1350 | /** |
@@ -1363,6 +1361,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1363 | dma_addr_t dma_dest, dma_src; | 1361 | dma_addr_t dma_dest, dma_src; |
1364 | dma_cookie_t cookie; | 1362 | dma_cookie_t cookie; |
1365 | int err = 0; | 1363 | int err = 0; |
1364 | struct completion cmp; | ||
1366 | 1365 | ||
1367 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); | 1366 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); |
1368 | if (!src) | 1367 | if (!src) |
@@ -1381,7 +1380,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1381 | dma_chan = container_of(device->common.channels.next, | 1380 | dma_chan = container_of(device->common.channels.next, |
1382 | struct dma_chan, | 1381 | struct dma_chan, |
1383 | device_node); | 1382 | device_node); |
1384 | if (device->common.device_alloc_chan_resources(dma_chan, NULL) < 1) { | 1383 | if (device->common.device_alloc_chan_resources(dma_chan) < 1) { |
1385 | dev_err(&device->pdev->dev, | 1384 | dev_err(&device->pdev->dev, |
1386 | "selftest cannot allocate chan resource\n"); | 1385 | "selftest cannot allocate chan resource\n"); |
1387 | err = -ENODEV; | 1386 | err = -ENODEV; |
@@ -1402,8 +1401,9 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | async_tx_ack(tx); | 1403 | async_tx_ack(tx); |
1404 | init_completion(&cmp); | ||
1405 | tx->callback = ioat_dma_test_callback; | 1405 | tx->callback = ioat_dma_test_callback; |
1406 | tx->callback_param = (void *)0x8086; | 1406 | tx->callback_param = &cmp; |
1407 | cookie = tx->tx_submit(tx); | 1407 | cookie = tx->tx_submit(tx); |
1408 | if (cookie < 0) { | 1408 | if (cookie < 0) { |
1409 | dev_err(&device->pdev->dev, | 1409 | dev_err(&device->pdev->dev, |
@@ -1413,7 +1413,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1413 | } | 1413 | } |
1414 | device->common.device_issue_pending(dma_chan); | 1414 | device->common.device_issue_pending(dma_chan); |
1415 | 1415 | ||
1416 | wait_for_completion_timeout(&test_completion, msecs_to_jiffies(3000)); | 1416 | wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
1417 | 1417 | ||
1418 | if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) | 1418 | if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) |
1419 | != DMA_SUCCESS) { | 1419 | != DMA_SUCCESS) { |