diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-12-03 17:16:55 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-14 09:44:04 -0800 |
commit | 3eb62a1a8c1655cf88e44158938a28ef774fdc08 (patch) | |
tree | ed90083bbafe751f0babeb08a056585435379882 /drivers | |
parent | ad4efe4fc5363e79bf6db87b012b73189806f4c7 (diff) | |
download | lwn-3eb62a1a8c1655cf88e44158938a28ef774fdc08.tar.gz lwn-3eb62a1a8c1655cf88e44158938a28ef774fdc08.zip |
ioat: wait for self-test completion
commit 532d3b1f86f41834a25373e3ded981d68e4ce17f upstream.
As part of the ioat_dma self-test it performs a printk from a completion
callback. Depending on the system console configuration this output can
take longer than a millisecond causing the self-test to fail. Introduce a
completion with a generous timeout to mitigate this failure.
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/ioat_dma.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 3f4db5460d1a..56790f8b17b7 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c @@ -1337,10 +1337,12 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan) */ #define IOAT_TEST_SIZE 2000 +DECLARE_COMPLETION(test_completion); static void ioat_dma_test_callback(void *dma_async_param) { printk(KERN_ERR "ioatdma: ioat_dma_test_callback(%p)\n", dma_async_param); + complete(&test_completion); } /** @@ -1406,7 +1408,8 @@ static int ioat_dma_self_test(struct ioatdma_device *device) goto free_resources; } device->common.device_issue_pending(dma_chan); - msleep(1); + + wait_for_completion_timeout(&test_completion, msecs_to_jiffies(3000)); if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { |