summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcte12xp
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:02:38 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:02:38 +0000
commit3d3560b06b36e6091d0e43c2144a8f2cdf8e3b8d (patch)
tree61e04eeeb771782d47355247893069d5339f53eb /drivers/dahdi/wcte12xp
parent63fe966c06ebc5584acf25754575e4f7ba453d07 (diff)
wcte12xp: Limit how many consecutive times to reset the VPMADT032 module.
Both limit the amount of junk in the kernel log and also prevent dahdi_cfg from running indefinitely if there is a module with a hardware problem which prevents it from completing the startup sequence. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9953 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp')
-rw-r--r--drivers/dahdi/wcte12xp/base.c11
-rw-r--r--drivers/dahdi/wcte12xp/wcte12xp.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 6ffb8ba..3139484 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -2145,6 +2145,16 @@ static void vpm_check_func(struct work_struct *work)
#endif
int res;
u16 version;
+ const int MAX_CHECKS = 5;
+
+ /* If there is a failed VPM module, do not block dahdi_cfg
+ * indefinitely. */
+ if (++wc->vpm_check_count > MAX_CHECKS) {
+ set_bit(READY, &wc->bit_flags);
+ wc->vpm_check = MAX_JIFFY_OFFSET;
+ t1_info(wc, "Disabling VPMADT032 Checking.\n");
+ return;
+ }
if (!test_bit(INITIALIZED, &wc->bit_flags))
return;
@@ -2154,6 +2164,7 @@ static void vpm_check_func(struct work_struct *work)
if (!res) {
set_bit(VPM150M_ACTIVE, &wc->ctlreg);
wc->vpm_check = jiffies + HZ*5;
+ wc->vpm_check_count = 0;
return;
}
diff --git a/drivers/dahdi/wcte12xp/wcte12xp.h b/drivers/dahdi/wcte12xp/wcte12xp.h
index 3630478..66f3323 100644
--- a/drivers/dahdi/wcte12xp/wcte12xp.h
+++ b/drivers/dahdi/wcte12xp/wcte12xp.h
@@ -115,6 +115,7 @@ struct t1 {
unsigned long bit_flags;
unsigned long alarmtimer;
unsigned char ledstate;
+ unsigned char vpm_check_count;
struct dahdi_span span; /* Span */
struct dahdi_chan *chans[32]; /* Channels */
struct dahdi_echocan_state *ec[32]; /* Echocan state for channels */