From patchwork Mon Feb 8 20:41:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 8254751 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 300B5BEEE5 for ; Mon, 8 Feb 2016 21:24:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54257203B1 for ; Mon, 8 Feb 2016 21:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D2F6203B8 for ; Mon, 8 Feb 2016 21:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756104AbcBHVYK (ORCPT ); Mon, 8 Feb 2016 16:24:10 -0500 Received: from [212.40.180.149] ([212.40.180.149]:37283 "EHLO smtp-out-151.synserver.de" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753800AbcBHVYJ (ORCPT ); Mon, 8 Feb 2016 16:24:09 -0500 X-Greylist: delayed 2110 seconds by postgrey-1.27 at vger.kernel.org; Mon, 08 Feb 2016 16:24:09 EST Received: (qmail 30052 invoked by uid 0); 8 Feb 2016 20:41:19 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 29949 Received: from ppp-188-174-114-167.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.114.167] by 212.40.180.153 with AES128-SHA encrypted SMTP; 8 Feb 2016 20:41:19 -0000 From: Lars-Peter Clausen To: Kalle Valo Cc: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Larry Finger , Chaoming Li , linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, Lars-Peter Clausen Subject: [PATCH 1/2] b43: Remove unnecessary synchronize_irq() before free_irq() Date: Mon, 8 Feb 2016 21:41:12 +0100 Message-Id: <1454964073-25108-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Patch was generated using the following semantic patch: // @@ expression irq; @@ -synchronize_irq(irq); free_irq(irq, ...); // Signed-off-by: Lars-Peter Clausen --- drivers/net/wireless/broadcom/b43/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index c279211..72380af 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -4375,12 +4375,10 @@ redo: /* Synchronize and free the interrupt handlers. Unlock to avoid deadlocks. */ orig_dev = dev; mutex_unlock(&wl->mutex); - if (b43_bus_host_is_sdio(dev->dev)) { + if (b43_bus_host_is_sdio(dev->dev)) b43_sdio_free_irq(dev); - } else { - synchronize_irq(dev->dev->irq); + else free_irq(dev->dev->irq, dev); - } mutex_lock(&wl->mutex); dev = wl->current_dev; if (!dev)