linux_dsm_epyc7002/drivers/pinctrl
Hans de Goede 40ecab5512 pinctrl: baytrail: Really serialize all register accesses
Commit 39ce8150a0 ("pinctrl: baytrail: Serialize all register access")
added a spinlock around all register accesses because:

"There is a hardware issue in Intel Baytrail where concurrent GPIO register
 access might result reads of 0xffffffff and writes might get dropped
 completely."

Testing has shown that this does not catch all cases, there are still
2 problems remaining

1) The original fix uses a spinlock per byt_gpio device / struct,
additional testing has shown that this is not sufficient concurent
accesses to 2 different GPIO banks also suffer from the same problem.

This commit fixes this by moving to a single global lock.

2) The original fix did not add a lock around the register accesses in
the suspend/resume handling.

Since pinctrl-baytrail.c is using normal suspend/resume handlers,
interrupts are still enabled during suspend/resume handling. Nothing
should be using the GPIOs when they are being taken down, _but_ the
GPIOs themselves may still cause interrupts, which are likely to
use (read) the triggering GPIO. So we need to protect against
concurrent GPIO register accesses in the suspend/resume handlers too.

This commit fixes this by adding the missing spin_lock / unlock calls.

The 2 fixes together fix the Acer Switch 10 SW5-012 getting completely
confused after a suspend resume. The DSDT for this device has a bug
in its _LID method which reprograms the home and power button trigger-
flags requesting both high and low _level_ interrupts so the IRQs for
these 2 GPIOs continuously fire. This combined with the saving of
registers during suspend, triggers concurrent GPIO register accesses
resulting in saving 0xffffffff as pconf0 value during suspend and then
when restoring this on resume the pinmux settings get all messed up,
resulting in various I2C busses being stuck, the wifi no longer working
and often the tablet simply not coming out of suspend at all.

