From patchwork Sat Sep 14 08:25:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13804308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E8B8C02181 for ; Sat, 14 Sep 2024 08:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=30XdTZI2e2P5w6nrRM43Tb79c4CGISyos9S/0dOF3I0=; b=oqXBQLCSpgEUXB6j6rzKBckwzk zFfXuaKI67+kTuWJ1SfG9iVO1AHpNjlezZtIv+P23jrNoV97wrVCwAT9BhQ4IfBwYCn676Qx9ii8s ps53AW4M2+jBgvlpeaqQnCbTQsIA0zUNed0KuIwK+uiP/YAja2n23zFnYkkt2T86k0lRB3VKjm3HQ xKL5cZvJnZSjn2FPDjK7wX9QQSYnU6kfiu3jujdrGuFHiCc8CO0Nza2P0ER8RJU1YLA5cMTox5/ad 3skUe1U04PXYWd5JkmNQUiJf+qMvN8EsLRzbnWI5wyFFj29I9jA3beg79uKj5Fju6KQhzr2FKL7xe Sm9VeuWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1spNyE-00000000LW3-3NOf; Sat, 14 Sep 2024 08:17:30 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1spNxA-00000000LOr-0jXa for linux-arm-kernel@lists.infradead.org; Sat, 14 Sep 2024 08:16:25 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4X5P8X50G4zfc8P; Sat, 14 Sep 2024 16:14:04 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 997FC18007C; Sat, 14 Sep 2024 16:16: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; Sat, 14 Sep 2024 16:16:16 +0800 From: Jinjie Ruan To: , , CC: Subject: [PATCH -next RESEND] soc: ti: knav_qmss_queue: Use IRQF_NO_AUTOEN flag in request_irq() Date: Sat, 14 Sep 2024 16:25:32 +0800 Message-ID: <20240914082532.344456-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemh500013.china.huawei.com (7.202.181.146) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240914_011624_466932_2959DBBD X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()") said, reqeust_irq() and then disable_irq() is unsafe. In the small time gap between request_irq() and disable_irq(), interrupts can still come. 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. Compile-tested only. Signed-off-by: Jinjie Ruan --- v1 -> RESEND: - Remove the fix tag. - Update the commit message. --- drivers/soc/ti/knav_qmss_queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index f2055a76f84c..9c8d2f13b947 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -119,11 +119,10 @@ static int knav_queue_setup_irq(struct knav_range_info *range, if (range->flags & RANGE_HAS_IRQ) { irq = range->irqs[queue].irq; - ret = request_irq(irq, knav_queue_int_handler, 0, - inst->irq_name, inst); + ret = request_irq(irq, knav_queue_int_handler, IRQF_NO_AUTOEN, + inst->irq_name, inst); if (ret) return ret; - disable_irq(irq); if (range->irqs[queue].cpu_mask) { ret = irq_set_affinity_hint(irq, range->irqs[queue].cpu_mask); if (ret) {