public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wl12xx: trigger recovery for failures in sched scan stop
@ 2011-12-21 12:06 Eyal Shapira
  2011-12-22  8:59 ` Eliad Peller
  0 siblings, 1 reply; 4+ messages in thread
From: Eyal Shapira @ 2011-12-21 12:06 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

mac80211 requires that drv_sched_scan_stop
will always succeed. We have a few possible errors
such as OOM, failure to ELP wakeup, fail in the FW command.
Instead of no-op , trigger a recovery which would
mark sched scan as stopped and clear up any bad FW state.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    4 +++-
 drivers/net/wireless/wl12xx/scan.c |   14 +++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index d5f55a1..0d3de3e 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3137,8 +3137,10 @@ static void wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
 	mutex_lock(&wl->mutex);
 
 	ret = wl1271_ps_elp_wakeup(wl);
-	if (ret < 0)
+	if (ret < 0) {
+		wl12xx_queue_recovery_work(wl);
 		goto out;
+	}
 
 	wl1271_scan_sched_scan_stop(wl);
 
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index e24111e..108bed4 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -739,22 +739,26 @@ void wl1271_scan_sched_scan_stop(struct wl1271 *wl)
 
 	wl1271_debug(DEBUG_CMD, "cmd periodic scan stop");
 
-	/* FIXME: what to do if alloc'ing to stop fails? */
 	stop = kzalloc(sizeof(*stop), GFP_KERNEL);
 	if (!stop) {
 		wl1271_error("failed to alloc memory to send sched scan stop");
-		return;
+		goto recovery;
 	}
 
 	stop->tag = WL1271_SCAN_DEFAULT_TAG;
 
 	ret = wl1271_cmd_send(wl, CMD_STOP_PERIODIC_SCAN, stop,
 			      sizeof(*stop), 0);
+
+	kfree(stop);
+
 	if (ret < 0) {
 		wl1271_error("failed to send sched scan stop command");
-		goto out_free;
+		goto recovery;
 	}
 
-out_free:
-	kfree(stop);
+	return;
+
+recovery:
+	wl12xx_queue_recovery_work(wl);
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-23  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-21 12:06 [PATCH] wl12xx: trigger recovery for failures in sched scan stop Eyal Shapira
2011-12-22  8:59 ` Eliad Peller
     [not found]   ` <CAF8O4-zh25pd7T937tbmRcFgmTVpZPtJbFP8OJKhgcaeSSqaSw@mail.gmail.com>
2011-12-23  1:11     ` Eyal Shapira
2011-12-23  9:13       ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox