Skip to contentSkip to conversation

Patch "irqchip: mips-gic: SYNC after enabling GIC region" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Sep 4, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

irqchip: mips-gic: SYNC after enabling GIC region

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
irqchip-mips-gic-sync-after-enabling-gic-region.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2c0e8382386f618c85d20cb05e7cf7df8cdd382c Mon Sep 17 00:00:00 2001

From: James Hogan <[email protected]>
Date: Sat, 12 Aug 2017 21:36:09 -0700
Subject: irqchip: mips-gic: SYNC after enabling GIC region

From: James Hogan <[email protected]>

commit 2c0e8382386f618c85d20cb05e7cf7df8cdd382c upstream.

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.

[[email protected]:
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")
Cc Thomas Gleixner <[email protected]>
Cc Jason Cooper <[email protected]>
Cc James Hogan <[email protected]>

Patchwork: https://patchwork.linux-mips.org/patch/17019/

---
 drivers/irqchip/irq-mips-gic.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mips-gic.c +4 -1
@@ -915,8 +915,11 @@ static int __init gic_of_init(struct dev
 		gic_len = resource_size(&res);
 	}
 
-	if (mips_cm_present())
+	if (mips_cm_present()) {
 		write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK);
+		/* Ensure GIC region is enabled before trying to access it */
+		__sync();
+	}
 	gic_present = true;
 
 	__gic_init(gic_base, gic_len, cpu_vec, 0, node);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/irqchip-mips-gic-sync-after-enabling-gic-region.patch