From patchwork Sun Jan 24 12:13:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 74985 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0OCG93E010525 for ; Sun, 24 Jan 2010 12:16:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753771Ab0AXMPg (ORCPT ); Sun, 24 Jan 2010 07:15:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753767Ab0AXMPg (ORCPT ); Sun, 24 Jan 2010 07:15:36 -0500 Received: from bu3sch.de ([62.75.166.246]:37998 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753751Ab0AXMPe (ORCPT ); Sun, 24 Jan 2010 07:15:34 -0500 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1NZ1NN-0000zs-Fp; Sun, 24 Jan 2010 12:15:33 +0000 From: Michael Buesch To: linville@tuxdriver.com Subject: [PATCH] b43: Workaround circular locking in hw-tkip key update callback Date: Sun, 24 Jan 2010 13:13:32 +0100 User-Agent: KMail/1.9.9 Cc: linux-wireless@vger.kernel.org, bcm43xx-dev@lists.berlios.de, Larry Finger , kecsa@kutfo.hit.bme.hu, Johannes Berg X-Move-Along: Nothing to see here. No, really... Nothing. MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201001241313.34784.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- wireless-testing.orig/drivers/net/wireless/b43/main.c +++ wireless-testing/drivers/net/wireless/b43/main.c @@ -856,22 +856,19 @@ static void b43_op_update_tkip_key(struc if (B43_WARN_ON(!modparam_hwtkip)) return; - mutex_lock(&wl->mutex); - + /* This is only called from the RX path through mac80211, where + * our mutex is already locked. */ + B43_WARN_ON(!mutex_is_locked(&wl->mutex)); dev = wl->current_dev; - if (!dev || b43_status(dev) < B43_STAT_INITIALIZED) - goto out_unlock; + B43_WARN_ON(!dev || b43_status(dev) < B43_STAT_INITIALIZED); keymac_write(dev, index, NULL); /* First zero out mac to avoid race */ rx_tkip_phase1_write(dev, index, iv32, phase1key); /* only pairwise TKIP keys are supported right now */ if (WARN_ON(!sta)) - goto out_unlock; + return; keymac_write(dev, index, sta->addr); - -out_unlock: - mutex_unlock(&wl->mutex); } static void do_key_write(struct b43_wldev *dev,