[svn-commits] mattf: branch mattf/zaptel-hotwct4xxp r2313 - /team/mattf/zaptel-hotwct4xxp/w...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Mar 16 11:23:56 MST 2007


Author: mattf
Date: Fri Mar 16 13:23:55 2007
New Revision: 2313

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2313
Log:
Micro Optimizations to the wct4xxp driver

Modified:
    team/mattf/zaptel-hotwct4xxp/wct4xxp/base.c

Modified: team/mattf/zaptel-hotwct4xxp/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mattf/zaptel-hotwct4xxp/wct4xxp/base.c?view=diff&rev=2313&r1=2312&r2=2313
==============================================================================
--- team/mattf/zaptel-hotwct4xxp/wct4xxp/base.c (original)
+++ team/mattf/zaptel-hotwct4xxp/wct4xxp/base.c Fri Mar 16 13:23:55 2007
@@ -2802,13 +2802,8 @@
 	unsigned long flags;
 	unsigned char cis;
 
-	spin_lock_irqsave(&wc->reglock, flags);
-	if (test_and_clear_bit(T4_UPDATE_TIMERS, &wc->checkflag)) {
-		__t4_do_counters(wc);
-		__handle_leds(wc);
-	}
-
 	if (test_and_clear_bit(T4_CHECK_FRAMER, &wc->checkflag)) {
+		spin_lock_irqsave(&wc->reglock, flags);
 		cis = __t4_framer_in(wc, 0, FRMR_CIS);
 		if (cis & FRMR_CIS_GIS1)
 			__t4_framer_interrupt(wc, 0);
@@ -2818,8 +2813,8 @@
 			__t4_framer_interrupt(wc, 2);
 		if (cis & FRMR_CIS_GIS4)
 			__t4_framer_interrupt(wc, 3);
-	}
-	spin_unlock_irqrestore(&wc->reglock, flags);
+		spin_unlock_irqrestore(&wc->reglock, flags);
+	}
 
 #ifdef VPM_SUPPORT
 	if (wc->vpm) {
@@ -2876,7 +2871,6 @@
 		printk("2G: Got interrupt, status = %08x, CIS = %04x\n", status, __t4_framer_in(wc, 0, FRMR_CIS));
 
 	if (likely(status & 0x2)) {
-		set_bit(T4_UPDATE_TIMERS, &wc->checkflag);
 #ifdef ENABLE_WORKQUEUES
 		int cpus = num_online_cpus();
 		atomic_set(&wc->worklist, wc->numspans);
@@ -2920,14 +2914,16 @@
 		}
 	}
 
+	spin_lock(&wc->reglock);
+
+	__t4_do_counters(wc);
+	__handle_leds(wc);
+
 	if (unlikely(wc->checktiming > 0)) {
-		spin_lock(&wc->reglock);
 		__t4_set_timing_source_auto(wc);
-		spin_unlock(&wc->reglock);
 	}
 
 	if (unlikely(wc->stopdma)) {
-		spin_lock(&wc->reglock);
 		/* Stop DMA cleanly if requested */
 		wc->dmactrl = 0x0;
 		__t4_pci_out(wc, WC_DMACTRL, 0x00000000);
@@ -2935,10 +2931,12 @@
 		__t4_pci_out(wc, WC_INTR, 0x00000000);
 		__t4_set_timing_source(wc, 4, 0, 0);
 		wc->stopdma = 0x0;
-		spin_unlock(&wc->reglock);
-	}
-
-	tasklet_schedule(&wc->t4_tlet);
+	}
+
+	spin_unlock(&wc->reglock);
+
+	if (unlikely(test_bit(T4_CHECK_VPM, &wc->checkflag) || test_bit(T4_CHECK_FRAMER, &wc->checkflag)))
+		tasklet_schedule(&wc->t4_tlet);
 
 #ifndef ENABLE_WORKQUEUES
 	__t4_pci_out(wc, WC_INTR, 0);



More information about the svn-commits mailing list