From patchwork Mon Jul 1 17:02:39 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: 13718457 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 0DEC4C2BD09 for ; Mon, 1 Jul 2024 17:05:23 +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=xtHvx7bdyDpjiVhJFOP6wZ+sRi5Auax4Qf9UQjpxX7U=; b=VfKLiRiHOb5aPB3FqwNCHtirtU YOaQUJoS3FHAos9Q8xHuU5X21M8ygRnQXk8GAeCdHamFpnF9spxUDPALh+GC2n0gP7oL15Th+aJ+Z KMadJxGV64LYzSaHlL67/YafCXsrJ7XpXGsIyI/Q8cIJSpJjTwt5jR125VALvr/JvJtk3cIp+K8n4 WLS5wGnuiMnYNKKp0ytMnRFdQVXl+PZE72D107bzbgzIZDqTXULIg+0OEuqZEfpVgqKUikIHgDrCH oNcdZSwYELQ4eK6vvU6OIUiCrITzjHWKQB0tRu2I0C0atlHL4D+8/Yo4uolqe7iSPXRxzCbu73OVp gopxRiJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOKSl-00000004EOa-0urY; Mon, 01 Jul 2024 17:05:11 +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 1sOKRC-00000004DaF-3qjx for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 17:03:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 40955616D8; Mon, 1 Jul 2024 17:03:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC48DC4AF0F; Mon, 1 Jul 2024 17:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719853414; bh=if8dj49Hosd3vXHz5lcnA+ANOcZzpoQyJMYl/grS/Wg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNGeoEeH+4CrRqiX0bU/oKMr7F8EKl6fj4ns7WQdSgR6tlp0c/lDTog36V4xq/hJb oJ0/RbNMB5tQrZLEf4+/L0ESMMF1eqh9XESRF7ERw3Zi5Konqf6oPZQ0EWnqG3HxQo XuchUUBDcXDahsQhdkT3Gi0AXp2PJ+YtcQ624mtOdxQ2xBCpUUaTrv/759Ju9yXEE7 qLOgnrRgQueE0gbtE5tfEbiZzdlpCextA5ukmIi0CzfuMb37dnxVNXs1wFCxtnKGf5 ErEafzlWQfOlsxgJGEClGEP4sQRJAMFJXZI8qwBv8b9VDFUMYVCrr2s2JQAs5MWf6g OFoY/I8QpK69w== 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 15/25] irqchip/armada-370-xp: Don't read number of supported interrupts multiple times Date: Mon, 1 Jul 2024 19:02:39 +0200 Message-ID: <20240701170249.8128-16-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240701170249.8128-1-kabel@kernel.org> References: <20240701170249.8128-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_100335_151610_199C316C X-CRM114-Status: GOOD ( 11.33 ) 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 Get the number of supported interrupts, originally from the MPIC_INT_CONTROL register, from the mpic_domain structure member when it is already initialized. Signed-off-by: Marek BehĂșn Reviewed-by: Andrew Lunn --- drivers/irqchip/irq-armada-370-xp.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 7da5167510e9..c287579da436 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -506,13 +506,7 @@ static int mpic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, static void mpic_smp_cpu_init(void) { - u32 control; - int nr_irqs; - - control = readl(main_int_base + MPIC_INT_CONTROL); - nr_irqs = (control >> 2) & 0x3ff; - - for (int i = 0; i < nr_irqs; i++) + for (int i = 0; i < mpic_domain->hwirq_max; i++) writel(i, per_cpu_int_base + MPIC_INT_SET_MASK); if (!mpic_is_ipi_available()) @@ -721,11 +715,9 @@ static int mpic_suspend(void) static void mpic_resume(void) { bool src0, src1; - int nirqs; /* Re-enable interrupts */ - nirqs = (readl(main_int_base + MPIC_INT_CONTROL) >> 2) & 0x3ff; - for (irq_hw_number_t irq = 0; irq < nirqs; irq++) { + for (irq_hw_number_t irq = 0; irq < mpic_domain->hwirq_max; irq++) { struct irq_data *data; int virq;