[<prev] [next>] [day] [month] [year] [list]
Message-ID: <171915662931.10875.4726909640508409611.tip-bot2@tip-bot2>
Date: Sun, 23 Jun 2024 15:30:29 -0000
From: tip-bot2 for Marek Behún <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: kabel@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Andrew Lunn <andrew@...n.ch>, x86@...nel.org, linux-kernel@...r.kernel.org,
maz@...nel.org
Subject: [tip: irq/core] irqchip/armada-370-xp: Use atomic_io_modify() instead
of another spinlock
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 50c43447f71c6d0eb9e320c4cc69822d396e52bc
Gitweb: https://git.kernel.org/tip/50c43447f71c6d0eb9e320c4cc69822d396e52bc
Author: Marek Behún <kabel@...nel.org>
AuthorDate: Thu, 20 Jun 2024 11:52:33 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Sun, 23 Jun 2024 17:23:08 +02:00
irqchip/armada-370-xp: Use atomic_io_modify() instead of another spinlock
Use the dedicated atomic_io_modify() instead of a open coded spin_lock() +
readl() + writel() + spin_unlock() sequence.
This allows to drop the irq_controller_lock spinlock from the driver.
Signed-off-by: Marek Behún <kabel@...nel.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
---
drivers/irqchip/irq-armada-370-xp.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 4b021a6..676df71 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -461,24 +461,18 @@ static __init void armada_xp_ipi_init(struct device_node *node)
set_smp_ipi_range(base_ipi, IPI_DOORBELL_END);
}
-static DEFINE_RAW_SPINLOCK(irq_controller_lock);
-
static int armada_xp_set_affinity(struct irq_data *d,
const struct cpumask *mask_val, bool force)
{
irq_hw_number_t hwirq = irqd_to_hwirq(d);
- unsigned long reg, mask;
int cpu;
/* Select a single core from the affinity mask which is online */
cpu = cpumask_any_and(mask_val, cpu_online_mask);
- mask = 1UL << cpu_logical_map(cpu);
- raw_spin_lock(&irq_controller_lock);
- reg = readl(main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
- reg = (reg & (~ARMADA_370_XP_INT_SOURCE_CPU_MASK)) | mask;
- writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
- raw_spin_unlock(&irq_controller_lock);
+ atomic_io_modify(main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq),
+ ARMADA_370_XP_INT_SOURCE_CPU_MASK,
+ BIT(cpu_logical_map(cpu)));
irq_data_update_effective_affinity(d, cpumask_of(cpu));
Powered by blists - more mailing lists