diff mbox series

[15/25] irqchip/armada-370-xp: Don't read number of supported interrupts multiple times

Message ID 20240701170249.8128-16-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series armada-370-xp irqchip updates round 2 | expand

Commit Message

Marek Behún July 1, 2024, 5:02 p.m. UTC
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 <kabel@kernel.org>
---
 drivers/irqchip/irq-armada-370-xp.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Comments

Andrew Lunn July 1, 2024, 10:35 p.m. UTC | #1
On Mon, Jul 01, 2024 at 07:02:39PM +0200, Marek Behún wrote:
> 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 <kabel@kernel.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

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;