summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-04-26 23:29:17 +0000
committerShaun Ruffell <sruffell@digium.com>2010-04-26 23:29:17 +0000
commite45dca02173d7a4e80e350fd3a0166c3e49c21d9 (patch)
tree987ed2e1e2ad0df647c547da552c2385bd711cfb /drivers/dahdi/voicebus
parentf38973bc196b3e6eaf1f26c7e4984f4a5379f149 (diff)
wcte12xp, wctdm24xxp: Retry if the VPMADT032 reports not ready.
CheckDspReset can return -1 if the DSP is not ready to process any new commands. In this case we should retry a few times to give the DSP a chance to become ready. While I'm not ready to say this definitely fixes recently reported cases when the wcte12xp driver constantly resets, it eliminated communication failures to the DSP module when under stress (via the vpm_firmware_version sysfs attribute). However, I haven't let it run long enough to say that the issue is resolved. DAHDI-603. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8576 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/voicebus')
-rw-r--r--drivers/dahdi/voicebus/GpakApi.c17
-rw-r--r--drivers/dahdi/voicebus/GpakCust.c1
-rw-r--r--drivers/dahdi/voicebus/GpakCust.h1
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/dahdi/voicebus/GpakApi.c b/drivers/dahdi/voicebus/GpakApi.c
index 4b480ab..a44834b 100644
--- a/drivers/dahdi/voicebus/GpakApi.c
+++ b/drivers/dahdi/voicebus/GpakApi.c
@@ -102,7 +102,6 @@ static DSP_ADDRESS pEventFifoAddress[MAX_DSP_CORES]; /* event fifo */
static unsigned char DlByteBufr[DOWNLOAD_BLOCK_SIZE * 2]; /* Dowload byte buf */
static DSP_WORD DlWordBufr[DOWNLOAD_BLOCK_SIZE]; /* Dowload word buffer */
-
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* CheckDspReset - Check if the DSP was reset.
*
@@ -116,7 +115,7 @@ static DSP_WORD DlWordBufr[DOWNLOAD_BLOCK_SIZE]; /* Dowload word buffer */
* 1 = Reset occurred.
*
*/
-static int CheckDspReset(
+static int __CheckDspReset(
int DspId /* DSP Identifier (0 to MaxDSPCores-1) */
)
{
@@ -179,6 +178,20 @@ static int CheckDspReset(
return (0);
}
+static int CheckDspReset(
+ int DspId /* DSP Identifier (0 to MaxDSPCores-1) */
+ )
+{
+ int ret;
+ int retries = 20;
+ while (--retries) {
+ ret = __CheckDspReset(DspId);
+ if (-1 != ret)
+ return ret;
+ msleep(5);
+ }
+ return ret;
+}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* WriteDspCmdMessage - Write a Host Command/Request message to DSP.
diff --git a/drivers/dahdi/voicebus/GpakCust.c b/drivers/dahdi/voicebus/GpakCust.c
index 67ece40..11453fc 100644
--- a/drivers/dahdi/voicebus/GpakCust.c
+++ b/drivers/dahdi/voicebus/GpakCust.c
@@ -32,7 +32,6 @@
#include <linux/version.h>
#include <linux/types.h>
-#include <linux/delay.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
#include <linux/semaphore.h>
diff --git a/drivers/dahdi/voicebus/GpakCust.h b/drivers/dahdi/voicebus/GpakCust.h
index 915a642..2b28480 100644
--- a/drivers/dahdi/voicebus/GpakCust.h
+++ b/drivers/dahdi/voicebus/GpakCust.h
@@ -39,6 +39,7 @@
#include <linux/device.h>
#include <linux/completion.h>
#include <linux/workqueue.h>
+#include <linux/delay.h>
#include "gpakenum.h"
#include "adt_lec.h"