android_kernel_oneplus_msm8998/drivers/base
Rafael J. Wysocki 1516d9fa63 PM / core: Clear the direct_complete flag on errors
commit 69e445ab8b66a9f30519842ef18be555d3ee9b51 upstream.

If __device_suspend() runs asynchronously (in which case the device
passed to it is in dpm_suspended_list at that point) and it returns
early on an error or pending wakeup, and the power.direct_complete
flag has been set for the device already, the subsequent
device_resume() will be confused by that and it will call
pm_runtime_enable() incorrectly, as runtime PM has not been
disabled for the device by __device_suspend().

To avoid that, clear power.direct_complete if __device_suspend()
is not going to disable runtime PM for the device before returning.

Fixes: aae4518b31 (PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily)
Reported-by: Al Cooper <alcooperx@gmail.com>
Tested-by: Al Cooper <alcooperx@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13 09:11:32 +02:00
..
power PM / core: Clear the direct_complete flag on errors 2018-10-13 09:11:32 +02:00
regmap regmap: Fix reversed bounds check in regmap_raw_write() 2018-04-24 09:32:06 +02:00
attribute_container.c
base.h
bus.c driver core: bus: Fix a potential double free 2017-09-13 14:09:44 -07:00
cacheinfo.c drivers: base: cacheinfo: fix boot error message when acpi is enabled 2018-01-31 12:06:08 +01:00
class.c
component.c
container.c
core.c driver core: Don't ignore class_dir_create_and_add() failure. 2018-07-03 11:21:25 +02:00
cpu.c x86/speculation/l1tf: Add sysfs reporting for l1tf 2018-08-15 17:42:09 +02:00
dd.c driver core: Partially revert "driver core: correct device's shutdown order" 2018-07-28 07:45:03 +02:00
devcoredump.c
devres.c
devtmpfs.c
dma-coherent.c
dma-contiguous.c
dma-mapping.c
driver.c
firmware.c
firmware_class.c
hypervisor.c
init.c
isa.c isa: Prevent NULL dereference in isa_bus driver callbacks 2017-12-16 10:33:48 +01:00
Kconfig sysfs/cpu: Add vulnerability folder 2018-01-17 09:35:33 +01:00
Makefile
map.c
memory.c base/memory, hotplug: fix a kernel oops in show_valid_zones() 2017-02-09 08:02:47 +01:00
module.c
node.c
pinctrl.c
platform-msi.c
platform.c driver core: platform: Don't read past the end of "driver_override" buffer 2017-10-12 11:27:32 +02:00
property.c
soc.c
syscore.c
topology.c
transport_class.c