mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Angel J <iamanaws@httpd.dev>
To: linux-pci@vger.kernel.org, bhelgaas@google.com
Cc: herve.codina@bootlin.com, lizhi.hou@amd.com,
	andrea.porta@suse.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, regressions@lists.linux.dev,
	stable@vger.kernel.org, Angel J <iamanaws@httpd.dev>
Subject: [PATCH] PCI: of: Skip dynamic nodes for bridges without a subordinate bus
Date: Fri, 11 Sep 2026 16:04:20 -0700	[thread overview]
Message-ID: <20260911230420.26244-1-iamanaws@httpd.dev> (raw)
In-Reply-To: <cFJoUZ6c5g5YbFCrwUnx6RlitHRl-0cS2fadDSFJNf9SgLreKutrmZj1r56hFh8ZUAbzvuCqBG4w9ZYAE8xAWP9HnLwbjMOBzac-iMnMMZc=@httpd.dev>

A device can satisfy pci_is_bridge() without having a subordinate bus.
The dynamic OF helpers for bus-range and interrupt-map dereference
pdev->subordinate without checking it.

On a Dell XPS 8940, device 0000:00:00.0 [8086:4c43] has no subordinate
bus, and enabling CONFIG_PCI_DYNAMIC_OF_NODES causes an early boot hang.

Skip dynamic OF node creation for bridges without a subordinate bus.
This allows the machine to boot while preserving node creation for the
other bridges.

Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
Cc: stable@vger.kernel.org
Signed-off-by: Angel J <iamanaws@httpd.dev>
---
 drivers/pci/of.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index a51dff91b..971c79c2a 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -765,6 +765,10 @@ void of_pci_make_dev_node(struct pci_dev *pdev)
 	if (!ppnode)
 		return;
 
+	/* Bridge properties require a subordinate bus. */
+	if (pci_is_bridge(pdev) && !pdev->subordinate)
+		return;
+
 	if (pci_is_bridge(pdev))
 		pci_type = "pci";
 	else
-- 
2.54.0


      reply	other threads:[~2026-09-11 23:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23  2:14 [REGRESSION] PCI: Dynamic OF node creation hangs on invalid bridge configuration Angel J
2026-09-01  0:59 ` Angel J
2026-09-01  6:07   ` Thorsten Leemhuis
2026-09-03 23:17 ` Bjorn Helgaas
2026-09-04  8:57   ` Herve Codina
2026-09-09 11:27     ` Andrea della Porta
2026-09-11 23:01 ` Angel J
2026-09-11 23:04   ` Angel J [this message]

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=20260911230420.26244-1-iamanaws@httpd.dev \
    --to=iamanaws@httpd.dev \
    --cc=andrea.porta@suse.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=regressions@lists.linux.dev \
    --cc=stable@vger.kernel.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®