linux/drivers/base
Rafael J. Wysocki a5a6cebdd0 PM / core: Clear the direct_complete flag on errors
commit 69e445ab8b 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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-12-16 22:09:35 +00:00
..
power PM / core: Clear the direct_complete flag on errors 2018-12-16 22:09:35 +00:00
regmap regmap: Don't use format_val in regmap_bulk_read 2018-10-21 08:44:46 +01:00
attribute_container.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
base.h driver core: Move driver_data back to struct device 2014-05-27 12:37:18 -07:00
bus.c driver core: bus: Fix a potential double free 2017-11-26 13:50:28 +00:00
class.c sysfs: make attr namespace interface less convoluted 2013-09-26 14:50:01 -07:00
component.c drivers/base: fix devres handling for master device 2014-02-07 16:45:14 -08:00
container.c ACPI / hotplug / driver core: Handle containers in a special way 2013-12-29 15:25:48 +01:00
core.c driver core: Don't ignore class_dir_create_and_add() failure. 2018-11-20 18:04:55 +00:00
cpu.c x86/speculation/l1tf: Add sysfs reporting for l1tf 2018-10-03 04:10:01 +01:00
dd.c driver core: Inline dev_set/get_drvdata 2014-05-27 13:46:59 -07:00
devres.c devres: fix devres_get() 2015-09-28 10:21:36 +01:00
devtmpfs.c devtmpfs: Calling delete_path() only when necessary 2013-12-19 10:10:32 -08:00
dma-buf.c dma-buf: fix trivial typo error 2014-05-05 15:28:05 +02:00
dma-coherent.c DMA-API: Change dma_declare_coherent_memory() CPU address to phys_addr_t 2014-05-20 16:55:23 -06:00
dma-contiguous.c DMA, CMA: fix possible memory leak 2014-06-23 16:47:44 -07:00
dma-mapping.c drivers: base: dma-mapping: Fix typo in dmam_alloc_non_coherent comments 2017-03-16 02:26:27 +00:00
driver.c driver core: add #include <linux/sysfs.h> to core files. 2013-08-27 10:24:15 -07:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
firmware_class.c firmware: actually return NULL on failed request_firmware_nowait() 2016-02-02 19:48:28 +00:00
hypervisor.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
init.c ACPI / hotplug / driver core: Handle containers in a special way 2013-12-29 15:25:48 +01:00
isa.c isa: Prevent NULL dereference in isa_bus driver callbacks 2018-03-03 15:51:37 +00:00
Kconfig sysfs/cpu: Add vulnerability folder 2018-03-19 18:59:04 +00:00
Makefile ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
map.c [PATCH] kobj_map semaphore to mutex conversion 2006-03-20 13:42:58 -08:00
memory.c drivers/base/memory.c: prohibit offlining of memory blocks with missing sections 2016-01-25 10:43:28 +00:00
module.c base: make module_create_drivers_dir race-free 2016-08-22 22:38:16 +01:00
node.c mm: check if section present during memory block registering 2015-09-29 16:44:47 +01:00
pinctrl.c drivers: pinctrl sleep and idle states in the core 2013-06-16 11:56:52 +02:00
platform.c platform: don't return 0 from platform_get_irq[_byname]() on error 2017-02-23 03:53:56 +00:00
reservation.c reservation: cross-device reservation support, v4 2013-06-28 12:02:15 +10:00
soc.c mode_t whack-a-mole: ->is_visible() returns umode_t... 2012-05-29 23:28:42 -04:00
syscore.c PM / sleep: trace events for suspend/resume 2014-06-07 00:18:07 +02:00
topology.c topology: Fix compilation warning when not in SMP 2014-04-16 14:13:26 -07:00
transport_class.c drivers/base: transport_class explicitly requires EXPORT_SYMBOL 2011-10-31 19:31:15 -04:00