From patchwork Thu Jul 11 11:57:45 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: 13730636 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 CCD98C3DA4A for ; Thu, 11 Jul 2024 12:00:21 +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=vAUOB7oM2yS1nUGmfEdGr9dhL4czmCeY/TfKttYw+ag=; b=HDqpI+/drXUxtsf7gmki8cUPV9 CKU1Eph8+uJ6HK1MwewlOkRAJJWzRKESLvjgrB+fn3iMu8XrAgPMtKMf2FADttQNNSadYBh3hgYSG wPjGKwx8C1ZMB3c9soxtNIL4BBTJgS9y6oKq651b8M6OttTcZfc+ANIO6BLHeSqHkj56LGvgKqDlX 0yx+4Q25oHHz04LlopdRdGmREACG+KaYP7pEJcsFAt1fwVyzKjS9l6NIL2m6Eh4EJWOCTLQDx7eXo 9Q0UNlYFqcwRawLAf9WmEggLp7DCT713OLyUdBLMYQ0W+gSSjXHV5LY4JXrWOcDdYczEV7ufvJdRK O+rl9K7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRsSx-0000000Dsg0-2Yel; Thu, 11 Jul 2024 12:00:03 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRsRB-0000000DrzI-2Zts for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 11:58:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E051F60659; Thu, 11 Jul 2024 11:58:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FF58C4AF0A; Thu, 11 Jul 2024 11:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720699092; bh=MRnT12NOqWPSaqXNxqvfZI1fZEvs/be9a9VCIjgZzTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AA8AAaAMihkpJQDjQWVp5kj8APVRtOkfWZnTpWwY6vUnXXtZI0PMH28SBuA8VVZH8 BWa6R63ZMBxn/bnheqviYDpZUdEHmYh61zKG5nsBPkoI8ySChHwLMBSPSheJaJVcE9 nKd5usD2AgqIDatbyqQhVMHJ5mcfznEIvtwtpIHJkvzNx94QkNB0jf8jINnbS2gHtr bgHh59ER68ST5MSDOMgImXGd7QPMKzZtt/miTCzg2cI1k3qqxBf9O0o4ElPO/LExwn ft0cMOeYWoSuR6a5XTIh8I18k2SRL/vKbZ9DlLodmD1oXk548FhlHRNsx3sEYOGXNx LMih9z6m5RuHQ== 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 07/10] irqchip/armada-370-xp: Don't read number of supported interrupts multiple times Date: Thu, 11 Jul 2024 13:57:45 +0200 Message-ID: <20240711115748.30268-8-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_045813_737624_0306AFDC X-CRM114-Status: GOOD ( 11.48 ) 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 ab18dae174a8..151f0fd0389a 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -508,13 +508,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()) @@ -723,11 +717,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; unsigned int virq;