Skip to contentSkip to conversation

pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems

PATCH Superseded Mika Westerberg 4 participants 7 messages Dec 1, 2017 – Dec 3, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Mika Westerberg

author maintainer
#0 lore raw

PATCH 1/1 pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems

Guenter Roeck reported an interrupt storm on a prototype system which is based on Cyan Chromebook. The root cause turned out to be a incorrectly configured pin that triggers spurious interrupts. This will be fixed in coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/pinctrl/intel/pinctrl-cherryview.c +16 -0
index aa6c9f569c2b..083ffd397154 100644
@@ -1601,6 +1601,22 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
 			clear_bit(i, chip->irq.valid_mask);
 	}
 
+	/*
+	 * The same set of machines in chv_no_valid_mask[] have incorrectly
+	 * configured GPIOs that generate spurious interrupts so we use
+	 * this same list to apply another quirk for them.
+	 *
+	 * See also https://bugzilla.kernel.org/show_bug.cgi?id=197953.
+	 */
+	if (!need_valid_mask) {
+		/*
+		 * Mask all interrupts the community is able to generate
+		 * but leave the ones that can only generate GPEs unmasked.
+		 */
+		chv_writel(~(BIT(pctrl->community->nirqs) - 1),
+			   pctrl->regs + CHV_INTMASK);
+	}
+
 	/* Clear all interrupts */
 	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
 
Signature · 1 line
2.15.0
#1 lore raw
Quoted 10 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is
based on Cyan Chromebook. The root cause turned out to be a incorrectly
configured pin that triggers spurious interrupts. This will be fixed in
coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Shouldn't be this URL to the bug mentioned in the comments below?

drivers/pinctrl/intel/pinctrl-cherryview.c static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) · line 1617

Quoted 13 lines
(quoted diff) +2 -0
+	/*
+	 * The same set of machines in chv_no_valid_mask[] have

incorrectly

(quoted diff) +1 -0
+	 * configured GPIOs that generate spurious interrupts so we

use

drivers/pinctrl/intel/pinctrl-cherryview.c +3 -0
+	 * this same list to apply another quirk for them.
+	 *
+	 * See also https://bugzilla.kernel.org/show_bug.cgi?id=19795

3.

drivers/pinctrl/intel/pinctrl-cherryview.c +3 -0
+	 */
 
+		chv_writel(~(BIT(pctrl->community->nirqs) - 1),
+			   pctrl->regs + CHV_INTMASK);

It might be considered to use

GENMASK(32, pctrl->community->nirqs)

instead of

~(BIT(pctrl->community->nirqs) - 1)

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
author maintainer
#2 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is
based on Cyan Chromebook. The root cause turned out to be a incorrectly
configured pin that triggers spurious interrupts. This will be fixed in
coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Quoted 3 lines
Quoted 1 line

Shouldn't be this URL to the bug mentioned in the comments below?

Doh! Yes, it should. I'll fix it up.

Quoted 16 lines

drivers/pinctrl/intel/pinctrl-cherryview.c static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) · line 1617

Quoted 13 lines
(quoted diff) +2 -0
+	/*
+	 * The same set of machines in chv_no_valid_mask[] have

incorrectly

(quoted diff) +1 -0
+	 * configured GPIOs that generate spurious interrupts so we

use

drivers/pinctrl/intel/pinctrl-cherryview.c +3 -0
+	 * this same list to apply another quirk for them.
+	 *
+	 * See also https://bugzilla.kernel.org/show_bug.cgi?id=19795

3.

drivers/pinctrl/intel/pinctrl-cherryview.c +3 -0
+	 */
 
+		chv_writel(~(BIT(pctrl->community->nirqs) - 1),
+			   pctrl->regs + CHV_INTMASK);

It might be considered to use

Quoted 5 lines

GENMASK(32, pctrl->community->nirqs)

instead of

~(BIT(pctrl->community->nirqs) - 1)

Indeed it looks better with GENMASK() so I'll change it in the next version.

Tested-by on v1 1/1
#3 lore raw
In reply to Mika Westerberg
Quoted 10 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is based on Cyan Chromebook. The root cause turned out to be a incorrectly configured pin that triggers spurious interrupts. This will be fixed in coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Guenter

Quoted 34 lines
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/pinctrl/intel/pinctrl-cherryview.c +16 -0
index aa6c9f569c2b..083ffd397154 100644
@@ -1601,6 +1601,22 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
 			clear_bit(i, chip->irq.valid_mask);
 	}
 
+	/*
+	 * The same set of machines in chv_no_valid_mask[] have incorrectly
+	 * configured GPIOs that generate spurious interrupts so we use
+	 * this same list to apply another quirk for them.
+	 *
+	 * See also https://bugzilla.kernel.org/show_bug.cgi?id=197953.
+	 */
+	if (!need_valid_mask) {
+		/*
+		 * Mask all interrupts the community is able to generate
+		 * but leave the ones that can only generate GPEs unmasked.
+		 */
+		chv_writel(~(BIT(pctrl->community->nirqs) - 1),
+			   pctrl->regs + CHV_INTMASK);
+	}
+
 	/* Clear all interrupts */
 	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
 
Signature · 1 line
2.15.0
#4 lore raw
In reply to Mika Westerberg
Quoted 10 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is based on Cyan Chromebook. The root cause turned out to be a incorrectly configured pin that triggers spurious interrupts. This will be fixed in coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Yours,
Linus Walleij

#5 lore raw
Quoted 9 lines · Linus Walleij
Quoted 6 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is based on Cyan Chromebook. The root cause turned out to be a incorrectly configured pin that triggers spurious interrupts. This will be fixed in coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Quoted 7 lines
Quoted 4 lines
Fixes bcb48cca23ec ("pinctrl: cherryview: Do not mask all interrupts in probe")

Mika, any chance to send an update soon ? I would like to apply the patch to chromeos-4.14, and I would prefer to use the final version.

On a side note, I confirmed that the problem is also seen on release systems (Acer Chromebook R11) as well as on other systems using the same chipset, such as Samsung Chromebook 3.

Thanks,
Guenter

author maintainer
#6 lore raw
Quoted 15 lines · Guenter Roeck
Quoted 14 lines · Linus Walleij
Quoted 10 lines · Mika Westerberg

Guenter Roeck reported an interrupt storm on a prototype system which is based on Cyan Chromebook. The root cause turned out to be a incorrectly configured pin that triggers spurious interrupts. This will be fixed in coreboot but currently we need to prevent the interrupt storm from happening by masking all interrupts (but not GPEs) on those systems.

Quoted 4 lines
Quoted 2 lines
Fixes bcb48cca23ec ("pinctrl: cherryview: Do not mask all interrupts in probe")

Right, thanks. I'll add them to v2.

Quoted 2 lines

Mika, any chance to send an update soon ? I would like to apply the patch to chromeos-4.14, and I would prefer to use the final version.

I'll send an updated version tomorrow.