From: Juuso Oikarinen <[email protected]>
In the event of a hardware failure, reconfiguring a live connection back
with the wl1271 chip does not work as expected. The chip has management
features which require setting up the association from scratch to work
correctly. To ensure this is done every time, in managed mode, when associated,
indicate connection loss to the mac80211 before asking to reconfigure the
hardware.
Signed-off-by: Juuso Oikarinen <[email protected]>
---
drivers/net/wireless/wl12xx/wl1271_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index cb18f22..2253458 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -636,6 +636,9 @@ static void wl1271_recovery_work(struct work_struct *work)
wl1271_info("Hardware recovery in progress.");
+ if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
+ ieee80211_connection_loss(wl->vif);
+
/* reboot the chipset */
__wl1271_op_remove_interface(wl);
ieee80211_restart_hw(wl->hw);
--
1.6.3.3
From: Juuso Oikarinen <[email protected]>
Due to legacy reason, dating back to when the wl1251 and wl1271 still were
a unified driver, some work-structures are initialized on hardware startup.
The hardware recovery code creates a scenario in which it is possible for a
workstruct to be re-initialized while the work-function itself is running,
which causes a kernel WARNing and a subsequent reboot.
To remedy this, move the work initialization calls to the hw allocation,
which is the logically correct place for them anyway.
Signed-off-by: Juuso Oikarinen <[email protected]>
---
drivers/net/wireless/wl12xx/wl1271_main.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 2253458..1ed9d11 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -667,11 +667,6 @@ static int wl1271_setup(struct wl1271 *wl)
return -ENOMEM;
}
- INIT_WORK(&wl->irq_work, wl1271_irq_work);
- INIT_WORK(&wl->tx_work, wl1271_tx_work);
- INIT_WORK(&wl->recovery_work, wl1271_recovery_work);
- INIT_DELAYED_WORK(&wl->scan_complete_work, wl1271_scan_complete_work);
-
return 0;
}
@@ -2489,6 +2484,10 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
INIT_DELAYED_WORK(&wl->elp_work, wl1271_elp_work);
INIT_DELAYED_WORK(&wl->pspoll_work, wl1271_pspoll_work);
+ INIT_WORK(&wl->irq_work, wl1271_irq_work);
+ INIT_WORK(&wl->tx_work, wl1271_tx_work);
+ INIT_WORK(&wl->recovery_work, wl1271_recovery_work);
+ INIT_DELAYED_WORK(&wl->scan_complete_work, wl1271_scan_complete_work);
wl->channel = WL1271_DEFAULT_CHANNEL;
wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
wl->default_key = 0;
--
1.6.3.3
On Thu, 2010-09-30 at 12:43 +0200, [email protected] wrote:
> From: Juuso Oikarinen <[email protected]>
>
> In the event of a hardware failure, reconfiguring a live connection back
> with the wl1271 chip does not work as expected. The chip has management
> features which require setting up the association from scratch to work
> correctly. To ensure this is done every time, in managed mode, when associated,
> indicate connection loss to the mac80211 before asking to reconfigure the
> hardware.
>
> Signed-off-by: Juuso Oikarinen <[email protected]>
> ---
Reviewed-by: Luciano Coelho <[email protected]>
I'll apply this to wl12xx soon.
--
Cheers,
Luca.
On Thu, 2010-09-30 at 12:43 +0200, [email protected] wrote:
> From: Juuso Oikarinen <[email protected]>
>
> Due to legacy reason, dating back to when the wl1251 and wl1271 still were
> a unified driver, some work-structures are initialized on hardware startup.
>
> The hardware recovery code creates a scenario in which it is possible for a
> workstruct to be re-initialized while the work-function itself is running,
> which causes a kernel WARNing and a subsequent reboot.
>
> To remedy this, move the work initialization calls to the hw allocation,
> which is the logically correct place for them anyway.
>
> Signed-off-by: Juuso Oikarinen <[email protected]>
> ---
Reviewed-by: Luciano Coelho <[email protected]>
I'll apply this soon.
--
Cheers,
Luca.
On Thu, 2010-09-30 at 12:43 +0200, [email protected] wrote:
> From: Juuso Oikarinen <[email protected]>
>
> In the event of a hardware failure, reconfiguring a live connection back
> with the wl1271 chip does not work as expected. The chip has management
> features which require setting up the association from scratch to work
> correctly. To ensure this is done every time, in managed mode, when associated,
> indicate connection loss to the mac80211 before asking to reconfigure the
> hardware.
>
> Signed-off-by: Juuso Oikarinen <[email protected]>
> ---
Thank you. Applied the series to wl12xx/master.
--
Cheers,
Luca.