[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240814145642.344485-4-emil.renner.berthing@canonical.com>
Date: Wed, 14 Aug 2024 16:56:35 +0200
From: Emil Renner Berthing <emil.renner.berthing@...onical.com>
To: linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
Anup Patel <apatel@...tanamicro.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Paul Walmsley <paul.walmsley@...ive.com>,
Samuel Holland <samuel.holland@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>
Subject: [PATCH v1 3/9] Revert "irqchip/sifive-plic: Improve locking safety by using irqsave/irqrestore"
This reverts commit abb7205794900503d6358ef1fb645373753a794d.
This is a prerequisite to reverting the patch converting the PLIC into a
platform driver. Unfortunately this breaks booting the Allwinner D1 SoC.
Fixes: 8ec99b033147 ("irqchip/sifive-plic: Convert PLIC driver into a platform driver")
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@...onical.com>
---
drivers/irqchip/irq-sifive-plic.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index f3d4cb9e34f7..cbccd1da3ea1 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -103,11 +103,9 @@ static void __plic_toggle(void __iomem *enable_base, int hwirq, int enable)
static void plic_toggle(struct plic_handler *handler, int hwirq, int enable)
{
- unsigned long flags;
-
- raw_spin_lock_irqsave(&handler->enable_lock, flags);
+ raw_spin_lock(&handler->enable_lock);
__plic_toggle(handler->enable_base, hwirq, enable);
- raw_spin_unlock_irqrestore(&handler->enable_lock, flags);
+ raw_spin_unlock(&handler->enable_lock);
}
static inline void plic_irq_toggle(const struct cpumask *mask,
@@ -244,7 +242,6 @@ static int plic_irq_set_type(struct irq_data *d, unsigned int type)
static int plic_irq_suspend(void)
{
unsigned int i, cpu;
- unsigned long flags;
u32 __iomem *reg;
struct plic_priv *priv;
@@ -262,12 +259,12 @@ static int plic_irq_suspend(void)
if (!handler->present)
continue;
- raw_spin_lock_irqsave(&handler->enable_lock, flags);
+ raw_spin_lock(&handler->enable_lock);
for (i = 0; i < DIV_ROUND_UP(priv->nr_irqs, 32); i++) {
reg = handler->enable_base + i * sizeof(u32);
handler->enable_save[i] = readl(reg);
}
- raw_spin_unlock_irqrestore(&handler->enable_lock, flags);
+ raw_spin_unlock(&handler->enable_lock);
}
return 0;
@@ -276,7 +273,6 @@ static int plic_irq_suspend(void)
static void plic_irq_resume(void)
{
unsigned int i, index, cpu;
- unsigned long flags;
u32 __iomem *reg;
struct plic_priv *priv;
@@ -294,12 +290,12 @@ static void plic_irq_resume(void)
if (!handler->present)
continue;
- raw_spin_lock_irqsave(&handler->enable_lock, flags);
+ raw_spin_lock(&handler->enable_lock);
for (i = 0; i < DIV_ROUND_UP(priv->nr_irqs, 32); i++) {
reg = handler->enable_base + i * sizeof(u32);
writel(handler->enable_save[i], reg);
}
- raw_spin_unlock_irqrestore(&handler->enable_lock, flags);
+ raw_spin_unlock(&handler->enable_lock);
}
}
--
2.43.0
Powered by blists - more mailing lists