[asterisk-bugs] [Zaptel 0012813]: [patch] race conditions in wct4xxp

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jun 9 05:46:27 CDT 2008


The following issue is now in status NEW (again) 
====================================================================== 
http://bugs.digium.com/view.php?id=12813 
====================================================================== 
Reported By:                aks
Assigned To:                
====================================================================== 
Project:                    Zaptel
Issue ID:                   12813
Category:                   wct4xxp
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     new
Zaptel Version:             1.4.11 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-09-2008 05:15 CDT
Last Modified:              06-09-2008 05:46 CDT
====================================================================== 
Summary:                    [patch] race conditions in wct4xxp
Description: 
I think that you have a few race conditions bugs
Patch:

--- zaptel-1.4.11-orig/kernel/wct4xxp/base.c    2008-05-11
03:57:08.000000000 +0200
+++ zaptel-1.4.11/kernel/wct4xxp/base.c 2008-06-09 12:52:02.000000000
+0200
@@ -378,7 +378,7 @@
 #define WC_GPIOCTL     8
 #define WC_GPIO                9
 #define WC_LADDR       10
-#define WC_LDATA               11
+#define WC_LDATA       11
 #define WC_LCS         (1 << 11)
 #define WC_LCS2                (1 << 12)
 #define WC_LALE                        (1 << 13)
@@ -432,9 +432,9 @@
                 * transactions, some host bridges appear to generate
them.
                 * This delay prevents this.
                 */
+               tmp = __t4_pci_in(wc, WC_VERSION);
                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");
        }
@@ -1226,7 +1226,7 @@
                        if (debug & DEBUG_FRAMER) printk("transmiting
XHF|XME\n");
                        t4_framer_cmd_wait(wc, span, FRMR_CMDR_XHF |
FRMR_CMDR_XME);
 #if 0
-                       ts->sigactive = (__t4_framer_in(wc, span,
FRMR_SIS) & FRMR_SIS_XFW) ? 0 : 1;
+                       ts->sigactive = (t4_framer_in(wc, span, FRMR_SIS)
& FRMR_SIS_XFW) ? 0 : 1;
 #endif
                        ++ts->frames_out;
                        if ((debug & DEBUG_FRAMER) && !(ts->frames_out &
0x0f))
@@ -2903,14 +2903,14 @@
        struct t4 *wc = dev_id;
        unsigned int status;

+       spin_lock(&wc->reglock);
        /* Check this first in case we get a spurious interrupt */
        if (unlikely(test_bit(T4_STOP_DMA, &wc->checkflag))) {
                /* Stop DMA cleanly if requested */
                wc->dmactrl = 0x0;
-               t4_pci_out(wc, WC_DMACTRL, 0x00000000);
+               __t4_pci_out(wc, WC_DMACTRL, 0x00000000);
                /* Acknowledge any pending interrupts */
-               t4_pci_out(wc, WC_INTR, 0x00000000);
-               spin_lock(&wc->reglock);
+               __t4_pci_out(wc, WC_INTR, 0x00000000);
                __t4_set_timing_source(wc, 4, 0, 0);
                spin_unlock(&wc->reglock);
                return IRQ_RETVAL(1);
@@ -2919,6 +2919,8 @@
        /* Make sure it's really for us */
        status = __t4_pci_in(wc, WC_INTR);

+       spin_unlock(&wc->reglock);
+
        /* Ignore if it's not for us */
        if (!(status & 0x7)) {
 #ifdef LINUX26
@@ -3019,7 +3021,7 @@
                tasklet_schedule(&wc->t4_tlet);

 #ifndef ENABLE_WORKQUEUES
-       __t4_pci_out(wc, WC_INTR, 0);
+       t4_pci_out(wc, WC_INTR, 0);
 #endif
 #ifdef LINUX26
        return IRQ_RETVAL(1);




====================================================================== 

---------------------------------------------------------------------- 
 tzafrir - 06-09-08 05:46  
---------------------------------------------------------------------- 
Hi, thanks for your contribution!

In order for us to be able to reproduce the issue and fix it, could you
please describe how you can reproduce it? (you mentioned that it is
reproducable in your bug report).

There is also another small technicality: there's a required procedure for
submitting patches. Please follow it:

  http://asterisk.org/developers/bug-guidelines 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-09-08 05:46  tzafrir        Note Added: 0088464                          
06-09-08 05:46  tzafrir        Assigned To              tzafrir =>          
06-09-08 05:46  tzafrir        Status                   assigned => new     
06-09-08 05:46  tzafrir        Category                 Astribank (xpp) =>
wct4xxp
06-09-08 05:46  tzafrir        Summary                  race conditions =>
[patch] race conditions in wct4xxp
======================================================================




More information about the asterisk-bugs mailing list