[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c45037201606ef06c6e84b3e8d645ea0ea538038.camel@linux.ibm.com>
Date: Mon, 19 Jan 2026 22:34:58 +0100
From: Niklas Schnelle <schnelle@...ux.ibm.com>
To: Farhan Ali <alifm@...ux.ibm.com>, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Cc: helgaas@...nel.org, lukas@...ner.de, alex@...zbot.org, clg@...hat.com,
stable@...r.kernel.org, mjrosato@...ux.ibm.com,
Benjamin Block
<bblock@...ux.ibm.com>
Subject: Re: [PATCH v7 4/9] PCI: Add additional checks for flr reset
On Wed, 2026-01-07 at 10:32 -0800, Farhan Ali wrote:
> If a device is in an error state, then any reads of device registers can
> return error value. Add addtional checks to validate if a device is in an
> error state before doing an flr reset.
>
> Cc: stable@...r.kernel.org
> Reviewed-by: Benjamin Block <bblock@...ux.ibm.com>
> Signed-off-by: Farhan Ali <alifm@...ux.ibm.com>
> ---
> drivers/pci/pci.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 74d21c97654d..b687f51ecc81 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4358,12 +4358,19 @@ EXPORT_SYMBOL_GPL(pcie_flr);
> */
> int pcie_reset_flr(struct pci_dev *dev, bool probe)
> {
> + u32 reg;
> +
> if (dev->dev_flags & PCI_DEV_FLAGS_NO_FLR_RESET)
> return -ENOTTY;
>
> if (!(dev->devcap & PCI_EXP_DEVCAP_FLR))
> return -ENOTTY;
>
> + if (pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, ®)) {
> + pci_warn(dev, "Device unable to do an FLR\n");
> + return -ENOTTY;
> + }
> +
> if (probe)
> return 0;
>
Looks good to me. I'm not 100% convinced the additional pci_warn() is
needed since at least aer_root_reset() already prints that the FLR
isn't supported but there are other callers which don't and this may
help pinpoint the new behavior in case it does affect something
unexpectedly. So I think I'd also rather keep it.
Feel free to add my:
Reviewed-by: Niklas Schnelle <schnelle@...ux.ibm.com>
Powered by blists - more mailing lists