From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
To: ext Johannes Berg <johannes@sipsolutions.net>
Cc: "Coelho Luciano (Nokia-MS/Helsinki)" <Luciano.Coelho@nokia.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 1/2] wl1271: Fix scan failure detection
Date: Tue, 26 Oct 2010 15:01:57 +0300 [thread overview]
Message-ID: <1288094517.2607.33.camel@wimaxnb.nmp.nokia.com> (raw)
In-Reply-To: <1288093257.3761.59.camel@jlt3.sipsolutions.net>
On Tue, 2010-10-26 at 13:40 +0200, ext Johannes Berg wrote:
> On Tue, 2010-10-26 at 14:24 +0300, juuso.oikarinen@nokia.com wrote:
>
> > mutex_lock(&wl->mutex);
> >
> > + if (wl->state == WL1271_STATE_OFF) {
> > + /*
> > + * We cannot return -EBUSY here because mac80211 will expect
> > + * a call to ieee80211_scan_completed if we do - in this case
> > + * there won't be any call.
> > + */
>
> ???
>
> johannes
>
I'll try explain what this is about. In net/wireless/sme.c you'll find
this:
} else {
/* otherwise we'll need to scan for the AP first
*/
err = cfg80211_conn_scan(wdev);
/*
* If we can't scan right now, then we need to
scan again
* after the current scan finished, since the
parameters
* changed (unless we find a good AP anyway).
*/
if (err == -EBUSY) {
err = 0;
wdev->conn->state =
CFG80211_CONN_SCAN_AGAIN;
}
}
In this code, if the driver ends up returning -EBUSY, the cfg80211 ends
up waiting for a ieee80211_scan_complete call from the driver to proceed
in the connection setting. If the scan is invoked while the driver is
not ready, returning -EBUSY in this scenario will cause the cfg80211 to
wait forever.
Obviously, cfg80211 would normally never call scan while the driver is
not initialized. This patch is about a corner case - if the wl1271
hardware crashes just before user-space requests a connection, hardware
recovery can be running while the connection is set up. To recover the
hardware, it is powered down and then mac80211 is asked to reconfigure
it.
This is the window in which the connection setup may stall. Returning an
error code other than -EBUSY for this corner case causes the error code
to be retruned to user-space, and user-space can retry the connection.
-Juuso
next prev parent reply other threads:[~2010-10-26 12:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 11:24 [PATCH 1/2] wl1271: Fix scan failure detection juuso.oikarinen
2010-10-26 11:24 ` [PATCH 2/2] wl1271: Check interface state in op_* functions juuso.oikarinen
2010-10-26 12:42 ` Tuomas Katila
2010-10-26 12:45 ` Luciano Coelho
2010-10-26 11:40 ` [PATCH 1/2] wl1271: Fix scan failure detection Johannes Berg
2010-10-26 12:01 ` Juuso Oikarinen [this message]
2010-10-26 12:18 ` Johannes Berg
2010-10-26 12:22 ` Juuso Oikarinen
2010-10-26 12:45 ` Luciano Coelho
2010-10-26 12:40 ` Tuomas Katila
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=1288094517.2607.33.camel@wimaxnb.nmp.nokia.com \
--to=juuso.oikarinen@nokia.com \
--cc=Luciano.Coelho@nokia.com \
--cc=johannes@sipsolutions.net \
--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;
as well as URLs for NNTP newsgroup(s).