Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467453 > unrolled thread

[PULL] irqchip fixes for 4.8-rc4

Started byMarc Zyngier <marc.zyngier@arm.com>
First post2016-08-22 10:30 +0200
Last post2016-08-22 10:30 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PULL] irqchip fixes for 4.8-rc4 Marc Zyngier <marc.zyngier@arm.com> - 2016-08-22 10:30 +0200
    [PATCH 4/4] irqchip/gicv3-its: Disable the ITS before initializing it Marc Zyngier <marc.zyngier@arm.com> - 2016-08-22 10:30 +0200
    [PATCH 3/4] irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts Marc Zyngier <marc.zyngier@arm.com> - 2016-08-22 10:30 +0200

#1467453 — [PULL] irqchip fixes for 4.8-rc4

FromMarc Zyngier <marc.zyngier@arm.com>
Date2016-08-22 10:30 +0200
Subject[PULL] irqchip fixes for 4.8-rc4
Message-ID<s8SMh-3Ra-9@gated-at.bofh.it>
Hi Thomas,

Please find below a handful of fixes targetted at the current
cycle. The most important thing is a fix for the trigger configuration
on chained irqchip (please see the discussion here[1] for
details). The rest is the usual GIC churn, nothing massively critical.

Please pull!

Thanks,

	M.

[1] https://lkml.org/lkml/2016/7/30/3

The following changes since commit 694d0d0bb2030d2e36df73e2d23d5770511dbc8d:

  Linux 4.8-rc2 (2016-08-14 19:11:36 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git tags/irqchip-for-4.8-rc4

for you to fetch changes up to 7611da865c1060b2a7c87a15de663a59035747f8:

  irqchip/gicv3-its: Disable the ITS before initializing it (2016-08-19 09:47:07 +0100)

----------------------------------------------------------------
genirq/irqchip fixes for 4.8-rc4

- A critical fix for chained irqchip where we failed to configure
  the cascade interrupt trigger
- A GIC fix for self-IPI in SMP-on-UP configurations
- A PM fix for GICv3
- A initialization fix the the GICv3 ITS, triggered by kexec

----------------------------------------------------------------
David Daney (1):
      irqchip/gicv3-its: Disable the ITS before initializing it

Marc Zyngier (2):
      genirq: Correctly configure the trigger on chained interrupts
      irqchip/gic: Allow self-SGIs for SMP on UP configurations

Sudeep Holla (1):
      irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts

 drivers/irqchip/irq-gic-v3-its.c |  7 ++++++-
 drivers/irqchip/irq-gic-v3.c     | 11 +++++++++--
 drivers/irqchip/irq-gic.c        |  7 +++++++
 kernel/irq/chip.c                | 11 +++++++++++
 4 files changed, 33 insertions(+), 3 deletions(-)

[toc] | [next] | [standalone]


#1467454 — [PATCH 4/4] irqchip/gicv3-its: Disable the ITS before initializing it

FromMarc Zyngier <marc.zyngier@arm.com>
Date2016-08-22 10:30 +0200
Subject[PATCH 4/4] irqchip/gicv3-its: Disable the ITS before initializing it
Message-ID<s8SMh-3Ra-31@gated-at.bofh.it>
In reply to#1467453
From: David Daney <david.daney@cavium.com>

When starting a kexec/kdump kernel, the GIC ITS will already have been
enabled.  According to the ARM Generic Interrupt Controller
Architecture Specification (GIC architecture Version 3.0 and version
4.0), writing to GITS_BASER<n> or GITS_CBASER is "UNPREDICTABLE" when
the ITS is enabled.  On Cavium Thunder systems, this prevents the ITS
from being initializing in the kexec/kdump kernel, resulting in
failure to register/enable interrupts for all devices.

The fix is to disable the ITS if it is not already in the disabled
state.  This allows the ITS to be properly initialized and then
re-enabled in the kexec/kdump kernel.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 7ceaba8..36b9c28 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1545,7 +1545,12 @@ static int its_force_quiescent(void __iomem *base)
 	u32 val;
 
 	val = readl_relaxed(base + GITS_CTLR);
-	if (val & GITS_CTLR_QUIESCENT)
+	/*
+	 * GIC architecture specification requires the ITS to be both
+	 * disabled and quiescent for writes to GITS_BASER<n> or
+	 * GITS_CBASER to not have UNPREDICTABLE results.
+	 */
+	if ((val & GITS_CTLR_QUIESCENT) && !(val & GITS_CTLR_ENABLE))
 		return 0;
 
 	/* Disable the generation of all interrupts to this ITS */
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1467455 — [PATCH 3/4] irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts

FromMarc Zyngier <marc.zyngier@arm.com>
Date2016-08-22 10:30 +0200
Subject[PATCH 3/4] irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts
Message-ID<s8SMi-3Ra-33@gated-at.bofh.it>
In reply to#1467453
From: Sudeep Holla <sudeep.holla@arm.com>

As per the GICv3 specification, to power down a processor using GICv3
and allow automatic power-on if an interrupt must be sent to a processor,
software must set Enable to zero for all interrupt groups(by writing
to GICC_CTLR or ICC_IGRPEN{0,1}_EL1/3 as appropriate.

When commit 3708d52fc6bb ("irqchip: gic-v3: Implement CPU PM notifier")
was introduced there were no firmware implementations(in particular PSCI)
handling this.

Linux kernel may not be aware of the CPU power state details and might
fail to identify the power states that require quiescing the CPU
interface. Even if it can be aware of those details, it can't determine
which CPU power state have been triggered at the platform level and how
the power control is implemented.

This patch make disabling redistributor and group1 non-secure interrupts
in the power down path and re-enabling of redistributor in the power-up
path conditional. It will be handled in the kernel if and only if the
non-secure accesses are permitted to access and modify control registers.
It is left to the platform implementation otherwise.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Tested-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/irqchip/irq-gic-v3.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 6fc56c3..ede5672 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -667,13 +667,20 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 #endif
 
 #ifdef CONFIG_CPU_PM
+/* Check whether it's single security state view */
+static bool gic_dist_security_disabled(void)
+{
+	return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS;
+}
+
 static int gic_cpu_pm_notifier(struct notifier_block *self,
 			       unsigned long cmd, void *v)
 {
 	if (cmd == CPU_PM_EXIT) {
-		gic_enable_redist(true);
+		if (gic_dist_security_disabled())
+			gic_enable_redist(true);
 		gic_cpu_sys_reg_init();
-	} else if (cmd == CPU_PM_ENTER) {
+	} else if (cmd == CPU_PM_ENTER && gic_dist_security_disabled()) {
 		gic_write_grpen1(0);
 		gic_enable_redist(false);
 	}
-- 
2.1.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web