1
0
Fork 0
remarkable-linux/drivers/base
Rafael J. Wysocki 1364055c96 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:27:25 +02:00
..
power PM / core: Clear the direct_complete flag on errors 2018-10-13 09:27:25 +02:00
regmap regmap: Correct comparison in regmap_cached 2018-05-30 07:52:41 +02:00
test License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig dma-buf/fence: Fix lock inversion within dma-fence-array 2018-03-19 08:42:47 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch_topology.c Revert "base: arch_topology: fix section mismatch build warnings" 2018-04-08 14:26:32 +02:00
attribute_container.c attribute_container: Fix typo 2016-08-31 15:13:56 +02:00
base.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bus.c driver core: bus: Fix a potential double free 2017-08-31 18:57:30 +02:00
cacheinfo.c drivers: base: cacheinfo: fix cache type for non-architected system cache 2018-01-02 20:31:16 +01:00
class.c driver core: remove class_attrs from struct class 2017-06-09 10:41:00 +02:00
component.c Merge 4.5-rc4 into driver-core-next 2016-02-14 14:29:55 -08:00
container.c ACPI / hotplug / driver core: Handle containers in a special way 2013-12-29 15:25:48 +01:00
core.c drivers/base: stop new probing during shutdown 2018-09-26 08:38:04 +02:00
cpu.c x86/speculation/l1tf: Add sysfs reporting for l1tf 2018-08-15 18:12:50 +02:00
dd.c driver core: Partially revert "driver core: correct device's shutdown order" 2018-07-28 07:55:44 +02:00
devcoredump.c driver core: devcoredump: convert to use class_groups 2016-11-29 21:12:12 +01:00
devres.c devres: add devm_alloc_percpu() 2016-11-15 22:34:25 -05:00
devtmpfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-coherent.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-contiguous.c cma: Store a name in the cma structure 2017-04-18 20:41:12 +02:00
dma-mapping.c dma-coherent: remove the DMA_MEMORY_MAP and DMA_MEMORY_IO flags 2017-09-01 11:59:17 +02:00
driver.c driver core: add missing blank line after declaration 2015-03-25 14:36:30 +01:00
firmware.c
firmware_class.c Revert "firmware: add sanity check on shutdown/suspend" 2017-09-10 21:19:06 -07:00
hypervisor.c
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-14 09:52:51 +01:00
map.c drivers: base: map: Use kmalloc_array instead of kmalloc 2015-03-25 14:35:08 +01:00
memory.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c base: make module_create_drivers_dir race-free 2016-06-15 19:21:31 -07:00
node.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl.c driver core: fix automatic pinctrl management 2017-06-13 11:07:32 +02:00
platform-msi.c irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded access 2017-06-22 18:29:17 +02:00
platform.c driver core: platform: Don't read past the end of "driver_override" buffer 2017-09-18 17:16:47 +02:00
property.c ACPI: properties: Align return codes of __acpi_node_get_property_reference() 2017-10-11 21:15:44 +02:00
soc.c base: soc: Allow early registration of a single SoC device 2017-03-29 21:43:26 +02:00
syscore.c genirq: Simplify wakeup mechanism 2014-09-01 13:48:59 +02:00
topology.c base: topology: constify attribute_group structures. 2017-08-28 17:49:22 +02:00
transport_class.c