mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
irqchip/gic: Clear enable bits before restoring them
When restoring the GIC state (after a suspend/resume cycle, for example), the driver directly writes the 'enabled' state it has saved by accessing GICD_ISENABLERn, which performs an OR operation between the value present in the register and the value we write. If whatever code that has run before we reentered the kernel has enabled an interrupt that was previously disabled, we won't restore that disabled state. Making sure we first clear the register (by writting to GICD_ICENABLERn) before restoring the enabled state. Signed-off-by: Marc Zyngier <[email protected]> Cc: <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Russell King <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
parent
0eece2b228
commit
92eda4ad43
1 changed files with 8 additions and 2 deletions
|
|
@ -604,9 +604,12 @@ static void gic_dist_restore(unsigned int gic_nr)
|
|||
writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
|
||||
dist_base + GIC_DIST_TARGET + i * 4);
|
||||
|
||||
for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
|
||||
for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++) {
|
||||
writel_relaxed(GICD_INT_EN_CLR_X32,
|
||||
dist_base + GIC_DIST_ENABLE_CLEAR + i * 4);
|
||||
writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
|
||||
dist_base + GIC_DIST_ENABLE_SET + i * 4);
|
||||
}
|
||||
|
||||
writel_relaxed(GICD_ENABLE, dist_base + GIC_DIST_CTRL);
|
||||
}
|
||||
|
|
@ -654,8 +657,11 @@ static void gic_cpu_restore(unsigned int gic_nr)
|
|||
return;
|
||||
|
||||
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
|
||||
for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
|
||||
for (i = 0; i < DIV_ROUND_UP(32, 32); i++) {
|
||||
writel_relaxed(GICD_INT_EN_CLR_X32,
|
||||
dist_base + GIC_DIST_ENABLE_CLEAR + i * 4);
|
||||
writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
|
||||
}
|
||||
|
||||
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
|
||||
for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue