From patchwork Sat Nov 26 23:41:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13056605 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 748A0C43217 for ; Sat, 26 Nov 2022 23:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=3oSO/shVXofyq82zGWn8N7MWL9I+E30lv4o8vAg40e4=; b=ZbnpfuzMq7F78j /T8KkDZeFnqAPO5fH/wUyBMPSjIrlif6ZSmc8y29kCORx7sG1X4u/u+kduzvSAHaAl5AE33OcgdUx 0PyPXKgqApi4BTno+1uLXU6uyHWcezrczXmjT0vRtVnsECVwfyqxH+TDnSDwoX0GLON5j1pPvUbLP qYDCIUJgzjgM7u/PTZnmPT7EtmZQ/NQ5rLceYybsD8MpGp8dmaV/osgqAw4uVsEQQsIsOKUeChnou iPEjeuN93sBaQCHHKCfkgQgW6dhoJWgTckELO7o1RzShLFEpGrPTWVoWD4P2zw9p26EVis3v1oiIe 6YToCfAgTmmGMAooCOLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4nz-008cGy-Or; Sat, 26 Nov 2022 23:41:55 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4nr-008cAD-Oh for linux-riscv@lists.infradead.org; Sat, 26 Nov 2022 23:41:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 77DCB5C0086; Sat, 26 Nov 2022 18:41:37 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 26 Nov 2022 18:41:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669506097; x=1669592497; bh=hd Uvaq3eie+r9PF0OlqmeKbt0IxTHeoQ0MpLNYqZ+Rw=; b=v3pJv01hvFZgVgBf5i f0EYSp/uRP5bRKPb98jG6wyoGjDKJ86s44lYOshly4tSHC15PscpRd+EEOGs4leV Kylk+B8QrUMURrXM72wEpRBocB5F4O1d+Y3WJ+RlOFo0o2yXvXwIh7IdbCIV8LcP MvJBVEjRe1PXCzCI5x4X6i4DBWfPimFgbAkZY9Wb0GMKgut45UI7IMK0zgxuPp61 iX0Fo2/ibcF+34L7MkzqjRUfQ83Y5k9/YpQ3KpUQAx5Lk5xBuQiOSB5pZIzZaprU KfA/iD9EnafJsPX2qXv8koGWTxj+rcdkhm/aOgq7vnBMWc/da3Q6l586EBjo4eCc Dw1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669506097; x=1669592497; bh=hdUvaq3eie+r9 PF0OlqmeKbt0IxTHeoQ0MpLNYqZ+Rw=; b=gsAnqY0Nb/awF1P2O2Lu59+V0m/rj vJ015EBWac5kpbqbWosQPU22cCGZYUQ6bl64nYCS4EyXRj6zTXwSxuzBoexycv6Q mMKZTYhNFgoATjx0gVEZc4qR3SIeGcuxHFvE7/6ilfL4p5iPYJWxSplua99Xs2J5 R/RUeiJwYO27i8ShLujxXBwjH/qDqNeHh52/re4iRY00jL9JLOLWsnZRbunS6xrw OVpXik5R1Hv24F25g34GPXu7PRku0qI2to9HefDSP4UI09XWbEteuE1KWVmqr39k XVXPYW23FwRNkDE4JUP4F0RJz6ANQSYKkD8akM65xgCnzIwCvV0G2I32Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieekgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Nov 2022 18:41:36 -0500 (EST) From: Samuel Holland To: Marc Zyngier , Thomas Gleixner , Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, Samuel Holland , Paul Walmsley , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] genirq: Simplify cond_unmask_eoi_irq() Date: Sat, 26 Nov 2022 17:41:32 -0600 Message-Id: <20221126234134.32660-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126234134.32660-1-samuel@sholland.org> References: <20221126234134.32660-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221126_154148_459646_E07BD4CF X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This function calls .irq_eoi in three places, making the logic hard to follow. Rearrange the function so that .irq_eoi is called only once. The only time .irq_eoi is not called is when all three if checks fail, so return early in that case. threads_oneshot can only be nonzero if IRQS_ONESHOT is set, so the IRQS_ONESHOT check can be omitted there. The IRQS_ONESHOT condition from the first if statement must then be copied to the unmask_irq() condition. Furthermore, if IRQS_ONESHOT is set, mask_irq() must have been called in the parent function, so the irqd_irq_masked() check is redundant. Signed-off-by: Samuel Holland --- kernel/irq/chip.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 8ac37e8e738a..672bad021a1f 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -658,10 +658,15 @@ EXPORT_SYMBOL_GPL(handle_level_irq); static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip) { - if (!(desc->istate & IRQS_ONESHOT)) { - chip->irq_eoi(&desc->irq_data); + /* + * Do not send an EOI if the thread will do it later in + * unmask_threaded_irq(). + */ + if ((chip->flags & IRQCHIP_EOI_THREADED) && desc->threads_oneshot) return; - } + + chip->irq_eoi(&desc->irq_data); + /* * We need to unmask in the following cases: * - Oneshot irq which did not wake the thread (caused by a @@ -669,12 +674,8 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip) * completely). */ if (!irqd_irq_disabled(&desc->irq_data) && - irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot) { - chip->irq_eoi(&desc->irq_data); + (desc->istate & IRQS_ONESHOT) && !desc->threads_oneshot) unmask_irq(desc); - } else if (!(chip->flags & IRQCHIP_EOI_THREADED)) { - chip->irq_eoi(&desc->irq_data); - } } /** From patchwork Sat Nov 26 23:41:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13056607 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 6EA9AC4167B for ; Sat, 26 Nov 2022 23:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=uR/P6Vs8nPt986Ylh+mSK6oSnQYOpJQhBJT4a/CyZic=; b=JcAAK5aAvScXG+ zE15R4Bwm/Ac3gzdmBRPX0zcX9OXLXwBzCj0ovPXFTExq7rKrsYPA2keajd/yyEH6K5ZIP/NUtlfX 91vyt5woNfxrj+N1OwVW7sbz3f5hpHe2lYEjMiD+ZDrAtm9vmoatyvlmfO4CLpAvEAt3WO/6zg2Gx fs5U9sRvRevBpG7NOJGh77+sQ/pr93/xactetQR0GqHYD8wKejuxRZohmCh60opX2dGQh7cFCuhsD 4+pQsFBZxWptoFXbWIv4HAavJJDydO9wE76EYF46GLOOmlUNeH3e8EWGBtacDwqeGsUssxgc/d3mK FlVKQxmrO8bWFbMN7euQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4o1-008cHK-9O; Sat, 26 Nov 2022 23:41:57 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4nr-008cAE-Og for linux-riscv@lists.infradead.org; Sat, 26 Nov 2022 23:41:51 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5FC1E5C0089; Sat, 26 Nov 2022 18:41:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 26 Nov 2022 18:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669506098; x=1669592498; bh=Zv VBWKmSl7xxBZYvHtE90BQ1WRQAgayEAOP6BQlkaCs=; b=SjgYiyY/+S4zUa5tKl Cq5BDioncqCbaLz6IfExhT6rEGVgTVEiY5XMUgFwJxUrObXfQLGmIwj8iQEjFKyX QrVM1/rjS5gGEMgjOQiADW+SfFvVKkzUAQgsfTl7asHghlW5mq21olV/bVA6A2EX +rnAyzBsG73Wewm01Cm/269UOTFslFtKHtzUyLm3rf7+hMf69l+EAACCbBkEqA8S VJJ8l0SlXSU/03OXmAvUlkcbFbcgupNce2G029DKafKMuJtbvEaec+jcpxRGnhMy yHhbomkpg4kiBweYpEGKwaqaWRO7V22WfVSdFiZ3svsH4Rid8ccWx20KXWBc3u4r Lg6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669506098; x=1669592498; bh=ZvVBWKmSl7xxB ZYvHtE90BQ1WRQAgayEAOP6BQlkaCs=; b=WCctj4ZJYSG7ke3JogAFaH9a/pYC/ 7GsYbN8g6AALi2DTzuxojVpXOnPUqvm03CjDmT8fdPfOKZGChQsXe7wrRhMSnnC9 49qvAadRQP8i2yzKoiG81avxhxdTQahft6x7+EiSuZawW5n8/8/olEOxL+Hfh6l2 lajEZPV3grAgD4refxGVtfE1Xgl1JUbXE/wc2ZW7VGmtU6idt0Ur5VtY6QG2SMeU JqX+J9snBGFR9lbwyASwMGoG4z1JK/0u76h+o2m9X9EHmSbTSKpkLvtYjIzSQSVK zFAePkQG5Gcr5ShRHYUezadsyK+z4tbl+LUpyi+PEwpjTPyUorcK3KWPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieekgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Nov 2022 18:41:37 -0500 (EST) From: Samuel Holland To: Marc Zyngier , Thomas Gleixner , Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, Samuel Holland , Paul Walmsley , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] genirq: Add support for oneshot-safe threaded EOIs Date: Sat, 26 Nov 2022 17:41:33 -0600 Message-Id: <20221126234134.32660-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126234134.32660-1-samuel@sholland.org> References: <20221126234134.32660-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221126_154148_460299_6B1DA3CE X-CRM114-Status: GOOD ( 15.55 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org For irqchips such as the SiFive PLIC with a claim/EOI flow, each IRQ is implicitly masked during the claim operation and unmasked after the EOI. By delaying the EOI until after the thread runs, we can support threaded IRQs without any explicit mask/unmask operations. irqchips can declare this capability using the combination of flags IRQCHIP_ONESHOT_SAFE | IRQCHIP_EOI_THREADED. In this case, we still set IRQF_ONESHOT and thus action->thread_mask, so we know based on desc->threads_oneshot when to send the EOI. However, we do not set IRQS_ONESHOT, so we skip the actual mask/unmask operations. Signed-off-by: Samuel Holland --- kernel/irq/chip.c | 4 +++- kernel/irq/manage.c | 15 ++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 672bad021a1f..7a4b3fa85da0 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -446,7 +446,9 @@ void unmask_threaded_irq(struct irq_desc *desc) if (chip->flags & IRQCHIP_EOI_THREADED) chip->irq_eoi(&desc->irq_data); - unmask_irq(desc); + if (!irqd_irq_disabled(&desc->irq_data) && + (desc->istate & IRQS_ONESHOT)) + unmask_irq(desc); } /* diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 40fe7806cc8c..b9edb66428cd 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1074,9 +1074,10 @@ static int irq_wait_for_interrupt(struct irqaction *action) static void irq_finalize_oneshot(struct irq_desc *desc, struct irqaction *action) { - if (!(desc->istate & IRQS_ONESHOT) || + if (!(action->flags & IRQF_ONESHOT) || action->handler == irq_forced_secondary_handler) return; + again: chip_bus_lock(desc); raw_spin_lock_irq(&desc->lock); @@ -1112,8 +1113,7 @@ static void irq_finalize_oneshot(struct irq_desc *desc, desc->threads_oneshot &= ~action->thread_mask; - if (!desc->threads_oneshot && !irqd_irq_disabled(&desc->irq_data) && - irqd_irq_masked(&desc->irq_data)) + if (!desc->threads_oneshot) unmask_threaded_irq(desc); out_unlock: @@ -1565,8 +1565,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) * MSI based interrupts are per se one shot safe. Check the * chip flags, so we can avoid the unmask dance at the end of * the threaded handler for those. + * + * If IRQCHIP_EOI_THREADED is also set, we do an EOI dance + * instead of a mask/unmask dance. */ - if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE) + if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE && + !(desc->irq_data.chip->flags & IRQCHIP_EOI_THREADED)) new->flags &= ~IRQF_ONESHOT; /* @@ -1755,7 +1759,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) if (noirqdebug) irq_settings_set_no_debug(desc); - if (new->flags & IRQF_ONESHOT) + if (new->flags & IRQF_ONESHOT && + !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) desc->istate |= IRQS_ONESHOT; /* Exclude IRQ from balancing if requested */ From patchwork Sat Nov 26 23:41:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 13056606 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 3CDDCC46467 for ; Sat, 26 Nov 2022 23:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=p1jHCBsh2+lvL8sdKjWEQp5rg5x4wG3XEcxhNsAYm0o=; b=275//x1CGzTUzA vrE9C2KBaUMAz+zpphTOEX39MwT9Ohsoqk0AuuBhTGonb7vkH3+Lu2Nw6pTNHyWk6yTB+PeKDVfus 43PGO21xLI0cTqfp8YaaRMhk/AbqDUfaTbH3UsBxfU6kg/xwDqaOR6gDYwiXtujrXXBVuiO8tM3l8 uPHA55lNyhYedY6xC1bnvsHmq3QIAupcRgbv3fb8XxZwfls6JXs8ZxHotagazdnktXXAXTSyH05G1 z5ob8aAX2x+B0yHZMgRkVpxNlZthxIBq0mQyj32Hs14ZCWoJl715bBwvs5Pp3qBW0ec4meXaMfgeo FhEsqJH+47DEJ/Lf0l7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4nv-008cGC-PS; Sat, 26 Nov 2022 23:41:51 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oz4nr-008cAJ-Oh for linux-riscv@lists.infradead.org; Sat, 26 Nov 2022 23:41:50 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5E14D5C008E; Sat, 26 Nov 2022 18:41:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 26 Nov 2022 18:41:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669506099; x=1669592499; bh=yC ipfaxvp8AqE8QMs96bMtJmPASK9bHZYxYCfkqHdhk=; b=asvuakl6YyLt4vtn55 jwrccaQ/opR+wF/RCwaTPSW4saJF897p3Hck1RH3am8PyBwbO9WwKXv3u/aIDYnq xHIhLe5xb++/UEpHNCQAnYH/I23athqlgzmYKsfrruJKPtK5wZENCQcCE14vYVbB rzKodXK2s4nLTB6lupftAj86RDwMch2KknxRDOJlTAOlVCtzh288WxnM1cLyNPio IIExMha0ywYjfo7KJHeuAOuVfV2RLxuaksoCPH/t9p0xUfeuc59LQNH/ZrC9s8ML 10/tzerxMLY8674c2wlZAXoDbNHpp6U5/HZV+89l5EYiB93wj8uMrrZ9KQ4NueMz UF5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669506099; x=1669592499; bh=yCipfaxvp8AqE 8QMs96bMtJmPASK9bHZYxYCfkqHdhk=; b=cPcfMZMCjmljy+g9iBLqCnorTMx+I hN/4fIDtJiN0hOAQ998vBsRPpT57/QVRdvzBEVSgQTqVgXBqoCOJepN0p/y98gc5 aI9Zsn6hs2kpdG1OYYTh7FYG8zAJbTDnVzYBl/bY5On3Zadp1Pi0l0TIkzggTzGt tjUS4lmGJU5xlNJom/g17//+lWgrVEmfpjR5m5FAm75yukLHPLWhVemlHgHquix1 Z96gD3w6I65GJtrRGaV96X/euHIEgpUHycZIjy+ofV146snV+G99f6qTVw6Qk6ie S+qYQC2Lk5bj1cGJm7AwTxvLW8jnS2opR3DILie6JBUipDjtM2M8EuE9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieekgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Nov 2022 18:41:38 -0500 (EST) From: Samuel Holland To: Marc Zyngier , Thomas Gleixner , Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, Samuel Holland , Paul Walmsley , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] irqchip/sifive-plic: Enable oneshot-safe threaded EOIs Date: Sat, 26 Nov 2022 17:41:34 -0600 Message-Id: <20221126234134.32660-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221126234134.32660-1-samuel@sholland.org> References: <20221126234134.32660-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221126_154148_460299_F187E55F X-CRM114-Status: UNSURE ( 8.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This defers the EOI until the IRQ thread has finished, avoiding the need to mask the IRQ while the thread is pending. Signed-off-by: Samuel Holland --- drivers/irqchip/irq-sifive-plic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c index ff47bd0dec45..d8fc3354b38c 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -203,6 +203,8 @@ static struct irq_chip plic_chip = { #endif .irq_set_type = plic_irq_set_type, .flags = IRQCHIP_SKIP_SET_WAKE | + IRQCHIP_ONESHOT_SAFE | + IRQCHIP_EOI_THREADED | IRQCHIP_AFFINITY_PRE_STARTUP, };