From 42e275be0f7ce08a9fe2adf4815f7fd926a341bb Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 8 Feb 2010 22:49:32 +0000 Subject: vpmadt032,wcte12xp: Use a timeout on the read/write commands and during load. It is possible for poorly behaving hardware (and driver bugs) to lockup the modprobe process by having it wait indefinitely for a command to complete that never will. DAHDI-451. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8003 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/dahdi/vpmadt032_loader') diff --git a/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c b/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c index d64931f..2aa15e9 100644 --- a/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c +++ b/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c @@ -116,13 +116,17 @@ static int vpmadt032_load_firmware(struct voicebus *vb) pci_set_drvdata(vb->pdev, ctx); old = vb->ops; vb->ops = &loader_operations; - wait_for_completion(&ctx->done); + if (wait_for_completion_timeout(&ctx->done, HZ*2)) { + dev_err(&vb->pdev->dev, + "Timeout waiting for load in %s.\n", __func__); + ret = -EIO; + } vb->ops = old; pci_set_drvdata(vb->pdev, old_drvdata); __vpmadt032_cleanup(ctx->pvt); error_exit: kfree(ctx); - return 0; + return ret; } static struct vpmadt_loader loader = { -- cgit v1.2.3