[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gtUHbYPk-dFRwEZMnPv0gQG8+J+bwf8bahUskcDkw9HA@mail.gmail.com>
Date: Thu, 3 Apr 2025 20:35:45 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Raag Jadav <raag.jadav@...el.com>
Cc: rafael@...nel.org, mahesh@...ux.ibm.com, oohall@...il.com,
bhelgaas@...gle.com, linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
ilpo.jarvinen@...ux.intel.com, lukas.wunner@...el.com
Subject: Re: [PATCH v1] PCI/AER: Avoid power state transition during system suspend
On Thu, Apr 3, 2025 at 9:45 AM Raag Jadav <raag.jadav@...el.com> wrote:
>
> If an error is triggered while system suspend is in progress, any bus
> level power state transition will result in unpredictable error handling.
> Mark skip_bus_pm flag as true to avoid this.
This needs to be synchronized with the skip_bus_pm clearing in pci_pm_suspend().
Also, skip_bus_pm is only used in the _noirq phases, so if a driver
calls pci_set_power_state() from its ->suspend() callback, this change
won't help.
I think that you're aware of it, but the changelog should mention this
limitation.
> Signed-off-by: Raag Jadav <raag.jadav@...el.com>
> ---
>
> Ideally we'd want to defer recovery until system resume, but this is
> good enough to prevent device suspend.
>
> More discussion at [1].
> [1] https://lore.kernel.org/r/Z-38rPeN_j7YGiEl@black.fi.intel.com
>
> drivers/pci/pcie/aer.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 508474e17183..5acf4efc2df3 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1108,6 +1108,12 @@ static void pci_aer_handle_error(struct pci_dev *dev, struct aer_err_info *info)
>
> static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)
> {
> + /*
> + * Avoid any power state transition if an error is triggered during
> + * system suspend.
> + */
> + dev->skip_bus_pm = true;
> +
> cxl_rch_handle_error(dev, info);
> pci_aer_handle_error(dev, info);
> pci_dev_put(dev);
> --
Powered by blists - more mailing lists