diff options
author | Nicholas Mc Guire <der.herr@hofr.at> | 2015-01-08 15:16:35 +0100 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-05 07:54:22 +0100 |
commit | 12385f458a27fe46da31483ed9f9ec5e9da575e7 (patch) | |
tree | 5506b1e73ec7b221198f159cacf6b6b04663f88b /drivers/dma/ioat | |
parent | dmaengine: dw: define DW_DMA_MAX_NR_MASTERS (diff) | |
download | linux-12385f458a27fe46da31483ed9f9ec5e9da575e7.tar.xz linux-12385f458a27fe46da31483ed9f9ec5e9da575e7.zip |
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: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ioat')
-rw-r--r-- | drivers/dma/ioat/dma_v3.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c index 61510abfabb7..77a6dcf25b98 100644 --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c @@ -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)); - 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"); err = -ENODEV; goto dma_unmap; @@ -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)); - 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"); err = -ENODEV; goto dma_unmap; @@ -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)); - 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"); err = -ENODEV; goto dma_unmap; |