Skip to content

Commit

Permalink
ioat: fail self-test if wait_for_completion times out
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicholas Mc Guire authored and Vinod Koul committed Feb 5, 2015
1 parent d8ded50 commit 12385f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/dma/ioat/dma_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 12385f4

Please sign in to comment.