kernel-fxtec-pro1x/drivers
Rafael J. Wysocki 517b087a70 PM: sleep: core: Fix the handling of pending runtime resume requests
commit e3eb6e8fba65094328b8dca635d00de74ba75b45 upstream.

It has been reported that system-wide suspend may be aborted in the
absence of any wakeup events due to unforseen interactions of it with
the runtume PM framework.

One failing scenario is when there are multiple devices sharing an
ACPI power resource and runtime-resume needs to be carried out for
one of them during system-wide suspend (for example, because it needs
to be reconfigured before the whole system goes to sleep).  In that
case, the runtime-resume of that device involves turning the ACPI
power resource "on" which in turn causes runtime-resume requests
to be queued up for all of the other devices sharing it.  Those
requests go to the runtime PM workqueue which is frozen during
system-wide suspend, so they are not actually taken care of until
the resume of the whole system, but the pm_runtime_barrier()
call in __device_suspend() sees them and triggers system wakeup
events for them which then cause the system-wide suspend to be
aborted if wakeup source objects are in active use.

Of course, the logic that leads to triggering those wakeup events is
questionable in the first place, because clearly there are cases in
which a pending runtime resume request for a device is not connected
to any real wakeup events in any way (like the one above).  Moreover,
it is racy, because the device may be resuming already by the time
the pm_runtime_barrier() runs and so if the driver doesn't take care
of signaling the wakeup event as appropriate, it will be lost.
However, if the driver does take care of that, the extra
pm_wakeup_event() call in the core is redundant.

Accordingly, drop the conditional pm_wakeup_event() call fron
__device_suspend() and make the latter call pm_runtime_barrier()
alone.  Also modify the comment next to that call to reflect the new
code and extend it to mention the need to avoid unwanted interactions
between runtime PM and system-wide device suspend callbacks.

