Commit 0c33e1ca authored by Dan Williams's avatar Dan Williams

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: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 211a22ce
...@@ -1363,6 +1363,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) ...@@ -1363,6 +1363,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
dma_cookie_t cookie; dma_cookie_t cookie;
int err = 0; int err = 0;
struct completion cmp; struct completion cmp;
unsigned long tmo;
src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL);
if (!src) if (!src)
...@@ -1414,9 +1415,10 @@ static int ioat_dma_self_test(struct ioatdma_device *device) ...@@ -1414,9 +1415,10 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
} }
device->common.device_issue_pending(dma_chan); 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) { != DMA_SUCCESS) {
dev_err(&device->pdev->dev, dev_err(&device->pdev->dev,
"Self-test copy timed out, disabling\n"); "Self-test copy timed out, disabling\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment