2013-01-10 10:21:01

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH for 3.8] 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.

Cc: [email protected]
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Hante Meuleman <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Piotr Haber <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
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(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 1fbd8ec..0f71d1d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -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));
}
--
1.7.10.4