Fixes: 1e2ef05bb8 ("PM: Limit race conditions between runtime PM and system sleep (v2)")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Utkarsh H Patel <utkarsh.h.patel@intel.com>
Tested-by: Utkarsh H Patel <utkarsh.h.patel@intel.com>
Tested-by: Pengfei Xu <pengfei.xu@intel.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-03 11:24:29 +02:00
..
accessibility
acpi ACPICA: Do not increment operation_region reference counts for field units 2020-08-19 08:14:53 +02:00
amba
android binder: Prevent context manager from incrementing ref 0 2020-08-11 15:32:31 +02:00
ata ata/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function 2020-06-30 23:17:13 -04:00
atm atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent 2020-08-11 15:32:33 +02:00
auxdisplay
base PM: sleep: core: Fix the handling of pending runtime resume requests 2020-09-03 11:24:29 +02:00
bcma
block block: loop: set discard granularity and alignment for block device backed loop 2020-09-03 11:24:26 +02:00
bluetooth Bluetooth: hci_serdev: Only unregister device if it was registered 2020-08-19 08:15:00 +02:00
bus
cdrom
char agp/intel: Fix a memory leak on module initialisation failure 2020-08-19 08:14:53 +02:00
clk clk: Evict unregistered clks from parent caches 2020-08-26 10:31:07 +02:00
clocksource clocksource: dw_apb_timer_of: Fix missing clockevent timers 2020-06-22 09:05:11 +02:00
connector
cpufreq cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0 2020-08-26 10:31:01 +02:00
cpuidle cpuidle: Fix three reference count leaks 2020-06-22 09:05:20 +02:00
crypto crypto: cpt - don't sleep of CRYPTO_TFM_REQ_MAY_SLEEP was not specified 2020-08-19 08:15:05 +02:00
dax
dca
devfreq
dio
dma dmaengine: ioat setting ioat timeout as module parameter 2020-07-29 10:16:53 +02:00
dma-buf
edac EDAC/ie31200: Fallback if host bridge device is already initialized 2020-09-03 11:24:22 +02:00
eisa
extcon extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' 2020-06-25 15:33:01 +02:00
firewire
firmware efi: add missed destroy_workqueue when efisubsys_init fails 2020-08-26 10:31:06 +02:00
fmc
fpga fpga: dfl: fix bug in port reset handshake 2020-07-29 10:16:48 +02:00
fsi
gnss gnss: sirf: fix error return code in sirf_probe() 2020-06-22 09:05:28 +02:00
gpio gpio: arizona: put pm_runtime in case of failure 2020-07-29 10:16:44 +02:00
gpu drm/msm/adreno: fix updating ring fence 2020-09-03 11:24:23 +02:00
hid HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands 2020-09-03 11:24:26 +02:00
hsi
hv Drivers: hv: vmbus: Ignore CHANNELMSG_TL_CONNECT_RESULT(23) 2020-08-11 15:32:33 +02:00
hwmon hwmon: (scmi) Fix potential buffer overflow in scmi_hwmon_probe() 2020-07-29 10:16:54 +02:00
hwspinlock
hwtracing coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb() 2020-08-19 08:14:58 +02:00
i2c i2c: rcar: in slave mode, clear NACK earlier 2020-09-03 11:24:23 +02:00
ide
idle
iio iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw() 2020-08-21 11:05:31 +02:00
infiniband RDMA/bnxt_re: Do not add user qps to flushlist 2020-08-26 10:31:05 +02:00
input Input: psmouse - add a newline when printing 'proto' by sysfs 2020-08-26 10:31:01 +02:00
iommu iommu/iova: Don't BUG on invalid PFNs 2020-09-03 11:24:19 +02:00
ipack ipack: tpci200: fix error return code in tpci200_register() 2020-05-27 17:37:43 +02:00
irqchip genirq/affinity: Make affinity setting if activated opt-in 2020-08-21 11:05:28 +02:00
isdn PCI: add USR vendor id and use it in r8169 and w6692 driver 2020-06-22 09:05:23 +02:00
leds leds: core: Flush scheduled work for system suspend 2020-08-19 08:14:56 +02:00
lightnvm
macintosh drivers/macintosh: Fix memleak in windfarm_pm112 driver 2020-06-22 09:05:29 +02:00
mailbox
mcb
md dm rq: don't call blk_mq_queue_stopped() in dm_stop_queue() 2020-08-21 11:05:35 +02:00
media media: gpio-ir-tx: improve precision of transmitted signal due to scheduling 2020-09-03 11:24:23 +02:00
memory
memstick
message scsi: mptscsih: Fix read sense data size 2020-07-16 08:17:23 +02:00
mfd mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs 2020-09-03 11:24:18 +02:00
misc cxl: Fix kobject memleak 2020-08-19 08:14:55 +02:00
mmc mmc: renesas_sdhi_internal_dmac: clean up the code for dma complete 2020-08-21 11:05:35 +02:00
mtd mtd: rawnand: qcom: avoid write to unavailable register 2020-08-19 08:15:07 +02:00
mux
net net: gianfar: Add of_node_put() before goto statement 2020-09-03 11:24:26 +02:00
nfc nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame 2020-08-05 10:06:05 +02:00
ntb NTB: perf: Fix race condition when run with ntb_test 2020-06-25 15:33:03 +02:00
nubus
nvdimm libnvdimm: Fix endian conversion issues 2020-06-07 13:17:53 +02:00
nvme nvme-fc: Fix wrong return value in __nvme_fc_init_request() 2020-09-03 11:24:23 +02:00
nvmem nvmem: qfprom: remove incorrect write support 2020-06-10 21:35:00 +02:00
of of: of_mdio: Correct loop scanning logic 2020-07-22 09:32:03 +02:00
opp
oprofile
parisc parisc: mask out enable and reserved bits from sba imask 2020-08-19 08:15:07 +02:00
parport
pci PCI: Fix pci_create_slot() reference count leak 2020-09-03 11:24:20 +02:00
pcmcia
perf drivers/perf: hisi: Fix wrong value for all counters enable 2020-06-25 15:33:04 +02:00
phy phy: exynos5-usbdrd: Calibrating makes sense only for USB2.0 PHY 2020-08-19 08:14:57 +02:00
pinctrl pinctrl-single: fix pcs_parse_pinconf() return value 2020-08-19 08:15:02 +02:00
platform platform/x86: intel-vbtn: Fix return value check in check_acpi_dev() 2020-08-19 08:14:49 +02:00
pnp
power power: supply: check if calc_soc succeeded in pm860x_init_battery 2020-08-19 08:14:59 +02:00
powercap
pps
ps3
ptp
pwm pwm: bcm-iproc: handle clk_get_rate() return 2020-08-21 11:05:36 +02:00
rapidio rapidio: fix an error in get_user_pages_fast() error handling 2020-05-27 17:37:43 +02:00
ras
regulator regualtor: pfuze100: correct sw1a/sw2 on pfuze3000 2020-06-30 23:17:10 -04:00
remoteproc remoteproc: qcom: q6v5: Update running state before requesting stop 2020-08-21 11:05:34 +02:00
reset
rpmsg
rtc rtc: goldfish: Enable interrupt in set_alarm() when necessary 2020-08-26 10:31:00 +02:00
s390 s390/cio: add cond_resched() in the slow_eval_known_fn() loop 2020-09-03 11:24:24 +02:00
sbus
scsi Revert "scsi: qla2xxx: Fix crash on qla2x00_mailbox_command" 2020-09-03 11:24:25 +02:00
sfi
sh
siox
slimbus slimbus: core: Fix mismatch in of_node_get/put 2020-07-22 09:32:07 +02:00
sn
soc soc: qcom: rpmh-rsc: Set suppress_bind_attrs flag 2020-08-19 08:14:50 +02:00
soundwire
spi spi: stm32: fix stm32_spi_prepare_mbr in case of odd clk_rate 2020-09-03 11:24:24 +02:00
spmi
ssb
staging staging: rtl8192u: fix a dubious looking mask before a shift 2020-08-19 08:14:58 +02:00
target scsi: target: tcmu: Fix crash on ARM during cmd completion 2020-09-03 11:24:19 +02:00
tc
tee
thermal thermal: ti-soc-thermal: Fix reversed condition in ti_thermal_expose_sensor() 2020-08-19 08:14:58 +02:00
thunderbolt thunderbolt: Drop duplicated get_switch_at_route() 2020-05-27 17:37:40 +02:00
tty serial: 8250: change lock order in serial8250_do_startup() 2020-09-03 11:24:28 +02:00
uio uio_pdrv_genirq: fix use without device tree and no interrupt 2020-07-22 09:32:11 +02:00
usb xhci: Always restore EP_SOFT_CLEAR_TOGGLE even if ep reset failed 2020-09-03 11:24:28 +02:00
uwb
vfio vfio/type1: Add proper error unwind for vfio_iommu_replay() 2020-08-26 10:31:04 +02:00
vhost vhost/vsock: fix packet delivery order to monitoring devices 2020-05-27 17:37:32 +02:00
video fbcon: prevent user font height or width change from causing potential out-of-bounds access 2020-09-03 11:24:27 +02:00
virt virt: vbox: Fix guest capabilities mask check 2020-07-22 09:32:10 +02:00
virtio virtio_ring: Avoid loop when vq is broken in virtqueue_poll 2020-08-26 10:31:01 +02:00
visorbus
vlynq
vme
w1 w1: omap-hdq: cleanup to add missing newline for some dev_dbg 2020-06-22 09:05:30 +02:00
watchdog watchdog: initialize device before misc_register 2020-08-21 11:05:37 +02:00
xen XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information. 2020-09-03 11:24:28 +02:00
zorro
Kconfig
Makefile