From 3bb5bd5b239fce4f49389b70612ea3e40a7b1ae2 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 3 Jan 2011 14:55:19 +0000 Subject: 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 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9558 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wct4xxp/base.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'drivers/dahdi/wct4xxp') diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 4df3c34..c1ae6d8 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -3431,12 +3431,13 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span) /* 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 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span) } /* 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) { -- cgit v1.2.3