Commit 518bfe84 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Marc Zyngier

irqchip/i8259: Fix shutdown order by moving syscore_ops registration

When using cpufreq on Loongson 2F MIPS platform, "poweroff"
command gets frequently stuck in syscore_shutdown(). The reason is
that i8259A_shutdown() gets called before cpufreq_suspend(), and if we
have pending work then irq_work_sync() in cpufreq_dbs_governor_stop()
gets stuck forever as we have all interrupts masked already.

irq-i8259 is registering syscore_ops using device_initcall(),
while cpufreq uses core_initcall(). Fix the shutdown order simply
by registering the irq syscore_ops during the early IRQ init instead
of using a separate initcall at later stage.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 3bdd7f74
...@@ -225,14 +225,6 @@ static struct syscore_ops i8259_syscore_ops = { ...@@ -225,14 +225,6 @@ static struct syscore_ops i8259_syscore_ops = {
.shutdown = i8259A_shutdown, .shutdown = i8259A_shutdown,
}; };
static int __init i8259A_init_sysfs(void)
{
register_syscore_ops(&i8259_syscore_ops);
return 0;
}
device_initcall(i8259A_init_sysfs);
static void init_8259A(int auto_eoi) static void init_8259A(int auto_eoi)
{ {
unsigned long flags; unsigned long flags;
...@@ -332,6 +324,7 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node) ...@@ -332,6 +324,7 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node)
panic("Failed to add i8259 IRQ domain"); panic("Failed to add i8259 IRQ domain");
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2); setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
register_syscore_ops(&i8259_syscore_ops);
return domain; return domain;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment