From: Farhan Ali <alifm@linux.ibm.com>
To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Cc: helgaas@kernel.org, alex@shazbot.org, alifm@linux.ibm.com,
schnelle@linux.ibm.com, mjrosato@linux.ibm.com,
Benjamin Block <bblock@linux.ibm.com>
Subject: [PATCH v19 3/4] PCI: Fail FLR when config space is inaccessible
Date: Mon, 15 Jun 2026 11:35:23 -0700 [thread overview]
Message-ID: <20260615183524.2880-4-alifm@linux.ibm.com> (raw)
In-Reply-To: <20260615183524.2880-1-alifm@linux.ibm.com>
If a device is in an error state, then it's config space may not be
accssible. Add additional check to validate if a device's config space is
accessible before doing an FLR reset.
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
drivers/pci/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 973d23e41c48..521a4bb189d7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4352,6 +4352,9 @@ int pcie_flr(struct pci_dev *dev)
{
int ret;
+ if (!pci_dev_config_accessible(dev, "FLR"))
+ return -ENOTTY;
+
if (!pci_wait_for_pending_transaction(dev))
pci_err(dev, "timed out waiting for pending transaction; performing function level reset anyway\n");
--
2.43.0
next prev parent reply other threads:[~2026-06-15 18:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 18:35 [PATCH v19 0/4] [PCI] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-06-15 18:35 ` [PATCH v19 1/4] PCI: Allow per function PCI slots to fix slot reset on s390 Farhan Ali
2026-06-15 18:50 ` sashiko-bot
2026-06-15 18:35 ` [PATCH v19 2/4] PCI: Avoid saving config space state if inaccessible Farhan Ali
2026-06-15 18:49 ` sashiko-bot
2026-06-15 18:35 ` Farhan Ali [this message]
2026-06-15 18:43 ` [PATCH v19 3/4] PCI: Fail FLR when config space is inaccessible sashiko-bot
2026-06-15 18:35 ` [PATCH v19 4/4] PCI/MSI: Enable memory decoding before restoring MSI-X messages Farhan Ali
2026-06-15 18:48 ` sashiko-bot
2026-06-15 18:59 ` Niklas Schnelle
2026-06-15 22:17 ` Farhan Ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260615183524.2880-4-alifm@linux.ibm.com \
--to=alifm@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=bblock@linux.ibm.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=schnelle@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox