linux/drivers/pinctrl/intel
Rushikesh S Kadam 5ff56b015e pinctrl: intel: Disable GPIO pin interrupts in suspend
The fix prevents unintended wakes from second level GPIO pin interrupts.

On some Intel Kabylake platforms, it is observed that GPIO pin interrupts
can wake the platform from suspend-to-idle, even though the IRQ is not
configured as IRQF_NO_SUSPEND or enable_irq_wake().

This can cause undesired wakes on Mobile devices such as Laptops and
Chromebook devices. For example a headset jack insertion is not a desired
wake source on Chromebook devices.

The pinctrl-intel (GPIO controller) driver implements a "Shared IRQ" model.
All GPIO pin interrupts are OR'ed and mapped to a first level IRQ14 (or
IRQ15). The driver registers an irq_chip struct and maps an irq_domain for
the GPIO pin interrupts. The IRQ14 handler demuxes and calls the second
level IRQ for the respective pin.

In the suspend entry flow, at suspend_noirq stage, the kernel disables IRQs
that are not marked for wake. The pinctrl-intel driver does not implement a
irq_disable()  callback (to take advantage of lazy disabling). The
pinctrl-intel GPIO interrupts are not disabled in hardware during suspend
entry, and thus are able to wake the SoC out of suspend-to-idle.

This patch sets the IRQCHIP_MASK_ON_SUSPEND flag for the GPIO irq_chip, to
disable the second level interrupts at suspend_noirq stage via the irq_mask
callbacks. The irq_mask callback disables the IRQs in hardware by
programming the corresponding GPIO pad registers. Only IRQs that are not
marked for wake are disabled.

Signed-off-by: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-and-tested-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-08-22 14:46:15 +02:00
..
Kconfig pinctrl: intel: Add Intel Denverton pin controller support 2017-08-14 15:01:59 +02:00
Makefile pinctrl: intel: Add Intel Denverton pin controller support 2017-08-14 15:01:59 +02:00
pinctrl-baytrail.c pinctrl: baytrail: Do not call WARN_ON for a firmware bug 2017-08-14 15:01:01 +02:00
pinctrl-broxton.c pinctrl: broxton: No need to take pointer of a pointer 2017-01-30 14:45:12 +01:00
pinctrl-cannonlake.c pinctrl: intel: Add Intel Cannon Lake PCH pin controller support 2017-06-09 13:03:47 +02:00
pinctrl-cherryview.c pinctrl: cherryview: Add Setzer models to the Chromebook DMI quirk 2017-08-03 10:18:34 +02:00
pinctrl-denverton.c pinctrl: intel: Add Intel Denverton pin controller support 2017-08-14 15:01:59 +02:00
pinctrl-geminilake.c pinctrl: intel: Add Intel Gemini Lake pin controller support 2017-01-30 15:06:01 +01:00
pinctrl-intel.c pinctrl: intel: Disable GPIO pin interrupts in suspend 2017-08-22 14:46:15 +02:00
pinctrl-intel.h pinctrl: intel: Make it possible to specify mode per pin in a group 2017-06-09 13:02:50 +02:00
pinctrl-merrifield.c pinctrl: intel: merrifield: Correct UART pin lists 2017-08-07 15:23:11 +02:00
pinctrl-sunrisepoint.c pinctrl: intel: Add support for variable size pad groups 2017-06-09 13:01:35 +02:00