From patchwork Sat Jan 4 15:52:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 3433781 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CCD8C02DC for ; Sat, 4 Jan 2014 15:50:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DAFE20114 for ; Sat, 4 Jan 2014 15:50:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1076C2010C for ; Sat, 4 Jan 2014 15:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754421AbaADPur (ORCPT ); Sat, 4 Jan 2014 10:50:47 -0500 Received: from mx4.wp.pl ([212.77.101.8]:51318 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754373AbaADPur (ORCPT ); Sat, 4 Jan 2014 10:50:47 -0500 Received: (wp-smtpd smtp.wp.pl 24771 invoked from network); 4 Jan 2014 16:50:44 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1388850644; bh=pyVSeBEWxhAQeAVUV3C72RQPT152vPC5QEcChfaH3Jg=; h=From:To:Cc:Subject; b=OoOHLih624A5Cv3HLLkdCHtvgutsBYd60i+2Cxt/SUZbUfV8X9jX2+ZGDLQNlmQbw kp2z//UnDW6vHg8eNqBNi49LmIaJUrUAAY3iHHQNV3wiTRA93/g9kR2IKPdOlASyYD 76AVX6XA1m5LFVQb2U0dATmDQp5Qu2fWQFvS7GMM= Received: from ip-94-112-189-223.net.upcbroadband.cz (HELO localhost) (stf_xl@wp.pl@[94.112.189.223]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES128-SHA encrypted SMTP for ; 4 Jan 2014 16:50:44 +0100 Date: Sat, 4 Jan 2014 16:52:27 +0100 From: Stanislaw Gruszka To: Peter Wu Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com Subject: Re: [rt2x00-users] [rt2x00usb] sleeping function called from invalid context at kernel/locking/mutex.c:616 Message-ID: <20140104155227.GA2134@localhost.localdomain> References: <11195731.87o6OySWVz@al> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <11195731.87o6OySWVz@al> User-Agent: Mutt/1.5.21 (2010-09-15) X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [YcMk] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Dec 26, 2013 at 01:00:50PM +0100, Peter Wu wrote: > [30017.470835] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:616 > [30017.470840] in_atomic(): 0, irqs_disabled(): 0, pid: 432, name: wpa_supplicant > [30017.470843] 4 locks held by wpa_supplicant/432: > [30017.470845] #0: (cb_lock){++++++}, at: [] genl_rcv+0x19/0x40 > [30017.470856] #1: (genl_mutex){+.+.+.}, at: [] genl_rcv_msg+0xc2/0xd0 > [30017.470861] #2: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x17/0x20 > [30017.470870] #3: (rcu_read_lock){.+.+..}, at: [] ieee80211_get_key+0x5/0x2f0 [mac80211] > [30017.470895] CPU: 2 PID: 432 Comm: wpa_supplicant Tainted: G O 3.13.0-rc4-custom-00256-gb7000ad #1 > [30017.470897] Hardware name: CLEVO CO. B7130 /B7130 , BIOS 6.00 08/27/2010 > [30017.470899] 0000000000000000 ffff880037b87870 ffffffff815da1f9 ffff88019630ea00 > [30017.470903] ffff880037b87880 ffffffff81076a7d ffff880037b878f0 ffffffff815dde6c > [30017.470907] ffff880037b878b0 ffffffff815e2152 ffff880197cc25c0 0000000000000292 > [30017.470911] Call Trace: > [30017.470917] [] dump_stack+0x4e/0x7a > [30017.470923] [] __might_sleep+0xed/0x120 > [30017.470928] [] mutex_lock_nested+0x3c/0x400 > [30017.470931] [] ? _raw_write_unlock_irqrestore+0x42/0x70 > [30017.470936] [] ? create_object+0x23c/0x2f0 > [30017.470940] [] rt2x00usb_vendor_request_buff+0x3c/0xd0 [rt2x00usb] > [30017.470972] [] rt2x00usb_register_multiread+0x33/0x40 [rt2800usb] > [30017.470983] [] rt2800_get_tkip_seq+0x48/0x80 [rt2800lib] get_tkip_seq() must be atomic, we can not assure that easily for USB devices, hence the only possible fix seems to be disable TKIP HW acceleration for USB devices. Does the attached patch fix the problem for you? BTW: I recommend you to switch to CCMP (AES) encryption anyway. Stanislaw diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 2183e79..87d7938 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -489,6 +489,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, crypto.cipher = rt2x00crypto_key_to_cipher(key); if (crypto.cipher == CIPHER_NONE) return -EOPNOTSUPP; + if (crypto.cipher == CIPHER_TKIP && rt2x00_is_usb(rt2x00dev)) + return -EOPNOTSUPP; crypto.cmd = cmd;