linux-brain/drivers/base
Rafael J. Wysocki 1516d9fa63 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>
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 attribute_container: fix missing blank lines after declarations 2015-03-25 14:35:09 +01:00
base.h driver core: correct device's shutdown order 2015-08-05 17:07:19 -07:00
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 class_find_device: fix reference to argument "match" 2015-09-29 15:23:14 +02:00
component.c component: fix bug with legacy API 2014-07-04 18:05:05 +01: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-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 devcoredump: provide a one-way disable function 2014-11-26 19:40:12 -08:00
devres.c devm: make allocations numa aware by default 2015-10-09 17:00:33 -04:00
devtmpfs.c VFS: assorted weird filesystems: d_inode() annotations 2015-04-15 15:06:58 -04:00
dma-coherent.c drivers: dma-coherent: add initialization from device tree 2014-10-14 02:18:12 +02:00
dma-contiguous.c driver core update for 4.4-rc1 2015-11-04 21:50:37 -08:00
dma-mapping.c drivers: base: dma-mapping: page align the size when unmap_kernel_range 2016-10-22 12:26:55 +02:00
driver.c driver core: add missing blank line after declaration 2015-03-25 14:36:30 +01:00
firmware_class.c firmware: fix usermode helper fallback loading 2017-01-09 08:07:49 +01:00
firmware.c
hypervisor.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
init.c drivers: of/base: move of_init to driver_init 2015-05-26 19:55:56 -07:00
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 drivers/base: Add MSI domain support for non-PCI devices 2015-07-30 00:14:38 +02:00
map.c drivers: base: map: Use kmalloc_array instead of kmalloc 2015-03-25 14:35:08 +01:00
memory.c base/memory, hotplug: fix a kernel oops in show_valid_zones() 2017-02-09 08:02:47 +01:00
module.c base: make module_create_drivers_dir race-free 2016-07-27 09:47:32 -07:00
node.c Revert "mm: Check if section present during memory block (un)registering" 2015-10-13 10:57:25 -07:00
pinctrl.c drivers/pinctrl: Add the concept of an "init" state 2015-10-27 11:24:23 +01:00
platform-msi.c irqdomain/msi: Use fwnode instead of of_node 2015-10-13 19:01:25 +02:00
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 device property: ACPI: Remove unused DMA APIs 2015-11-07 01:29:22 +01:00
soc.c base: soc: siplify ida usage 2015-10-04 19:42:22 +01:00
syscore.c genirq: Simplify wakeup mechanism 2014-09-01 13:48:59 +02:00
topology.c sched/topology: Rename topology_thread_cpumask() to topology_sibling_cpumask() 2015-05-27 15:22:15 +02:00
transport_class.c drivers/base: transport_class explicitly requires EXPORT_SYMBOL 2011-10-31 19:31:15 -04:00