Cc: stable@vger.kernel.org
Fixes: 39ce8150a0 ("pinctrl: baytrail: Serialize all register access")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-12-09 12:42:13 +02:00
..
actions pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
aspeed pinctrl: aspeed-g6: Rename SD3 to EMMC and rework pin groups 2019-10-16 15:58:27 +02:00
bcm Linux 5.4-rc5 2019-11-13 23:10:52 +01:00
berlin pinctrl: berlin: as370: fix a typo s/spififib/spdifib 2019-10-16 14:12:55 +02:00
cirrus pinctrl: madera: Add configuration for Cirrus Logic CS47L92 2019-08-05 11:48:03 +02:00
freescale pinctrl: Fix Kconfig indentation 2019-11-21 15:06:07 +01:00
intel pinctrl: baytrail: Really serialize all register accesses 2019-12-09 12:42:13 +02:00
mediatek pinctrl: mediatek: use devm_platform_ioremap_resource() to simplify code 2019-10-24 14:03:27 +02:00
meson pinctrl: meson: add pinctrl driver support for Meson-A1 SoC 2019-11-19 15:55:26 +01:00
mvebu pinctrl: Fix Kconfig indentation 2019-11-21 15:06:07 +01:00
nomadik pinctrl: nomadik: db8500: Add mc0_a_2 pin group without direction control 2019-11-19 15:49:22 +01:00
nuvoton pinctrl: nuvoton: npcm7xx: Pass irqchip when adding gpiochip 2019-09-30 23:13:08 +02:00
pxa pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
qcom Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-12-03 09:29:50 -08:00
samsung pinctrl: samsung: Fix device node refcount leaks in init code 2019-10-01 20:22:04 +02:00
sh-pfc pinctrl: sh-pfc: sh7734: Fix duplicate TCLK1_B 2019-11-01 13:42:52 +01:00
sirf pinctrl: sirf/atlas7: Pass irqchip when adding gpiochip 2019-09-30 23:13:08 +02:00
spear pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
sprd pinctrl: sprd: Add CM4 sleep mode support 2019-10-16 16:01:24 +02:00
stm32 pinctrl: stm32: stm32: Add of_node_put() before return 2019-08-10 10:21:51 +02:00
sunxi pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
tegra pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
ti pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call 2019-10-04 23:08:47 +02:00
uniphier pinctrl: uniphier: Fix Pro5 SD pin-mux setting 2019-08-05 13:21:31 +02:00
vt8500 pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
zte pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
core.c pinctrl/gpio: Take MUX usage into account 2019-08-23 11:09:41 +02:00
core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
devicetree.c pinctrl: just return if no valid maps 2019-11-05 11:25:39 +01:00
devicetree.h pinctrl: devicetree.c: remove orphan pinctrl_dt_has_hogs() 2019-10-04 23:26:23 +02:00
Kconfig pinctrl: Fix Kconfig indentation 2019-11-21 15:06:07 +01:00
Makefile pinctrl: Add pinmux & GPIO controller driver for a new SoC 2019-11-21 14:47:44 +01:00
pinconf-generic.c This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
pinconf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinconf.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinctrl-amd.c pinctrl: amd: fix __iomem annotation in amd_gpio_irq_handler() 2019-11-04 16:08:07 +01:00
pinctrl-amd.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-artpec6.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-as3722.c pinctrl: Include <linux/gpio/driver.h> nothing else 2018-09-14 15:10:57 +02:00
pinctrl-at91-pio4.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-at91.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-at91.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-axp209.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-bm1880.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-coh901.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-coh901.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-da850-pupd.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-digicolor.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-equilibrium.c pinctrl: Fix warning by adding missing MODULE_LICENSE 2019-11-28 09:12:43 +01:00
pinctrl-equilibrium.h pinctrl: Add pinmux & GPIO controller driver for a new SoC 2019-11-21 14:47:44 +01:00
pinctrl-falcon.c pinctrl: falcon: Add of_node_put() before return 2019-08-06 14:50:04 +02:00
pinctrl-gemini.c pinctrl: gemini: Fix up TVC clock group 2018-10-10 21:05:35 +02:00
pinctrl-ingenic.c pinctrl: ingenic: Add OTG VBUS pin for the JZ4770 2019-11-21 15:10:36 +01:00
pinctrl-lantiq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
pinctrl-lantiq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
pinctrl-lpc18xx.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-max77620.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Fix add_data and irqchip_add_nested call order 2019-06-25 14:14:26 +02:00
pinctrl-ocelot.c pinctrl: ocelot: Pass irqchip when adding gpiochip 2019-10-16 15:03:40 +02:00
pinctrl-oxnas.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-palmas.c pinctrl: palmas: Delete an error message for a failed memory allocation in palmas_pinctrl_probe() 2018-01-03 08:46:49 +01:00
pinctrl-pic32.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-pic32.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pinctrl-pistachio.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-rk805.c pinctrl: rk805: Make structures constant 2019-08-21 09:00:16 +02:00
pinctrl-rockchip.c pinctrl: rockchip: add rk3308 SoC support 2019-10-16 15:56:19 +02:00
pinctrl-rza1.c pinctrl: rza1: remove unnecessary static inline function 2019-11-21 14:33:33 +01:00
pinctrl-rza2.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-rzn1.c pinctrl: rzn1: Make array reg_drive static, makes object smaller 2019-10-14 12:11:12 +02:00
pinctrl-single.c pinctrl: Convert to using %pOFn instead of device_node.name 2018-08-29 14:05:36 +02:00
pinctrl-st.c pinctrl: st: Pass irqchip when adding gpiochip 2019-10-16 13:45:27 +02:00
pinctrl-stmfx.c This is the bulk of pin control changes for the v5.5 kernel 2019-11-27 10:00:33 -08:00
pinctrl-sx150x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
pinctrl-tb10x.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-u300.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-utils.c pinctrl: utils: Delete an error message for a failed memory allocation in pinctrl_utils_add_map_configs() 2018-01-03 08:46:53 +01:00
pinctrl-utils.h
pinctrl-xway.c pinctrl: use devm_platform_ioremap_resource() to simplify code 2019-11-05 15:33:40 +01:00
pinctrl-zynq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
pinmux.c pinctrl/gpio: Take MUX usage into account 2019-08-23 11:09:41 +02:00
pinmux.h pinctrl/gpio: Take MUX usage into account 2019-08-23 11:09:41 +02:00