From patchwork Tue Sep 10 12:43:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13798433 X-Patchwork-Delegate: kvalo@adurom.com Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2E39191466; Tue, 10 Sep 2024 12:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971661; cv=none; b=al0ZJL+MddDKGjdF/OKcfcKw79hZL3R57q6MHuQnL5t/gCAAjJcdNOEJT1xg10X1t3MzITPB4UxAnmGH2Vj/+D6tSvjXQCSXzo9pVlDmFCuS1pgqXRKpMFTquypWd1AleqJca1mTxqytE77EL2uPCYDuTvLNk+6MxrbS4odWYAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971661; c=relaxed/simple; bh=Hicim2PjBxHs6NGlSn2TxDuRxPKJVveWprA70zcV8q8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sT624tEp/MS9rsucm/xSfB1ZiyBgyBiyvA6Up4YC2gpryVjMJP2AYaI1SKscORptMnZ5CmbBNtcOrLGw69Er0yG5BaRJ9p4j7fAIdjDoKBITLl1MIioKtu9iKQa1d3WHpOu1EG5rhTND0dSViofYQH6dnBFOY9mxMJ73iARlUAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4X334G6726zpVVP; Tue, 10 Sep 2024 20:32:14 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id B0390140158; Tue, 10 Sep 2024 20:34:16 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 10 Sep 2024 20:34:16 +0800 From: Jinjie Ruan To: , , , , , , , , , CC: Subject: [PATCH wireless v2 1/3] wifi: p54: Use IRQF_NO_AUTOEN flag in request_irq() Date: Tue, 10 Sep 2024 20:43:12 +0800 Message-ID: <20240910124314.698896-2-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910124314.698896-1-ruanjinjie@huawei.com> References: <20240910124314.698896-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: cd8d3d321285 ("p54spi: p54spi driver") Signed-off-by: Jinjie Ruan --- v2: - Add fix tag. - Wireless patches go to wireless-next, submit them in a separate patchset. --- drivers/net/wireless/intersil/p54/p54spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c index d33a994906a7..27f44a9f0bc1 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -624,7 +624,7 @@ static int p54spi_probe(struct spi_device *spi) gpio_direction_input(p54spi_gpio_irq); ret = request_irq(gpio_to_irq(p54spi_gpio_irq), - p54spi_interrupt, 0, "p54spi", + p54spi_interrupt, IRQF_NO_AUTOEN, "p54spi", priv->spi); if (ret < 0) { dev_err(&priv->spi->dev, "request_irq() failed"); @@ -633,8 +633,6 @@ static int p54spi_probe(struct spi_device *spi) irq_set_irq_type(gpio_to_irq(p54spi_gpio_irq), IRQ_TYPE_EDGE_RISING); - disable_irq(gpio_to_irq(p54spi_gpio_irq)); - INIT_WORK(&priv->work, p54spi_work); init_completion(&priv->fw_comp); INIT_LIST_HEAD(&priv->tx_pending); From patchwork Tue Sep 10 12:43:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13798432 X-Patchwork-Delegate: kvalo@adurom.com Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93E9F18F2DB; Tue, 10 Sep 2024 12:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971661; cv=none; b=XWLCn2LBZFG2i8ziQuzP9Ofgxl+uWdqmE/usP/WsnBLq9/do53shMho2blxf6/ePbax7yQ/4VGhJqEiZ5IbTCGXn7fUFwGx+lmBqERLZgLDGPYRIbUDnHDonI7ifuy+TqsyrCKlOnOeJnosOEUMSqJK6g/nxJZ5W0AAoWZl/qCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971661; c=relaxed/simple; bh=gR6R1G3FYoWOO+IUFDFjjT47YUoOg1KMkTDQDpf2Tww=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bMbw/lQhdU+/ywhTlO6xU2U9VDqz25n+41Jk+khp3+Soc3XKxWh4gi5PVq3nivpTRPutnhDEDBdtviwQDQI7EqdmFHNfTwwcVk4/7WeoMh1PBGGfD24wIJMmmk1iukFZOHVjFRjcS3Z4JZXvjssWEsLYc92ZjbJd7qngTZgrIc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4X336X1ZtLz20nnV; Tue, 10 Sep 2024 20:34:12 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 2B99E180041; Tue, 10 Sep 2024 20:34:17 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 10 Sep 2024 20:34:16 +0800 From: Jinjie Ruan To: , , , , , , , , , CC: Subject: [PATCH wireless v2 2/3] wifi: mwifiex: Use IRQF_NO_AUTOEN flag in request_irq() Date: Tue, 10 Sep 2024 20:43:13 +0800 Message-ID: <20240910124314.698896-3-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910124314.698896-1-ruanjinjie@huawei.com> References: <20240910124314.698896-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie") Signed-off-by: Jinjie Ruan Acked-by: Brian Norris --- v2: - Add fix tag. - Wireless patches go to wireless-next, submit them in a separate patchset. --- drivers/net/wireless/marvell/mwifiex/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index d99127dc466e..6c60a4c21a31 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1633,7 +1633,8 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter) } ret = devm_request_irq(dev, adapter->irq_wakeup, - mwifiex_irq_wakeup_handler, IRQF_TRIGGER_LOW, + mwifiex_irq_wakeup_handler, + IRQF_TRIGGER_LOW | IRQF_NO_AUTOEN, "wifi_wake", adapter); if (ret) { dev_err(dev, "Failed to request irq_wakeup %d (%d)\n", @@ -1641,7 +1642,6 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter) goto err_exit; } - disable_irq(adapter->irq_wakeup); if (device_init_wakeup(dev, true)) { dev_err(dev, "fail to init wakeup for mwifiex\n"); goto err_exit; From patchwork Tue Sep 10 12:43:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13798434 X-Patchwork-Delegate: kvalo@adurom.com Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A481F190676; Tue, 10 Sep 2024 12:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971662; cv=none; b=IrUmni2AY3Hh8vniAl+hsbwosIg/Ku5YDKTC4fRyrNdGF7Kwc8q/lmryoyTS+VluAVfQ/R/9Ra1uRQnUZLIKi80Qs340RHRgo0IFuSPlodfYjda4fO8Xa+Ez1UQ8iLdlMIBJzR+MDSPbblB98vh9xC4hiD369D8z7pgX/wyQy70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725971662; c=relaxed/simple; bh=5qAplfjO5BTwpTFUSvjsNZB/HBHHyjg9WiC9zF4R/aI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nqNroHU1csFLvUaiLwSKK8whJI/PVqZtKI0OHOmzC4gOovAJMH5HiapTRvPpWzd7di65tt8mF6QnoYjgFyAyCmP8LsHMgpvYN8x2HQ/T3TsxQvQoosdQjjA2iv9fCymgLDWAsolLeQqSmCfyH1hdu7JP0+5p+hli2Q6dHx7pUTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4X332W3Y2Cz1HJWj; Tue, 10 Sep 2024 20:30:43 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 9E5931A0188; Tue, 10 Sep 2024 20:34:17 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 10 Sep 2024 20:34:17 +0800 From: Jinjie Ruan To: , , , , , , , , , CC: Subject: [PATCH wireless v2 3/3] wifi: wl1251: Use IRQF_NO_AUTOEN flag in request_irq() Date: Tue, 10 Sep 2024 20:43:14 +0800 Message-ID: <20240910124314.698896-4-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910124314.698896-1-ruanjinjie@huawei.com> References: <20240910124314.698896-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemh500013.china.huawei.com (7.202.181.146) As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()") said, the code below is subobtimal. IRQF_NO_AUTOEN flag can be used by drivers to request_irq(). It prevents the automatic enabling of the requested interrupt in the same safe way. With that the usage can be simplified and corrected. irq_set_status_flags(irq, IRQ_NOAUTOEN); request_irq(dev, irq...); Signed-off-by: Jinjie Ruan --- drivers/net/wireless/ti/wl1251/sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c index c705081249d6..b45050243129 100644 --- a/drivers/net/wireless/ti/wl1251/sdio.c +++ b/drivers/net/wireless/ti/wl1251/sdio.c @@ -233,8 +233,8 @@ static int wl1251_sdio_probe(struct sdio_func *func, } if (wl->irq) { - irq_set_status_flags(wl->irq, IRQ_NOAUTOEN); - ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl); + ret = request_irq(wl->irq, wl1251_line_irq, IRQF_NO_AUTOEN, + "wl1251", wl); if (ret < 0) { wl1251_error("request_irq() failed: %d", ret); goto disable;