kernel_samsung_a53x/drivers/pci/pcie
Stanislaw Gruszka e849a218ef PCI/AER: Block runtime suspend when handling errors
[ Upstream commit 002bf2fbc00e5c4b95fb167287e2ae7d1973281e ]

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-11-19 09:22:34 +01:00
..
aer.c PCI/AER: Decode Requester ID when no error info found 2024-11-18 12:13:20 +01:00
aer_inject.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aspm.c PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() 2024-11-18 11:43:22 +01:00
dpc.c PCI/DPC: Quirk PIO log size for certain Intel Root Ports 2024-11-19 09:22:33 +01:00
edr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
err.c PCI/AER: Block runtime suspend when handling errors 2024-11-19 09:22:34 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile PCI/ERR: Cache RCEC EA Capability offset in pci_init_capabilities() 2024-11-19 09:22:18 +01:00
pme.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
portdrv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
portdrv_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
portdrv_pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ptm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcec.c PCI/ERR: Cache RCEC EA Capability offset in pci_init_capabilities() 2024-11-19 09:22:18 +01:00