mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
irqchip/gic-v3: Reset APgRn registers at boot time
Booting a crash kernel while in an interrupt handler is likely to leave the Active Priority Registers with some state that is not relevant to the new kernel, and is likely to lead to erratic behaviours such as interrupts not firing as their priority is already active. As a sanity measure, wipe the APRs clean on startup. We make sure to wipe both group 0 and 1 registers in order to avoid any surprise. Signed-off-by: Marc Zyngier <[email protected]>
This commit is contained in:
parent
c5e1035c96
commit
d6062a6d62
2 changed files with 54 additions and 10 deletions
|
|
@ -532,6 +532,7 @@ static void gic_cpu_sys_reg_init(void)
|
|||
int i, cpu = smp_processor_id();
|
||||
u64 mpidr = cpu_logical_map(cpu);
|
||||
u64 need_rss = MPIDR_RS(mpidr);
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* Need to check that the SRE bit has actually been set. If
|
||||
|
|
@ -562,6 +563,28 @@ static void gic_cpu_sys_reg_init(void)
|
|||
gic_write_ctlr(ICC_CTLR_EL1_EOImode_drop_dir);
|
||||
}
|
||||
|
||||
val = gic_read_ctlr();
|
||||
val &= ICC_CTLR_EL1_PRI_BITS_MASK;
|
||||
val >>= ICC_CTLR_EL1_PRI_BITS_SHIFT;
|
||||
|
||||
switch(val + 1) {
|
||||
case 8:
|
||||
case 7:
|
||||
write_gicreg(0, ICC_AP0R3_EL1);
|
||||
write_gicreg(0, ICC_AP1R3_EL1);
|
||||
write_gicreg(0, ICC_AP0R2_EL1);
|
||||
write_gicreg(0, ICC_AP1R2_EL1);
|
||||
case 6:
|
||||
write_gicreg(0, ICC_AP0R1_EL1);
|
||||
write_gicreg(0, ICC_AP1R1_EL1);
|
||||
case 5:
|
||||
case 4:
|
||||
write_gicreg(0, ICC_AP0R0_EL1);
|
||||
write_gicreg(0, ICC_AP1R0_EL1);
|
||||
}
|
||||
|
||||
isb();
|
||||
|
||||
/* ... and let's hit the road... */
|
||||
gic_write_grpen1(1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue