Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip: mips-gic: SYNC after enabling GIC region

A SYNC is required between enabling the GIC region and actually trying
to use it, even if the first access is a read, otherwise its possible
depending on the timing (and in my case depending on the precise
alignment of certain kernel code) to hit CM bus errors on that first
access.

Add the SYNC straight after setting the GIC base.

[paul.burton@imgtec.com:
Changes later in this series increase our likelihood of hitting this
by reducing the amount of code that runs between enabling the GIC &
accessing it.]

Fixes: a7057270c280 ("irqchip: mips-gic: Add device-tree support")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.19.x-
Patchwork: https://patchwork.linux-mips.org/patch/17019/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
2c0e8382 5af2ed36

+4 -1
+4 -1
drivers/irqchip/irq-mips-gic.c
··· 1020 1020 gic_len = resource_size(&res); 1021 1021 } 1022 1022 1023 - if (mips_cm_present()) 1023 + if (mips_cm_present()) { 1024 1024 write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK); 1025 + /* Ensure GIC region is enabled before trying to access it */ 1026 + __sync(); 1027 + } 1025 1028 gic_present = true; 1026 1029 1027 1030 __gic_init(gic_base, gic_len, cpu_vec, 0, node);