diff options
| -rw-r--r-- | drivers/dma/ioat_dma.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 068b63514525..5905cd36bcd2 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c | |||
| @@ -1363,6 +1363,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
| 1363 | dma_cookie_t cookie; | 1363 | dma_cookie_t cookie; |
| 1364 | int err = 0; | 1364 | int err = 0; |
| 1365 | struct completion cmp; | 1365 | struct completion cmp; |
| 1366 | unsigned long tmo; | ||
| 1366 | 1367 | ||
| 1367 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); | 1368 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); |
| 1368 | if (!src) | 1369 | if (!src) |
| @@ -1414,9 +1415,10 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
| 1414 | } | 1415 | } |
| 1415 | device->common.device_issue_pending(dma_chan); | 1416 | device->common.device_issue_pending(dma_chan); |
| 1416 | 1417 | ||
| 1417 | wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); | 1418 | tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); |
| 1418 | 1419 | ||
| 1419 | if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) | 1420 | if (tmo == 0 || |
| 1421 | device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) | ||
| 1420 | != DMA_SUCCESS) { | 1422 | != DMA_SUCCESS) { |
| 1421 | dev_err(&device->pdev->dev, | 1423 | dev_err(&device->pdev->dev, |
| 1422 | "Self-test copy timed out, disabling\n"); | 1424 | "Self-test copy timed out, disabling\n"); |
