• Rafael J. Wysocki's avatar
    PCMCIA / PM: Avoid noirq suspend aborts during suspend-to-idle · a548ba4d
    Rafael J. Wysocki authored
    [ Upstream commit dbdd0f58fd2cdde5cf945c9da67a2d52d32ba550 ]
    
    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: 33e4f80e (ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle)
    Signed-off-by: 's avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    [linux@dominikbrodowski.net: follow same codepaths for both suspend variants; call ->suspend()]
    Signed-off-by: 's avatarDominik Brodowski <linux@dominikbrodowski.net>
    Signed-off-by: 's avatarSasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a548ba4d
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
at91_cf.c Loading commit data...
bcm63xx_pcmcia.c Loading commit data...
bcm63xx_pcmcia.h Loading commit data...
bfin_cf_pcmcia.c Loading commit data...
cardbus.c Loading commit data...
cirrus.h Loading commit data...
cistpl.c Loading commit data...
cs.c Loading commit data...
cs_internal.h Loading commit data...
db1xxx_ss.c Loading commit data...
ds.c Loading commit data...
electra_cf.c Loading commit data...
i82092.c Loading commit data...
i82092aa.h Loading commit data...
i82365.c Loading commit data...
i82365.h Loading commit data...
m32r_cfc.c Loading commit data...
m32r_cfc.h Loading commit data...
m32r_pcc.c Loading commit data...
m32r_pcc.h Loading commit data...
o2micro.h Loading commit data...
omap_cf.c Loading commit data...
pcmcia_cis.c Loading commit data...
pcmcia_resource.c Loading commit data...
pd6729.c Loading commit data...
pd6729.h Loading commit data...
pxa2xx_balloon3.c Loading commit data...
pxa2xx_base.c Loading commit data...
pxa2xx_base.h Loading commit data...
pxa2xx_cm_x255.c Loading commit data...
pxa2xx_cm_x270.c Loading commit data...
pxa2xx_cm_x2xx.c Loading commit data...
pxa2xx_colibri.c Loading commit data...
pxa2xx_e740.c Loading commit data...
pxa2xx_hx4700.c Loading commit data...
pxa2xx_mainstone.c Loading commit data...
pxa2xx_palmld.c Loading commit data...
pxa2xx_palmtc.c Loading commit data...
pxa2xx_palmtx.c Loading commit data...
pxa2xx_sharpsl.c Loading commit data...
pxa2xx_stargate2.c Loading commit data...
pxa2xx_trizeps4.c Loading commit data...
pxa2xx_viper.c Loading commit data...
pxa2xx_vpac270.c Loading commit data...
ricoh.h Loading commit data...
rsrc_iodyn.c Loading commit data...
rsrc_mgr.c Loading commit data...
rsrc_nonstatic.c Loading commit data...
sa1100_assabet.c Loading commit data...
sa1100_cerf.c Loading commit data...
sa1100_generic.c Loading commit data...
sa1100_generic.h Loading commit data...
sa1100_h3600.c Loading commit data...
sa1100_nanoengine.c Loading commit data...
sa1100_shannon.c Loading commit data...
sa1100_simpad.c Loading commit data...
sa1111_badge4.c Loading commit data...
sa1111_generic.c Loading commit data...
sa1111_generic.h Loading commit data...
sa1111_jornada720.c Loading commit data...
sa1111_lubbock.c Loading commit data...
sa1111_neponset.c Loading commit data...
sa11xx_base.c Loading commit data...
sa11xx_base.h Loading commit data...
soc_common.c Loading commit data...
soc_common.h Loading commit data...
socket_sysfs.c Loading commit data...
tcic.c Loading commit data...
tcic.h Loading commit data...
ti113x.h Loading commit data...
topic.h Loading commit data...
vg468.h Loading commit data...
vrc4171_card.c Loading commit data...
vrc4173_cardu.c Loading commit data...
vrc4173_cardu.h Loading commit data...
xxs1500_ss.c Loading commit data...
yenta_socket.c Loading commit data...
yenta_socket.h Loading commit data...