This patch fixes two timer race conditions in the madwifi driver that 
ultimately lead to a crash within the madwifi interrupt handler (ath_intr), 
especially while fiddling with madwifi interfaces in bridged setups.

I gave this patch to a bunch of people to test and all of them came back
saying it works for them, so might want to give it a try and/or commit it.

Signed-off-by: Marek Lindner <lindner_ma...@yahoo.de>


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

--- a/ath/if_ath.c      2009-09-13 00:04:02.000000000 +0800
+++ b/ath/if_ath.c      2009-09-13 00:04:02.000000000 +0800
@@ -2781,13 +2785,14 @@
        if (sc->sc_beacon_cal == !!val)
                return;

+       sc->sc_beacon_cal = !!val && beacon_cal;
+
        if (val) {
                del_timer_sync(&sc->sc_cal_ch);
        } else {
                sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ);
                add_timer(&sc->sc_cal_ch);
        }
-       sc->sc_beacon_cal = !!val && beacon_cal;
 }

 /*
@@ -5443,7 +5448,7 @@
                        "Invoking ath_hal_txstart with sc_bhalq: %d\n",
                        sc->sc_bhalq);
                ath_hal_txstart(ah, sc->sc_bhalq);
-               if (sc->sc_beacon_cal && (jiffies > sc->sc_lastcal + 
(ath_calinterval * HZ))) {
+               if (!sc->sc_beacon_cal && (jiffies > sc->sc_lastcal + 
(ath_calinterval * HZ))) {
                        sc->sc_cal_ch.expires = jiffies + msecs_to_jiffies(10);
                        add_timer(&sc->sc_cal_ch);
                }
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to