From: Eyal Shapira <eyal@wizery.com>
To: Luciano Coelho <coelho@ti.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH] wl12xx: trigger recovery for failures in sched scan stop
Date: Wed, 21 Dec 2011 14:06:26 +0200 [thread overview]
Message-ID: <1324469186-18507-1-git-send-email-eyal@wizery.com> (raw)
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
next reply other threads:[~2011-12-21 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 12:06 Eyal Shapira [this message]
2011-12-22 8:59 ` [PATCH] wl12xx: trigger recovery for failures in sched scan stop Eliad Peller
[not found] ` <CAF8O4-zh25pd7T937tbmRcFgmTVpZPtJbFP8OJKhgcaeSSqaSw@mail.gmail.com>
2011-12-23 1:11 ` Eyal Shapira
2011-12-23 9:13 ` Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324469186-18507-1-git-send-email-eyal@wizery.com \
--to=eyal@wizery.com \
--cc=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox