Skip to contentSkip to conversation

brcmsmac: increase timer reference count for new timers only

PATCH New Arend van Spriel 1 participant 1 message Jan 10, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmsmac: increase timer reference count for new timers only

From: Piotr Haber <[email protected]>

On hardware reintialization reference count of
already existing timers would be increased again.
This leads to problems on module unloading.

---
Hi John,

This patch fixes driver unload issue after driver restart due to fatal hardware problem. Because for 3.8 brcmsmac has been reported to restart (looking into that) this fix may be helpful to at least get the driver removed.

Gr. AvS

---
 drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +4 -3
index 1fbd8ec..0f71d1d 100644
@@ -1407,9 +1407,10 @@ void brcms_add_timer(struct brcms_timer *t, uint ms, int periodic)
 #endif
 	t->ms = ms;
 	t->periodic = (bool) periodic;
-	t->set = true;
-
-	atomic_inc(&t->wl->callbacks);
+	if (!t->set) {
+		t->set = true;
+		atomic_inc(&t->wl->callbacks);
+	}
 
 	ieee80211_queue_delayed_work(hw, &t->dly_wrk, msecs_to_jiffies(ms));
 }
Signature · 1 line
1.7.10.4