diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-03-02 13:31:35 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-03-04 16:04:40 -0700 |
commit | 0c33e1ca3d80647f2e72e44524fd21e79214da20 (patch) | |
tree | 672be83761daef7e927ab6479c7bfa4986b12fbf /drivers | |
parent | 211a22ce08dbb27eb1a66df8a4bdae5e96092bc8 (diff) | |
download | op-kernel-dev-0c33e1ca3d80647f2e72e44524fd21e79214da20.zip op-kernel-dev-0c33e1ca3d80647f2e72e44524fd21e79214da20.tar.gz |
I/OAT: fail self-test if callback test reaches timeout
If we miss interrupts in the self test then fail registration of this
channel as it is unsuitable for use as a public channel.
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-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 068b635..5905cd3 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) dma_cookie_t cookie; int err = 0; struct completion cmp; + unsigned long tmo; src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); if (!src) @@ -1414,9 +1415,10 @@ static int ioat_dma_self_test(struct ioatdma_device *device) } device->common.device_issue_pending(dma_chan); - wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); + tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)); - if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) + if (tmo == 0 || + device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { dev_err(&device->pdev->dev, "Self-test copy timed out, disabling\n"); |