linux-stable/drivers
Stanislaw Gruszka 1f8f95955a PCI/AER: Block runtime suspend when handling errors
[ Upstream commit 002bf2fbc0 ]

PM runtime can be done simultaneously with AER error handling.  Avoid that
by using pm_runtime_get_sync() before and pm_runtime_put() after reset in
pcie_do_recovery() for all recovering devices.

pm_runtime_get_sync() will increase dev->power.usage_count counter to
prevent any possible future request to runtime suspend a device.  It will
also resume a device, if it was previously in D3hot state.

I tested with igc device by doing simultaneous aer_inject and rpm
suspend/resume via /sys/bus/pci/devices/PCI_ID/power/control and can
reproduce:

  igc 0000:02:00.0: not ready 65535ms after bus reset; giving up
  pcieport 0000:00:1c.2: AER: Root Port link has been reset (-25)
  pcieport 0000:00:1c.2: AER: subordinate device reset failed
  pcieport 0000:00:1c.2: AER: device recovery failed
  igc 0000:02:00.0: Unable to change power state from D3hot to D0, device inaccessible

The problem disappears when this patch is applied.

Link: https://lore.kernel.org/r/20240212120135.146068-1-stanislaw.gruszka@linux.intel.com
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:17 +02:00
..
accel
accessibility speakup: Fix 8bit characters from direct synth 2024-04-03 15:32:16 +02:00
acpi ACPI: HMAT: Remove register of memory node for generic target 2024-03-26 18:17:26 -04:00
amba
android
ata
atm
auxdisplay
base PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-03 15:32:11 +02:00
bcma
block aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-03-26 18:16:29 -04:00
bluetooth Bluetooth: btnxpuart: Fix btnxpuart_close 2024-04-03 15:32:15 +02:00
bus bus: mhi: ep: check the correct variable in mhi_ep_register_controller() 2024-03-26 18:17:29 -04:00
cache
cdrom
cdx
char char: xilinx_hwicap: Fix NULL vs IS_ERR() bug 2024-03-26 18:17:30 -04:00
clk clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays 2024-04-03 15:32:10 +02:00
clocksource
comedi comedi: comedi_test: Prevent timers rescheduling during deletion 2024-03-05 14:21:45 +00:00
connector
counter
cpufreq cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf() 2024-04-03 15:32:04 +02:00
cpuidle
crypto crypto: qat - resolve race condition during AER recovery 2024-04-03 15:32:05 +02:00
cxl cxl: Fix the incorrect assignment of SSLBIS entry pointer initial location 2024-03-26 18:17:27 -04:00
dax
dca
devfreq
dio
dma dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA 2024-03-26 18:17:00 -04:00
dma-buf
dpll dpll: fix dpll_xa_ref_*_del() for multiple registrations 2024-03-26 18:16:56 -04:00
edac
eisa
extcon
firewire firewire: ohci: prevent leak of left-over IRQ on unbind 2024-03-06 22:35:22 +09:00
firmware x86/efistub: Don't clear BSS twice in mixed mode 2024-03-26 18:17:39 -04:00
fpga
fsi
gnss
gpio gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index() 2024-03-26 18:16:50 -04:00
gpu drm/etnaviv: Restore some id values 2024-04-03 15:32:15 +02:00
greybus
hid HID: amd_sfh: Avoid disabling the interrupt 2024-03-26 18:17:14 -04:00
hsi
hte
hv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:17:30 -04:00
hwmon hwmon: (amc6821) add of_match table 2024-04-03 15:32:16 +02:00
hwspinlock
hwtracing hwtracing: hisi_ptt: Move type check to the beginning of hisi_ptt_pmu_event_init() 2024-03-26 18:17:30 -04:00
i2c i2c: aspeed: Fix the dummy irq expected print 2024-03-08 10:10:27 +01:00
i3c i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling 2024-03-26 18:17:24 -04:00
idle
iio iio: adc: rockchip_saradc: use mask for write_enable bitfield 2024-04-03 15:32:08 +02:00
infiniband RDMA/mana_ib: Use virtual address in dma regions for MRs 2024-03-26 18:17:26 -04:00
input Input: iqs7222 - add support for IQS7222D v1.1 and v1.2 2024-03-26 18:17:26 -04:00
interconnect
iommu iommu: Fix compilation without CONFIG_IOMMU_INTEL 2024-03-26 18:16:55 -04:00
ipack
irqchip
isdn
leds leds: trigger: netdev: Fix kernel panic on interface rename trig notify 2024-04-03 15:32:15 +02:00
macintosh
mailbox
mcb
md dm-raid: fix lockdep waring in "pers->hot_add_disk" 2024-04-03 15:32:14 +02:00
media media: nxp: imx8-isi: Mark all crossbar sink pads as MUST_CONNECT 2024-04-03 15:32:03 +02:00
memory memory: tegra: Correct DLA client names 2024-03-26 18:16:46 -04:00
memstick
message
mfd mfd: twl: Select MFD_CORE 2024-04-03 15:32:06 +02:00
misc mei: vsc: Don't use sleeping condition in wait_event_timeout() 2024-03-26 18:17:30 -04:00
mmc mmc: core: Fix switch on gp3 partition 2024-04-03 15:32:15 +02:00
most
mtd mtd: rawnand: meson: fix scrambling mode value in command macro 2024-04-03 15:32:07 +02:00
mux
net wifi: rtw88: Add missing VID/PIDs for 8811CU and 8821CU 2024-04-03 15:32:13 +02:00
nfc
ntb NTB: fix possible name leak in ntb_register_device() 2024-03-26 18:17:06 -04:00
nubus
nvdimm
nvme nvme: fix reconnection fail due to reserved tag allocation 2024-03-26 18:17:33 -04:00
nvmem nvmem: meson-efuse: fix function pointer type mismatch 2024-04-03 15:32:16 +02:00
of Devicetree fix for v6.8, part 2: 2024-03-01 17:18:35 -08:00
opp OPP: debugfs: Fix warning around icc_get_name() 2024-03-26 18:16:56 -04:00
parisc
parport
pci PCI/AER: Block runtime suspend when handling errors 2024-04-03 15:32:17 +02:00
pcmcia
peci
perf RISC-V Fixes for 6.8-rc7 2024-03-01 12:44:33 -08:00
phy phy: tegra: xusb: Add API to retrieve the port number of phy 2024-04-03 15:32:16 +02:00
pinctrl pinctrl: qcom: sm8650-lpass-lpi: correct Kconfig name 2024-04-03 15:32:05 +02:00
platform platform/x86/amd/pmf: Do not use readl() for policy buffer access 2024-03-26 18:17:21 -04:00
pmdomain pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl 2024-03-26 18:16:35 -04:00
pnp
power power: supply: mm8013: fix "not charging" detection 2024-03-26 18:17:17 -04:00
powercap powercap: intel_rapl_tpmi: Fix System Domain probing 2024-04-03 15:32:04 +02:00
pps
ps3
ptp
pwm pwm: dwc: use pm_sleep_ptr() macro 2024-03-26 18:16:44 -04:00
rapidio
ras
regulator regulator: userspace-consumer: add module device table 2024-03-26 18:16:50 -04:00
remoteproc remoteproc: virtio: Fix wdg cannot recovery remote processor 2024-04-03 15:32:01 +02:00
reset
rpmsg
rtc rtc: max31335: fix interrupt status reg 2024-03-26 18:17:30 -04:00
s390 s390/dasd: fix double module refcount decrement 2024-03-26 18:16:27 -04:00
sbus
scsi scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn 2024-03-26 18:17:24 -04:00
sh
siox
slimbus slimbus: core: Remove usage of the deprecated ida_simple_xx() API 2024-04-03 15:32:16 +02:00
soc soc: fsl: dpio: fix kcalloc() argument order 2024-03-26 18:17:32 -04:00
soundwire
spi spi: spi-mt65xx: Fix NULL pointer access in interrupt handler 2024-03-26 18:17:38 -04:00
spmi
ssb
staging media: staging: ipu3-imgu: Set fields before media_entity_pads_init() 2024-04-03 15:32:01 +02:00
target
tc
tee tee: optee: Fix kernel panic caused by incorrect error handling 2024-03-04 09:49:03 +01:00
thermal powercap: intel_rapl: Fix locking in TPMI RAPL 2024-04-03 15:32:04 +02:00
thunderbolt thunderbolt: Fix for v6.8-rc7 2024-03-02 19:47:01 +01:00
tty serial: Lock console when calling into driver before registration 2024-04-03 15:32:12 +02:00
ufs
uio
usb usb: gadget: tegra-xudc: Fix USB3 PHY retrieval logic 2024-04-03 15:32:16 +02:00
vdpa vdpa/mlx5: Allow CVQ size changes 2024-03-26 18:17:35 -04:00
vfio vfio/pds: Always clear the save/restore FDs on reset 2024-04-03 15:32:09 +02:00
vhost
video backlight: lp8788: Fully initialize backlight_properties during probe 2024-03-26 18:17:19 -04:00
virt
virtio virtio: packed: fix unmap leak for indirect desc table 2024-03-26 18:17:35 -04:00
w1
watchdog watchdog: stm32_iwdg: initialize default timeout 2024-03-26 18:17:25 -04:00
xen xen/events: increment refcnt only if event channel is refcounted 2024-03-26 18:17:34 -04:00
zorro
Kconfig
Makefile