From patchwork Thu Jul 11 11:57:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 13730639 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 2D570C3DA4A for ; Thu, 11 Jul 2024 12:01:09 +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-Transfer-Encoding: Content-Type: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=vsZIZfU5PWmhenxMT0LXy6zg3Bibo6JMt3Q+7MKk63o=; b=IDREYamh1veLokKQhvft9jvvqA dZ+ZZ07A8gGgOYA6fyFHIqbj/IPgE/os5ZBbBffq6KvmqDqnh+9REROg7sl/66j9J5L9yyS2IppYa sml9DEoweV1z4TdjA5KZp2iGa+i3m39Pfn3ZxrB3ze96gc+7SehNBLqVYZA7huTS+KhXjniavctmZ ZFuc/RsJ/lucfsmE8pNRdrteyJeSciLH10qsYHxf623cx9OvaR4qmACy3QNxbi9twpU3bRSo+bwWb GWHBVlmmTPfxzzRr4Q7r/zDs+OTSSJwngGlTdASBureSNGv5ctywkHY+tdYDERwFqgNxu+GeUQja2 6GjTrKsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRsTm-0000000Dt1J-0EGQ; Thu, 11 Jul 2024 12:00:54 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRsRJ-0000000Ds1I-0pCO for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 11:58:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B94D661D18; Thu, 11 Jul 2024 11:58:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47AABC116B1; Thu, 11 Jul 2024 11:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720699100; bh=Fye1I0+A5pEpUA8VDEPjyqgwS8+8Aw/ZrzB8azTH2UQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDOcaRzefCVxHQv26y2j5LnPKrvDM0M5/GS411cnSTHWfJupXIWccv9A66BMJ/MaN 5AgBc/dAxX4PH9ZzDv/+t6k/UnSvWL2f5Xrn0EvQVyXdBDsB3R3tQNp86vh9So3RmB 7Wi1IMz10BmYm76M6WEOt/YZ9bgPRcQbkpt728HyckwkBP+hVyO6A5E4IgcWMhvQLm UKddDi+BTIO3YnXGQ48IB3GaBwADNJKmPGdhIJ3+4pEZYicyEudlLkjnAFXjcFLpA3 WFDuj6cTJ1McnxejRI3D4c1oPSnoBZN3ZHdzAsyqRR6jUzTqJm82wJJCVxAIs+1owH TmsjNn1rqWyCw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH 10/10] irqchip/armada-370-xp: Refactor handling IPI interrupts Date: Thu, 11 Jul 2024 13:57:48 +0200 Message-ID: <20240711115748.30268-11-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711115748.30268-1-kabel@kernel.org> References: <20240711115748.30268-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_045821_299266_5A6BBC5E X-CRM114-Status: GOOD ( 11.53 ) 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 Refactor the handling of IPI interrupts - put into own function mpic_handle_ipi_irq(), similar to mpic_handle_msi_irq() - rename the variable holding the doorbell cause register to "cause" - retype and rename the variable holding the IPI HW IRQ number to "irq_hw_number_t i" Signed-off-by: Marek BehĂșn Reviewed-by: Andrew Lunn --- drivers/irqchip/irq-armada-370-xp.c | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index b31bf6c43a8b..be1c3721f980 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -635,6 +635,22 @@ static void mpic_handle_msi_irq(void) static void mpic_handle_msi_irq(void) {} #endif +#ifdef CONFIG_SMP +static void mpic_handle_ipi_irq(void) +{ + unsigned long cause; + irq_hw_number_t i; + + cause = readl_relaxed(per_cpu_int_base + MPIC_IN_DRBEL_CAUSE); + cause &= IPI_DOORBELL_MASK; + + for_each_set_bit(i, &cause, IPI_DOORBELL_END) + generic_handle_domain_irq(mpic_ipi_domain, i); +} +#else +static inline void mpic_handle_ipi_irq(void) {} +#endif + static void mpic_handle_cascade_irq(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); @@ -685,20 +701,9 @@ static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs) if (irqnr == 1) mpic_handle_msi_irq(); -#ifdef CONFIG_SMP /* IPI Handling */ - if (irqnr == 0) { - unsigned long ipimask; - int ipi; - - ipimask = readl_relaxed(per_cpu_int_base + - MPIC_IN_DRBEL_CAUSE) & - IPI_DOORBELL_MASK; - - for_each_set_bit(ipi, &ipimask, IPI_DOORBELL_END) - generic_handle_domain_irq(mpic_ipi_domain, ipi); - } -#endif + if (irqnr == 0) + mpic_handle_ipi_irq(); } while (1); }