android_kernel_samsung_msm8976/drivers/base
Doug Berger 328d47689c PM / wakeup: Only update last time for active wakeup sources
commit 2ef7c01c0cdb170142058c6d8fe0697aee4e4d7d upstream.

When wakelock support was added, the wakeup_source_add() function
was updated to set the last_time value of the wakeup source. This
has the unintended side effect of producing confusing output from
pm_print_active_wakeup_sources() when a wakeup source is added
prior to a sleep that is blocked by a different wakeup source.

The function pm_print_active_wakeup_sources() will search for the
most recently active wakeup source when no active source is found.
If a wakeup source is added after a different wakeup source blocks
the system from going to sleep it may have a later last_time value
than the blocking source and be output as the last active wakeup
source even if it has never actually been active.

It looks to me like the change to wakeup_source_add() was made to
prevent the wakelock garbage collection from accidentally dropping
a wakelock during the narrow window between adding the wakelock to
the wakelock list in wakelock_lookup_add() and the activation of
the wakeup source in pm_wake_lock().

This commit changes the behavior so that only the last_time of the
wakeup source used by a wakelock is initialized prior to adding it
to the wakeup source list. This preserves the meaning of the
last_time value as the last time the wakeup source was active and
allows a wakeup source that has never been active to have a
last_time value of 0.

Fixes: b86ff9820f (PM / Sleep: Add user space interface for manipulating wakeup sources, v3)
Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:52:47 +02:00
..
power PM / wakeup: Only update last time for active wakeup sources 2019-07-27 21:52:47 +02:00
regmap regmap: Don't use format_val in regmap_bulk_read 2019-07-27 21:52:21 +02:00
attribute_container.c
base.h
bus.c
class.c
core.c driver core: Delete an unnecessary check before the function call "put_device" 2019-07-27 21:42:21 +02:00
cpu.c
dd.c
devres.c Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
devtmpfs.c
dma-buf.c dma-buf: Check return value of anon_inode_getfile 2015-11-27 04:08:14 -08:00
dma-coherent.c bludgeon the flounder kernel until it builds on i386 for qemu testing 2015-09-16 18:20:19 +05:30
dma-contiguous.c Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD 2017-04-18 12:11:50 +02:00
dma-mapping.c
dma-removed.c drivers: dma-removed: use memset_io for ioremap region 2016-10-06 04:20:40 -07:00
driver.c
firmware.c
firmware_class.c firmware_class: make firmware caching configurable 2019-06-25 23:22:53 +02:00
hypervisor.c
init.c
isa.c
Kconfig firmware_class: make firmware caching configurable 2019-06-25 23:22:53 +02:00
Makefile
map.c
memory.c
module.c base: make module_create_drivers_dir race-free 2019-07-27 21:41:56 +02:00
node.c
pinctrl.c
platform.c drivercore: Fix unregistration path of platform devices 2015-09-21 10:00:10 -07:00
soc.c
syscore.c
topology.c
transport_class.c