linux/drivers/pinctrl
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
..
aspeed pinctrl: aspeed: g5: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:40:25 +02:00
bcm pinctrl: bcm281xx: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:36:25 +02:00
berlin pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
freescale pinctrl: Convert to using %pOF instead of full_name 2017-08-14 15:01:02 +02:00
intel pinctrl: intel: Disable GPIO pin interrupts in suspend 2017-08-22 14:46:15 +02:00
mediatek pinctrl: mediatek: reuse pinctrl driver for mt7623 2017-05-22 10:39:25 +02:00
meson pinctrl: meson-gxl: add tsin_a pins 2017-06-16 11:08:49 +02:00
mvebu pinctrl: armada-37xx: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:37:27 +02:00
nomadik pinctrl: nomadik: fix incorrect type in return expression 2017-08-14 15:01:59 +02:00
pxa
qcom pinctrl: qcom: spmi-gpio: Add dtest route for digital input 2017-08-15 11:17:41 +02:00
samsung Samsung pinctrl driver changes for v4.14: 2017-08-14 16:55:01 +02:00
sh-pfc pinctrl: Convert to using %pOF instead of full_name 2017-08-14 15:01:02 +02:00
sirf pinctrl: sirf: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:08 +02:00
spear
stm32 pinctrl: stm32: explicitly request exclusive reset control 2017-08-14 15:01:01 +02:00
sunxi pinctrl: sunxi: fix V3s pinctrl driver IRQ bank base 2017-08-14 15:01:03 +02:00
tegra pinctrl: tegra: explicitly request exclusive reset control 2017-08-14 15:01:02 +02:00
ti pinctrl: ti-iodelay: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:48 +02:00
uniphier pinctrl: uniphier: add Audio out pin-mux settings 2017-08-22 14:35:03 +02:00
vt8500 pinctrl: vt8500: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:43:08 +02:00
zte pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state() 2017-08-14 15:01:01 +02:00
core.c pinctrl: add __rcu annotations to fix sparse warnings 2017-08-14 15:01:59 +02:00
core.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
devicetree.c pinctrl: Convert to using %pOF instead of full_name 2017-08-14 15:01:02 +02:00
devicetree.h
Kconfig pinctrl: add a Gemini SoC pin controller 2017-08-14 15:01:59 +02:00
Makefile pinctrl: add a Gemini SoC pin controller 2017-08-14 15:01:59 +02:00
pinconf-generic.c pinctrl: Convert to using %pOF instead of full_name 2017-08-14 15:01:02 +02:00
pinconf.c pinctrl: check ops->pin_config_set in pinconf_set_config() 2017-08-14 15:01:59 +02:00
pinconf.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c
pinctrl-adi2.c pinctrl: adi2: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:40:45 +02:00
pinctrl-adi2.h
pinctrl-amd.c pinctrl: amd: fix error return code in amd_gpio_probe() 2017-08-22 14:24:37 +02:00
pinctrl-amd.h pinctrl: amd: make use of raw_spinlock variants 2017-03-16 16:39:15 +01:00
pinctrl-artpec6.c pinctrl: artpec6: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:36:59 +02:00
pinctrl-as3722.c
pinctrl-at91-pio4.c pinctrl: Convert to using %pOF instead of full_name 2017-08-14 15:01:02 +02:00
pinctrl-at91.c
pinctrl-at91.h
pinctrl-coh901.c pinctrl: coh901: constify gpio_chip structure 2017-08-14 15:00:59 +02:00
pinctrl-coh901.h
pinctrl-da850-pupd.c
pinctrl-digicolor.c pinctrl: digicolor: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:36 +02:00
pinctrl-falcon.c
pinctrl-gemini.c pinctrl: add a Gemini SoC pin controller 2017-08-14 15:01:59 +02:00
pinctrl-ingenic.c pinctrl: ingenic: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:05 +02:00
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08.c pinctrl: mcp23s08: drop comment about missing irq support 2017-05-23 09:51:08 +02:00
pinctrl-oxnas.c
pinctrl-palmas.c
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rockchip.c pinctrl: rockchip: add input schmitt support for rv1108 2017-08-14 15:01:02 +02:00
pinctrl-rza1.c pinctrl: rza1: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:23 +02:00
pinctrl-single.c pinctrl: single: use of_device_get_match_data() to get soc data 2017-05-29 10:18:46 +02:00
pinctrl-st.c pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:38:03 +02:00
pinctrl-sx150x.c
pinctrl-tb10x.c pinctrl: tb10x: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:40 +02:00
pinctrl-tz1090-pdc.c pinctrl: tz1090-pdc: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:00 +02:00
pinctrl-tz1090.c pinctrl: tz1090: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:19 +02:00
pinctrl-u300.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c pinctrl: xway: fix copy/paste error in xrx200_grps 2017-05-29 18:46:42 +02:00
pinctrl-zynq.c pinctrl: zynq: Fix warnings in the driver 2017-08-14 15:01:01 +02:00
pinmux.c pinctrl: add __rcu annotations to fix sparse warnings 2017-08-14 15:01:59 +02:00
pinmux.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00