mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Marc Zyngier <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org,
	jason@lakedaemon.net, linux@arm.linux.org.uk, mingo@kernel.org,
	tglx@linutronix.de, marc.zyngier@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: [tip:irq/urgent] irqchip/gic: Make sure all interrupts are deactivated at boot
Date: Tue, 17 Nov 2015 05:30:36 -0800	[thread overview]
Message-ID: <tip-0eece2b22849c90b730815c893425a36b9d10fd5@git.kernel.org> (raw)
In-Reply-To: <1447701208-18150-3-git-send-email-marc.zyngier@arm.com>

Commit-ID:  0eece2b22849c90b730815c893425a36b9d10fd5
Gitweb:     http://git.kernel.org/tip/0eece2b22849c90b730815c893425a36b9d10fd5
Author:     Marc Zyngier <marc.zyngier@arm.com>
AuthorDate: Mon, 16 Nov 2015 19:13:26 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 17 Nov 2015 14:25:58 +0100

irqchip/gic: Make sure all interrupts are deactivated at boot

When booting a GIC/GICv3 based system, we have no idea what
state the firmware (or previous kernel in the case of kexec)
has left the GIC, and some interrupts may still be active.

In order to garantee that we have a clean state, make sure
the active bits are cleared at init time.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Russell King <linux@arm.linux.org.uk>
Link: http://lkml.kernel.org/r/1447701208-18150-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/irq-gic-common.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c
index 44a077f..f174ce0 100644
--- a/drivers/irqchip/irq-gic-common.c
+++ b/drivers/irqchip/irq-gic-common.c
@@ -84,12 +84,15 @@ void __init gic_dist_config(void __iomem *base, int gic_irqs,
 		writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i);
 
 	/*
-	 * Disable all interrupts.  Leave the PPI and SGIs alone
-	 * as they are enabled by redistributor registers.
+	 * Deactivate and disable all SPIs. Leave the PPI and SGIs
+	 * alone as they are in the redistributor registers on GICv3.
 	 */
-	for (i = 32; i < gic_irqs; i += 32)
+	for (i = 32; i < gic_irqs; i += 32) {
 		writel_relaxed(GICD_INT_EN_CLR_X32,
-					base + GIC_DIST_ENABLE_CLEAR + i / 8);
+			       base + GIC_DIST_ACTIVE_CLEAR + i / 8);
+		writel_relaxed(GICD_INT_EN_CLR_X32,
+			       base + GIC_DIST_ENABLE_CLEAR + i / 8);
+	}
 
 	if (sync_access)
 		sync_access();
@@ -102,7 +105,9 @@ void gic_cpu_config(void __iomem *base, void (*sync_access)(void))
 	/*
 	 * Deal with the banked PPI and SGI interrupts - disable all
 	 * PPI interrupts, ensure all SGI interrupts are enabled.
+	 * Make sure everything is deactivated.
 	 */
+	writel_relaxed(GICD_INT_EN_CLR_X32, base + GIC_DIST_ACTIVE_CLEAR);
 	writel_relaxed(GICD_INT_EN_CLR_PPI, base + GIC_DIST_ENABLE_CLEAR);
 	writel_relaxed(GICD_INT_EN_SET_SGI, base + GIC_DIST_ENABLE_SET);
 

  reply	other threads:[~2015-11-17 13:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 19:13 [PATCH 0/4] irqchip/gic: Deal with the active state across kexec and suspend/resume Marc Zyngier
2015-11-16 19:13 ` [PATCH 1/4] arm: kexec: Deactivate in-flight interrupts Marc Zyngier
2015-11-16 19:13 ` [PATCH 2/4] irqchip/gic: Make sure all interrupts are deactivated at boot Marc Zyngier
2015-11-17 13:30   ` tip-bot for Marc Zyngier [this message]
2015-11-16 19:13 ` [PATCH 3/4] irqchip/gic: Clear enable bits before restoring them Marc Zyngier
2015-11-17 13:30   ` [tip:irq/urgent] " tip-bot for Marc Zyngier
2015-11-16 19:13 ` [PATCH 4/4] irqchip/gic: Add save/restore of the active state Marc Zyngier
2015-11-17 13:31   ` [tip:irq/urgent] irqchip/gic: Add save/ restore " tip-bot for Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0eece2b22849c90b730815c893425a36b9d10fd5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome