linux/drivers/pcmcia
Rafael J. Wysocki dbdd0f58fd PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle
There is a problem with PCMCIA system resume callbacks with respect
to suspend-to-idle in which the ->suspend_noirq() callback may be
invoked after the ->resume_noirq() one without resuming the system
entirely in some cases.  This doesn't work for PCMCIA because of
the lack of symmetry between its system suspend and system resume
"noirq" callbacks.

The system resume handling in PCMCIA is split between
socket_early_resume() and socket_late_resume() which are called in
different phases of system resume and both need to run for
socket_suspend() (invoked by the system suspend "noirq" callback)
to work.  Specifically, socket_suspend() returns an error when
called after socket_early_resume() without socket_late_resume(),
so if the suspend-to-idle core detects a spurious wakeup event and
attempts to put the system back to sleep, that is aborted by the
error coming from socket_suspend().

Avoid that by using a new socket state flag, SOCKET_IN_RESUME,
to indicate that socket_early_resume() has already run for the
socket in which case socket_suspend() will do minimum handling
and return 0.

This change has been tested on my venerable Toshiba Portege R500
(which is where the problem has been discovered in the first place),
but admittedly I have no PCMCIA cards to test along with the socket
itself.

Fixes: 33e4f80ee6 (ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[linux@dominikbrodowski.net: follow same codepaths for both suspend variants; call ->suspend()]
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2018-02-22 22:51:12 +01:00
..
at91_cf.c pcmcia: at91_cf: Use PTR_ERR_OR_ZERO() 2017-11-29 21:58:58 +01:00
bcm63xx_pcmcia.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
bcm63xx_pcmcia.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bfin_cf_pcmcia.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
cardbus.c PCI: Add for_each_pci_bridge() helper 2017-11-06 18:48:58 -06:00
cirrus.h
cistpl.c pcmcia: make pccard_cis_attr const 2017-10-04 10:39:55 +02:00
cs_internal.h PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-02-22 22:51:12 +01:00
cs.c PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle 2018-02-22 22:51:12 +01:00
db1xxx_ss.c MIPS: Alchemy: Threaded carddetect irqs for devboards 2017-08-29 15:21:53 +02:00
ds.c pcmcia: ds: convert to use DRIVER_ATTR_RO 2017-06-12 16:14:30 +02:00
electra_cf.c pcmcia/electra_cf: Convert timers to use timer_setup() 2017-10-18 12:39:37 +01:00
i82092.c pcmcia: remove DEFINE_PCI_DEVICE_TABLE usage 2014-07-18 16:58:07 -07:00
i82092aa.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i82365.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
i82365.h
Kconfig pcmcia: at91_cf: Use syscon to configure the MC/smc 2015-05-20 16:37:38 +02:00
m32r_cfc.c pcmcia: m32r: Convert timers to use timer_setup() 2017-10-20 15:17:44 +02:00
m32r_cfc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
m32r_pcc.c pcmcia: m32r: Convert timers to use timer_setup() 2017-10-20 15:17:44 +02:00
m32r_pcc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
o2micro.h
omap_cf.c drivers/pcmcia: omap1: Fix error in automated timer conversion 2017-11-06 12:49:15 -08:00
pcmcia_cis.c pcmcia: Convert dev_printk to dev_<level> 2015-05-30 16:09:04 +02:00
pcmcia_resource.c pcmcia: Convert dev_printk to dev_<level> 2015-05-30 16:09:04 +02:00
pd6729.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
pd6729.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxa2xx_balloon3.c
pxa2xx_base.c pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
pxa2xx_base.h pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
pxa2xx_cm_x2xx.c
pxa2xx_cm_x255.c
pxa2xx_cm_x270.c
pxa2xx_colibri.c
pxa2xx_e740.c
pxa2xx_hx4700.c
pxa2xx_mainstone.c
pxa2xx_palmld.c
pxa2xx_palmtc.c
pxa2xx_palmtx.c
pxa2xx_sharpsl.c pcmcia: remove use of __devinit 2012-11-28 12:10:16 -08:00
pxa2xx_stargate2.c
pxa2xx_trizeps4.c
pxa2xx_viper.c pcmcia: drop owner assignment from platform_drivers 2014-10-20 16:21:21 +02:00
pxa2xx_vpac270.c gpio: Include linux/gpio.h instead of asm/gpio.h 2016-02-16 00:20:03 +01:00
ricoh.h
rsrc_iodyn.c
rsrc_mgr.c pcmcia: correct types 2015-01-12 05:04:12 -08:00
rsrc_nonstatic.c pcmcia: use proper printk format for resource 2018-01-24 19:24:38 +01:00
sa11xx_base.c pcmcia: sa11xx_base: add units to the timing information 2016-09-12 10:57:01 +01:00
sa11xx_base.h
sa1100_assabet.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_cerf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_generic.c pcmcia: sa11x0: convert memory allocation to devm_* API 2015-07-08 11:29:56 +01:00
sa1100_generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_h3600.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_nanoengine.c
sa1100_shannon.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1100_simpad.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_badge4.c drivers/pcmcia/sa1111_badge4.c: avoid unused function warning 2017-11-17 16:10:04 -08:00
sa1111_generic.c pcmcia: sa1111: remove special sa1111 mmio accessors 2017-10-03 13:24:11 +01:00
sa1111_generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_jornada720.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sa1111_lubbock.c pcmcia: lubbock: fix sockets configuration 2016-09-12 10:57:01 +01:00
sa1111_neponset.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
soc_common.c pcmcia: soc_common: Handle return value of clk_prepare_enable 2018-01-24 19:24:39 +01:00
soc_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
socket_sysfs.c
tcic.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
tcic.h
ti113x.h pcmcia: Convert dev_printk to dev_<level> 2015-05-30 16:09:04 +02:00
topic.h Disable write buffering on Toshiba ToPIC95 2015-06-13 23:40:21 +02:00
vg468.h
vrc4171_card.c pcmcia/vrc4171: Remove typedefs for enums and struct 2015-05-30 15:55:36 +02:00
vrc4173_cardu.c pcmcia: remove DEFINE_PCI_DEVICE_TABLE usage 2014-07-18 16:58:07 -07:00
vrc4173_cardu.h
xxs1500_ss.c drivers/pcmcia: include <module.h> for modular xxs1500_ss code 2015-06-16 14:12:25 -04:00
yenta_socket.c drivers/pcmcia: Convert timers to use timer_setup() 2017-11-04 12:03:13 +01:00
yenta_socket.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00