From: Luciano Coelho <luciano.coelho@nokia.com>
To: juuso.oikarinen@nokia.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wl12xx: Fix kernel crash related to hw recovery and interface shutdown
Date: Mon, 22 Nov 2010 14:52:26 +0200 [thread overview]
Message-ID: <1290430346.3322.4.camel@chilepepper> (raw)
In-Reply-To: <1290086342-12015-1-git-send-email-juuso.oikarinen@nokia.com>
On Thu, 2010-11-18 at 15:19 +0200, juuso.oikarinen@nokia.com wrote:
> From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
>
> It is possible that the op_remove_interface function is invoked exactly at
> the same time has hw recovery is started. In this case it is possible for the
> interface to be already removed in the op_remove_interface call, which
> currently leads to a kernel warning and a subsequent kernel crash.
>
> Fix this by ignoring the op_remove_interface call if the interface is already
> down at that point.
>
> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> ---
[...]
> diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
> index 31f0e2f..11b0477 100644
> --- a/drivers/net/wireless/wl12xx/main.c
> +++ b/drivers/net/wireless/wl12xx/main.c
> @@ -1157,10 +1157,16 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
> struct wl1271 *wl = hw->priv;
>
> mutex_lock(&wl->mutex);
> - WARN_ON(wl->vif != vif);
> - __wl1271_op_remove_interface(wl);
> - mutex_unlock(&wl->mutex);
> + /*
> + * wl->vif can be null here if someone shuts down the interface
> + * just when hardware recovery has been started.
> + */
> + if (wl->vif) {
> + WARN_ON(wl->vif != vif);
> + __wl1271_op_remove_interface(wl);
> + }
Should you still remove the interface if the vif you received is wrong?
Surely, something is totally wrong if you get a different vif, but maybe
removing the interface here will just confuse things even more?
> + mutex_unlock(&wl->mutex);
> cancel_work_sync(&wl->recovery_work);
> }
>
--
Cheers,
Luca.
next prev parent reply other threads:[~2010-11-22 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 13:19 [PATCH] wl12xx: Fix kernel crash related to hw recovery and interface shutdown juuso.oikarinen
2010-11-19 6:51 ` Tuomas Katila
2010-11-22 12:52 ` Luciano Coelho [this message]
2010-11-23 5:51 ` Juuso Oikarinen
2010-11-23 8:47 ` 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=1290430346.3322.4.camel@chilepepper \
--to=luciano.coelho@nokia.com \
--cc=juuso.oikarinen@nokia.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;
as well as URLs for NNTP newsgroup(s).