Skip to content

Commit 518bfe8

Browse files
aakoskinMarc Zyngier
authored andcommitted
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: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 3bdd7f7 commit 518bfe8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/irqchip/irq-i8259.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,6 @@ static struct syscore_ops i8259_syscore_ops = {
225225
.shutdown = i8259A_shutdown,
226226
};
227227

228-
static int __init i8259A_init_sysfs(void)
229-
{
230-
register_syscore_ops(&i8259_syscore_ops);
231-
return 0;
232-
}
233-
234-
device_initcall(i8259A_init_sysfs);
235-
236228
static void init_8259A(int auto_eoi)
237229
{
238230
unsigned long flags;
@@ -332,6 +324,7 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node)
332324
panic("Failed to add i8259 IRQ domain");
333325

334326
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
327+
register_syscore_ops(&i8259_syscore_ops);
335328
return domain;
336329
}
337330

0 commit comments

Comments
 (0)