From: Majed Alkhaleefah <majedalkhaleefah@gmail.com>
To: Scott Murray <scott@spiteful.org>, Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Majed Alkhaleefah <majedalkhaleefah@gmail.com>
Subject: [PATCH] PCI: cpcihp: Check pci_hp_add_bridge() return value
Date: Mon, 23 Feb 2026 02:36:46 +0000 [thread overview]
Message-ID: <20260223023645.344137-2-majedalkhaleefah@gmail.com> (raw)
Check the return value of pci_hp_add_bridge() in cpci_configure_slot(). If
bridge initialization fails, log an error message using err().
Current functionality doesn't consider uninitialized bridges a failure.
Changing this may introduce regressions. As such, intentionally avoid
propagating the failure (e.g., returning -ENODEV).
This patch addresses an item in the cpcihp TODO list.
Compile-tested only.
Signed-off-by: Majed Alkhaleefah <majedalkhaleefah@gmail.com>
---
drivers/pci/hotplug/cpci_hotplug_pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 6c48066acb44..331c21833c44 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -269,8 +269,12 @@ int cpci_configure_slot(struct slot *slot)
parent = slot->dev->bus;
for_each_pci_bridge(dev, parent) {
- if (PCI_SLOT(dev->devfn) == PCI_SLOT(slot->devfn))
- pci_hp_add_bridge(dev);
+ if (PCI_SLOT(dev->devfn) == PCI_SLOT(slot->devfn)) {
+ if (pci_hp_add_bridge(dev) != 0) {
+ err("Failed to initialize bridge %s at slot %02x",
+ pci_name(dev), slot->number);
+ }
+ }
}
pci_assign_unassigned_bridge_resources(parent->self);
--
2.43.0
next reply other threads:[~2026-02-23 2:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 2:36 Majed Alkhaleefah [this message]
2026-02-23 17:26 ` Bjorn Helgaas
2026-02-24 18:00 ` [PATCH v2] PCI: hotplug: Change return type of pci_hp_add_bridge() to void Majed Alkhaleefah
2026-03-17 22:49 ` Majed Alkhaleefah
2026-03-25 20:27 [PATCH] PCI: cpcihp: Check pci_hp_add_bridge() return value Brody England
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=20260223023645.344137-2-majedalkhaleefah@gmail.com \
--to=majedalkhaleefah@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=scott@spiteful.org \
/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
all inboxes | Powered by JetHome®