summaryrefslogtreecommitdiff
path: root/kernel/wct4xxp
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-02 17:31:56 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-02 17:31:56 +0000
commitb576789b439676cda0595c1f9ad402f8864e7f42 (patch)
tree60f68ed551b0033b4123e58aabf2dcf6b69d619a /kernel/wct4xxp
parentb17a9301ceead60f5a53e65b5c572131a68e77a2 (diff)
Merge stack cleanup branch into 1.4. Also merge firmware load time fix for wct4xxp driver. The stack cleanup branch reduces the amound of stack used by zaptel, nice for systems with 4K stacks enabled and where potential stack overflow is found
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4221 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'kernel/wct4xxp')
-rw-r--r--kernel/wct4xxp/base.c33
-rw-r--r--kernel/wct4xxp/wct4xxp.h1
2 files changed, 32 insertions, 2 deletions
diff --git a/kernel/wct4xxp/base.c b/kernel/wct4xxp/base.c
index 45e030c..5eb4fec 100644
--- a/kernel/wct4xxp/base.c
+++ b/kernel/wct4xxp/base.c
@@ -330,6 +330,9 @@ struct t4 {
unsigned long memlen;
volatile unsigned int *membase; /* Base address of card */
+ /* Add this for our softlockup protector */
+ unsigned int oct_rw_count;
+
/* Flags for our bottom half */
unsigned long checkflag;
struct tasklet_struct t4_tlet;
@@ -416,7 +419,8 @@ static inline unsigned int __t4_pci_in(struct t4 *wc, const unsigned int addr)
* transactions, some host bridges appear to generate them.
* This delay prevents this.
*/
- udelay(3);
+ if (!test_bit(T4_LOADING_FW, &wc->checkflag))
+ udelay(3);
}
return res;
}
@@ -430,7 +434,8 @@ static inline void __t4_pci_out(struct t4 *wc, const unsigned int addr, const un
* transactions, some host bridges appear to generate them.
* This delay prevents this.
*/
- udelay(3);
+ if (!test_bit(T4_LOADING_FW, &wc->checkflag))
+ udelay(3);
tmp = __t4_pci_in(wc, WC_VERSION);
if ((tmp & 0xffff0000) != 0xc01a0000)
printk("TE4XXP: Version Synchronization Error!\n");
@@ -655,6 +660,16 @@ static inline unsigned int t4_oct_in(struct t4 *wc, const unsigned int addr)
{
unsigned long flags;
unsigned int ret;
+
+#if 0
+#ifdef CONFIG_DETECT_SOFTLOCKUP
+ if (!in_irq() && test_bit(T4_LOADING_FW, &wc->checkflag) && !(wc->oct_rw_count++ % 2000)) {
+ //printk("Hit\n");
+ //touch_softlockup_watchdog();
+ //touch_all_softlockup_watchdogs();
+ }
+#endif
+#endif
spin_lock_irqsave(&wc->reglock, flags);
ret = __t4_oct_in(wc, addr);
spin_unlock_irqrestore(&wc->reglock, flags);
@@ -716,6 +731,17 @@ static inline void __t4_oct_out(struct t4 *wc, unsigned int addr, unsigned int v
static inline void t4_oct_out(struct t4 *wc, const unsigned int addr, const unsigned int value)
{
unsigned long flags;
+
+#if 0
+#ifdef CONFIG_DETECT_SOFTLOCKUP
+ if (!in_irq() && test_bit(T4_LOADING_FW, &wc->checkflag) && !(wc->oct_rw_count++ % 2000)) {
+ //printk("Hit\n");
+ //touch_softlockup_watchdog();
+ //touch_all_softlockup_watchdogs();
+ }
+#endif
+#endif
+
spin_lock_irqsave(&wc->reglock, flags);
__t4_oct_out(wc, addr, value);
spin_unlock_irqrestore(&wc->reglock, flags);
@@ -3182,12 +3208,15 @@ static void t4_vpm450_init(struct t4 *wc)
return;
}
+ set_bit(T4_LOADING_FW, &wc->checkflag);
if (!(wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware))) {
printk("VPM450: Failed to initialize\n");
if (firmware != &embedded_firmware)
release_firmware(firmware);
+ clear_bit(T4_LOADING_FW, &wc->checkflag);
return;
}
+ clear_bit(T4_LOADING_FW, &wc->checkflag);
if (firmware != &embedded_firmware)
release_firmware(firmware);
diff --git a/kernel/wct4xxp/wct4xxp.h b/kernel/wct4xxp/wct4xxp.h
index 42dc2bd..7cb4ed0 100644
--- a/kernel/wct4xxp/wct4xxp.h
+++ b/kernel/wct4xxp/wct4xxp.h
@@ -106,6 +106,7 @@ struct t4_regs {
};
#define T4_CHECK_VPM 0
+#define T4_LOADING_FW 1
#define WCT4_GET_REGS _IOW (ZT_CODE, 60, struct t4_regs)