lkml.org 
[lkml]   [2014]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ioat: fail self-test if wait_for_completion times out
Date
wait_for_completion_timeout reaching timeout was being ignored,
fail the self-test if timeout condition occurs.

Not sure about the indentations used (CodingStyle:Chapter 2)

this was only compile tested with
x86_64_defconfig + CONFIG_DMA_ENGINE=y + CONFIG_INTEL_IOATDMA=y

patch is against linux-next 3.19.0-rc1 -next-20141226

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
drivers/dma/ioat/dma_v3.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
index be307182..0659215 100644
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -1311,7 +1311,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;
@@ -1377,7 +1378,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;
@@ -1429,7 +1431,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;
--
1.7.10.4


\
 
 \ /
  Last update: 2014-12-28 12:01    [W:0.103 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site