Commit 12385f45 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Vinod Koul

ioat: fail self-test if wait_for_completion times out

wait_for_completion_timeout reaching timeout was being ignored,
fail the self-test if timeout condition occurs.

v2: fixup of coding style issues.
Signed-off-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
Acked-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarPrarit Bhargava <prarit@redhat.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent d8ded50f
...@@ -1316,7 +1316,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device) ...@@ -1316,7 +1316,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) { if (tmo == 0 ||
dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
dev_err(dev, "Self-test xor timed out\n"); dev_err(dev, "Self-test xor timed out\n");
err = -ENODEV; err = -ENODEV;
goto dma_unmap; goto dma_unmap;
...@@ -1382,7 +1383,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device) ...@@ -1382,7 +1383,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) { if (tmo == 0 ||
dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
dev_err(dev, "Self-test validate timed out\n"); dev_err(dev, "Self-test validate timed out\n");
err = -ENODEV; err = -ENODEV;
goto dma_unmap; goto dma_unmap;
...@@ -1434,7 +1436,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device) ...@@ -1434,7 +1436,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) { if (tmo == 0 ||
dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
dev_err(dev, "Self-test 2nd validate timed out\n"); dev_err(dev, "Self-test 2nd validate timed out\n");
err = -ENODEV; err = -ENODEV;
goto dma_unmap; goto dma_unmap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment