[svn-commits] sruffell: linux/trunk r9558 - /linux/trunk/drivers/dahdi/wct4xxp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jan 3 14:55:21 UTC 2011


Author: sruffell
Date: Mon Jan  3 08:55:19 2011
New Revision: 9558

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9558
Log:
wct4xxp: Hold the reglock longer when checking error counters.

This is a very slight performance improvement. Eliminating the need to
save the IRQ flags is probably more of a boost than grabbing and
releasing the reglock.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wct4xxp/base.c

Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9558&r1=9557&r2=9558
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Mon Jan  3 08:55:19 2011
@@ -3431,12 +3431,13 @@
 
 
 	/* 1st gen cards isn't used interrupts */
-	gis = t4_framer_in(wc, span, FRMR_GIS);
-	isr0 = (gis & FRMR_GIS_ISR0) ? t4_framer_in(wc, span, FRMR_ISR0) : 0;
-	isr1 = (gis & FRMR_GIS_ISR1) ? t4_framer_in(wc, span, FRMR_ISR1) : 0;
-	isr2 = (gis & FRMR_GIS_ISR2) ? t4_framer_in(wc, span, FRMR_ISR2) : 0;
-	isr3 = (gis & FRMR_GIS_ISR3) ? t4_framer_in(wc, span, FRMR_ISR3) : 0;
-	isr4 = (gis & FRMR_GIS_ISR4) ? t4_framer_in(wc, span, FRMR_ISR4) : 0;
+	spin_lock_irqsave(&wc->reglock, flags);
+	gis = __t4_framer_in(wc, span, FRMR_GIS);
+	isr0 = (gis & FRMR_GIS_ISR0) ? __t4_framer_in(wc, span, FRMR_ISR0) : 0;
+	isr1 = (gis & FRMR_GIS_ISR1) ? __t4_framer_in(wc, span, FRMR_ISR1) : 0;
+	isr2 = (gis & FRMR_GIS_ISR2) ? __t4_framer_in(wc, span, FRMR_ISR2) : 0;
+	isr3 = (gis & FRMR_GIS_ISR3) ? __t4_framer_in(wc, span, FRMR_ISR3) : 0;
+	isr4 = (gis & FRMR_GIS_ISR4) ? __t4_framer_in(wc, span, FRMR_ISR4) : 0;
 
  	if ((debug & DEBUG_FRAMER) && !(isr3 & ISR3_SEC)) {
  		dev_info(&wc->dev->dev, "gis: %02x, isr0: %02x, isr1: %02x, "\
@@ -3445,14 +3446,15 @@
  	}
  
 	/* Collect performance counters once per second */
- 	if (isr3 & ISR3_SEC) {
- 		ts->span.count.fe += t4_framer_in(wc, span, FECL_T);
- 		ts->span.count.crc4 += t4_framer_in(wc, span, CEC1L_T);
- 		ts->span.count.cv += t4_framer_in(wc, span, CVCL_T);
- 		ts->span.count.ebit += t4_framer_in(wc, span, EBCL_T);
- 		ts->span.count.be += t4_framer_in(wc, span, BECL_T);
- 		ts->span.count.prbs = t4_framer_in(wc, span, FRS1_T);
- 	}
+	if (isr3 & ISR3_SEC) {
+		ts->span.count.fe += __t4_framer_in(wc, span, FECL_T);
+		ts->span.count.crc4 += __t4_framer_in(wc, span, CEC1L_T);
+		ts->span.count.cv += __t4_framer_in(wc, span, CVCL_T);
+		ts->span.count.ebit += __t4_framer_in(wc, span, EBCL_T);
+		ts->span.count.be += __t4_framer_in(wc, span, BECL_T);
+		ts->span.count.prbs = __t4_framer_in(wc, span, FRS1_T);
+	}
+	spin_unlock_irqrestore(&wc->reglock, flags);
  
 	/* Collect errored second counter once per second */
  	if (isr3 & ISR3_ES) {




More information about the svn-commits mailing list