linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Schnaidt <alex.schnaidt@googlemail.com>
To: Andrew Lutomirski <luto@mit.edu>
Cc: Johannes Berg <johannes.berg@intel.com>,
	"Guy, Wey-Yi W" <wey-yi.w.guy@intel.com>,
	"ilw@linux.intel.com" <ilw@linux.intel.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [Ilw] Re: 6300agn: queue stuck and driver doesn't recover
Date: Fri, 10 Feb 2012 18:57:05 +0100	[thread overview]
Message-ID: <CAFZTsKmpDOv6aHBT70-0_0muaTNvqPJQpqqC-04OisGC4_Ymog@mail.gmail.com> (raw)
In-Reply-To: <CAObL_7Ha5JKBcxBFAG1VDvF0rcAxvWkLVe2Opi4mCcL0kR2YFg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

>> Ok this makes sense. A few other people also recently reported this. I'm
>> currently (still) away from home so I can't reproduce this issue, and I
>> didn't find anything by just looking at the code. Traces for mac80211
>> and iwlwifi subsystems would be useful to look at in this case, I think,
>> if you want to record the failure case see:
>> http://wireless.kernel.org/en/developers/Documentation/mac80211/tracing
>> (-e mac80211 -e iwlwifi). If you do record it, please don't send the
>> traces to the list, bzip2 it and send it to me directly.
>
> I just reproduced the problem (or at least the similar problem
> affecting me) with swcrypto=1.  I'll try to get a trace.
>
> --Andy

Hey!

Before you get started; Johannes Berg already came up with a patch for this.
Unfortunately the discussion drifted off the list so i reattach the patch here.
I hope that's fine with Johannes.

Applying it against 3.3.0-rc2 fixes my problem, you might want to give it a try.

alex

Here's Johannes' original message:

>From: Berg, Johannes <johannes.berg@intel.com>
>Date: Tue, Feb 7, 2012 at 11:50 PM
>
>Great, thanks. I attached a more complete patch, if you want to give it a try -- I'll be putting that into the tree.
>
>johannes

[-- Attachment #2: crypto-fix.patch --]
[-- Type: application/octet-stream, Size: 2014 bytes --]

commit 86f9199668e8035933c9c5a1e42be9de3a320cd7
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Feb 7 21:18:33 2012 +0100

    iwlwifi: fix key removal
    
    When trying to remove a key, we always send key
    flags just setting the key type, not including
    the multicast flag and the key ID. As a result,
    whenever any key was removed, the unicast key 0
    would be removed, causing a complete connection
    loss after the second rekey (the first doesn't
    cause a key removal). Fix the key removal code
    to include the key ID and multicast flag, thus
    removing the correct key.
    
    Change-Id: If64327d78a07240b6d86f39fdee4ad6d438bc4f0
    Cc: stable@vger.kernel.org
    Reported-by: Alexander Schnaidt <alex.schnaidt@googlemail.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index d6aab00..f1298cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -1190,6 +1190,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
 	unsigned long flags;
 	struct iwl_addsta_cmd sta_cmd;
 	u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta);
+	__le16 key_flags;
 
 	/* if station isn't there, neither is the key */
 	if (sta_id == IWL_INVALID_STATION)
@@ -1215,7 +1216,14 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
 		IWL_ERR(priv, "offset %d not used in uCode key table.\n",
 			keyconf->hw_key_idx);
 
-	sta_cmd.key.key_flags = STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID;
+	key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
+	key_flags |= STA_KEY_FLG_MAP_KEY_MSK | STA_KEY_FLG_NO_ENC |
+		     STA_KEY_FLG_INVALID;
+
+	if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE))
+		key_flags |= STA_KEY_MULTICAST_MSK;
+
+	sta_cmd.key.key_flags = key_flags;
 	sta_cmd.key.key_offset = WEP_INVALID_OFFSET;
 	sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK;
 	sta_cmd.mode = STA_CONTROL_MODIFY_MSK;

      reply	other threads:[~2012-02-10 17:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 22:42 6300agn: queue stuck and driver doesn't recover Andrew Lutomirski
2012-02-05 15:45 ` Alexander Schnaidt
2012-02-05 15:31   ` [Ilw] " Guy, Wey-Yi
2012-02-05 18:27     ` Alexander Schnaidt
2012-02-06  0:54       ` Guy, Wey-Yi
2012-02-06  7:39     ` Berg, Johannes
2012-02-06 21:27       ` Alexander Schnaidt
2012-02-06 21:33         ` Johannes Berg
2012-02-10 17:28           ` Andrew Lutomirski
2012-02-10 17:57             ` Alexander Schnaidt [this message]

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=CAFZTsKmpDOv6aHBT70-0_0muaTNvqPJQpqqC-04OisGC4_Ymog@mail.gmail.com \
    --to=alex.schnaidt@googlemail.com \
    --cc=ilw@linux.intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luto@mit.edu \
    --cc=wey-yi.w.guy@intel.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).