linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-wireless@vger.kernel.org, Thomas Pedersen <thomas@cozybit.com>
Subject: Re: [PATCH 2/6] mac80211: sync suspend and stop interface
Date: Tue, 26 Feb 2013 21:44:00 +0100	[thread overview]
Message-ID: <1361911440.8440.12.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1361793008-2857-2-git-send-email-sgruszka@redhat.com>

On Mon, 2013-02-25 at 12:50 +0100, Stanislaw Gruszka wrote:
> Is possible that we close interface while we are suspended, that
> results in warning like below (and some others similar):
> 
> WARNING: at net/mac80211/driver-ops.h:12 ieee80211_do_stop+0x62e/0x670 [mac80211]()
> wlan0:  Failed check-sdata-in-driver check, flags: 0x4

> @@ -834,16 +835,18 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  
>  		skb_queue_purge(&sdata->skb_queue);
>  
> -		/*
> -		 * Free all remaining keys, there shouldn't be any,
> -		 * except maybe group keys in AP more or WDS?
> -		 */
> -		ieee80211_free_keys(sdata);
> -
>  		drv_remove_interface_debugfs(local, sdata);
>  
> -		if (going_down)
> -			drv_remove_interface(local, sdata);
> +		if (!local->suspended) {
> +			/*
> +			 * There shouldn't be any kays, sice we disconnected
> +			 * before suspend.
> +			 */
> +			WARN_ON(!list_empty(&sdata->key_list));

This is wrong -- you're now leaking the keys after a warning; freeing
the keys had nothing to do with suspend originally. You shouldn't change
this, in fact you should just move the comment & code I think.

More generally, does this really make much sense? There are other things
here, e.g. ieee80211_configure_filter(), ieee80211_recalc_ps(),
ieee80211_hw_config() and probably more that can be executed in this
function -- I don't think protecting these two calls is really
sufficient?

I think it'd be smarter to delay the down until resumed, or so.

johannes


  reply	other threads:[~2013-02-26 20:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 11:50 [PATCH 1/6] cfg80211: disconnect on suspend Stanislaw Gruszka
2013-02-25 11:50 ` [PATCH 2/6] mac80211: sync suspend and stop interface Stanislaw Gruszka
2013-02-26 20:44   ` Johannes Berg [this message]
2013-02-27 10:42     ` Stanislaw Gruszka
2013-02-27 10:46       ` Johannes Berg
2013-02-27 14:54     ` Stanislaw Gruszka
2013-03-08 14:26       ` Stanislaw Gruszka
2013-02-25 11:50 ` [PATCH 3/6] mac80211: cleanup generic suspend/resume procedures Stanislaw Gruszka
2013-02-26 20:49   ` Johannes Berg
2013-02-25 11:50 ` [PATCH 4/6] mac80211: cleanup suspend/resume on managed mode Stanislaw Gruszka
2013-02-25 11:50 ` [PATCH 5/6] mac80211: cleanup suspend/resume on ibss mode Stanislaw Gruszka
2013-02-25 11:50 ` [PATCH 6/6] mac80211: cleanup suspend/resume on mesh mode Stanislaw Gruszka
2013-02-26 20:41 ` [PATCH 1/6] cfg80211: disconnect on suspend Johannes Berg

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=1361911440.8440.12.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    --cc=thomas@cozybit.com \
    /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).