All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
@ 2017-12-01 10:25 Mika Westerberg
  2017-12-01 12:35 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mika Westerberg @ 2017-12-01 10:25 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=194945
Reported-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>
---
 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..083ffd397154 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(~(BIT(pctrl->community->nirqs) - 1),
+			   pctrl->regs + CHV_INTMASK);
+	}
+
 	/* Clear all interrupts */
 	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
 
-- 
2.15.0


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

* Re: [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-01 10:25 [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
@ 2017-12-01 12:35 ` Andy Shevchenko
  2017-12-01 13:33   ` Mika Westerberg
  2017-12-01 18:21 ` Guenter Roeck
  2017-12-02 15:51 ` Linus Walleij
  2 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2017-12-01 12:35 UTC (permalink / raw)
  To: Mika Westerberg, Linus Walleij
  Cc: Heikki Krogerus, Guenter Roeck, Dmitry Torokhov, linux-gpio

On Fri, 2017-12-01 at 13:25 +0300, Mika Westerberg 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=194945

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

> +	/*
> +	 * 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=19795
> 3.
> +	 */

> +		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)

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

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

On Fri, Dec 01, 2017 at 02:35:32PM +0200, Andy Shevchenko wrote:
> On Fri, 2017-12-01 at 13:25 +0300, Mika Westerberg 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=194945
> 
> Shouldn't be this URL to the bug mentioned in the comments below?

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

> > +	/*
> > +	 * 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=19795
> > 3.
> > +	 */
> 
> > +		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)

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

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

* Re: [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-01 10:25 [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
  2017-12-01 12:35 ` Andy Shevchenko
@ 2017-12-01 18:21 ` Guenter Roeck
  2017-12-02 15:51 ` Linus Walleij
  2 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2017-12-01 18:21 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Linus Walleij, Andy Shevchenko, Heikki Krogerus, Dmitry Torokhov,
	linux-gpio

On Fri, Dec 01, 2017 at 01:25:04PM +0300, Mika Westerberg 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=194945
> Reported-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>

Tested-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> ---
>  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..083ffd397154 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(~(BIT(pctrl->community->nirqs) - 1),
> +			   pctrl->regs + CHV_INTMASK);
> +	}
> +
>  	/* Clear all interrupts */
>  	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
>  
> -- 
> 2.15.0
> 

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

* Re: [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-01 10:25 [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
  2017-12-01 12:35 ` Andy Shevchenko
  2017-12-01 18:21 ` Guenter Roeck
@ 2017-12-02 15:51 ` Linus Walleij
  2017-12-02 17:25   ` Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2017-12-02 15:51 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Andy Shevchenko, Heikki Krogerus, Guenter Roeck, Dmitry Torokhov,
	linux-gpio

On Fri, Dec 1, 2017 at 11:25 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=194945
> Reported-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>

Fixes:?
Cc: stable@vger.kernel.org?

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-02 15:51 ` Linus Walleij
@ 2017-12-02 17:25   ` Guenter Roeck
  2017-12-03 14:00     ` Mika Westerberg
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2017-12-02 17:25 UTC (permalink / raw)
  To: Linus Walleij, Mika Westerberg
  Cc: Andy Shevchenko, Heikki Krogerus, Dmitry Torokhov, linux-gpio

On 12/02/2017 07:51 AM, Linus Walleij wrote:
> On Fri, Dec 1, 2017 at 11:25 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=194945
>> Reported-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>
> 
> Fixes:?
> Cc: stable@vger.kernel.org?

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

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

* Re: [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems
  2017-12-02 17:25   ` Guenter Roeck
@ 2017-12-03 14:00     ` Mika Westerberg
  0 siblings, 0 replies; 7+ messages in thread
From: Mika Westerberg @ 2017-12-03 14:00 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Linus Walleij, Andy Shevchenko, Heikki Krogerus, Dmitry Torokhov,
	linux-gpio

On Sat, Dec 02, 2017 at 09:25:13AM -0800, Guenter Roeck wrote:
> On 12/02/2017 07:51 AM, Linus Walleij wrote:
> > On Fri, Dec 1, 2017 at 11:25 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=194945
> > > Reported-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>
> > 
> > Fixes:?
> > Cc: stable@vger.kernel.org?
> 
> Fixes: bcb48cca23ec ("pinctrl: cherryview: Do not mask all interrupts in probe")

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

> 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.

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

end of thread, other threads:[~2017-12-03 14:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01 10:25 [PATCH] pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems Mika Westerberg
2017-12-01 12:35 ` Andy Shevchenko
2017-12-01 13:33   ` Mika Westerberg
2017-12-01 18:21 ` Guenter Roeck
2017-12-02 15:51 ` Linus Walleij
2017-12-02 17:25   ` Guenter Roeck
2017-12-03 14:00     ` Mika Westerberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.