From patchwork Fri Sep 11 14:00:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 46858 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8BE1Qmm023079 for ; Fri, 11 Sep 2009 14:01:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbZIKOBS (ORCPT ); Fri, 11 Sep 2009 10:01:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752026AbZIKOBS (ORCPT ); Fri, 11 Sep 2009 10:01:18 -0400 Received: from bu3sch.de ([62.75.166.246]:46618 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbZIKOBR (ORCPT ); Fri, 11 Sep 2009 10:01:17 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1Mm6gh-0002Tl-7U; Fri, 11 Sep 2009 14:01:19 +0000 From: Michael Buesch To: "John W. Linville" Subject: [PATCH] b43: Fix SDIO interrupt handler deadlock Date: Fri, 11 Sep 2009 16:00:19 +0200 User-Agent: KMail/1.9.9 Cc: Broadcom Wireless , "linux-wireless" , Albert Herranz MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909111600.20786.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org We need to release the SDIO host before locking the driver mutex. Signed-off-by: Michael Buesch Index: wireless-testing/drivers/net/wireless/b43/main.c =================================================================== --- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-10 20:26:43.000000000 +0200 +++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-11 15:55:19.000000000 +0200 @@ -1914,20 +1914,14 @@ static irqreturn_t b43_interrupt_handler static void b43_sdio_interrupt_handler(struct b43_wldev *dev) { struct b43_wl *wl = dev->wl; - struct sdio_func *func = dev->dev->bus->host_sdio; irqreturn_t ret; - if (unlikely(b43_status(dev) < B43_STAT_STARTED)) - return; - mutex_lock(&wl->mutex); - sdio_release_host(func); ret = b43_do_interrupt(dev); if (ret == IRQ_WAKE_THREAD) b43_do_interrupt_thread(dev); - sdio_claim_host(func); mutex_unlock(&wl->mutex); } Index: wireless-testing/drivers/net/wireless/b43/sdio.c =================================================================== --- wireless-testing.orig/drivers/net/wireless/b43/sdio.c 2009-09-10 19:23:20.000000000 +0200 +++ wireless-testing/drivers/net/wireless/b43/sdio.c 2009-09-11 15:54:05.000000000 +0200 @@ -54,7 +54,12 @@ static void b43_sdio_interrupt_dispatche struct b43_sdio *sdio = sdio_get_drvdata(func); struct b43_wldev *dev = sdio->irq_handler_opaque; + if (unlikely(b43_status(dev) < B43_STAT_STARTED)) + return; + + sdio_release_host(func); sdio->irq_handler(dev); + sdio_claim_host(func); } int b43_sdio_request_irq(struct b43_wldev *dev,