linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
@ 2017-12-04  9:11 Mika Westerberg
  2017-12-07  8:47 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2017-12-04  9:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andy Shevchenko, Heikki Krogerus, Guenter Roeck, Dmitry Torokhov,
	Mika Westerberg, linux-gpio

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.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=197953
Fixes: bcb48cca23ec ("pinctrl: cherryview: Do not mask all interrupts in probe")
Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: stable@vger.kernel.org
---
Changes from v1:

 * Correct Link to point to the right bugzilla entry
 * Add missing Fixes: and Cc: lines
 * Use GENMASK() instead

 drivers/pinctrl/intel/pinctrl-cherryview.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index aa6c9f569c2b..b1ae1618fefe 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -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(GENMASK(31, pctrl->community->nirqs),
+			   pctrl->regs + CHV_INTMASK);
+	}
+
 	/* Clear all interrupts */
 	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
 
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-04  9:11 [PATCH v2] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
@ 2017-12-07  8:47 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-12-07  8:47 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Andy Shevchenko, Heikki Krogerus, Guenter Roeck, Dmitry Torokhov,
	linux-gpio

On Mon, Dec 4, 2017 at 10:11 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:

> 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.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=197953
> Fixes: bcb48cca23ec ("pinctrl: cherryview: Do not mask all interrupts in probe")
> Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
> Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: stable@vger.kernel.org
> ---
> Changes from v1:

Patch applied for fixes.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-07  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04  9:11 [PATCH v2] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
2017-12-07  8:47 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).