All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	Chris Chiu <chris.chiu@canonical.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-pci@vger.kernel.org
Subject: [PATCH v2 2/6] PCI: Pass available buses also when the bridge is already configured
Date: Mon,  5 Sep 2022 11:02:28 +0300	[thread overview]
Message-ID: <20220905080232.36087-3-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20220905080232.36087-1-mika.westerberg@linux.intel.com>

If some part of the PCI topology is already configured (by the boot
firmware) but not all, and it includes hotplug bridges, we may need to
extend the bus resources of those bridges to accommondate any future
hotplugs too - in the same way we already do with normal hotplug case.

For this reason pass the available busses to pci_scan_child_bus_extend()
even when the bridge in question is already configured. This allows the
bus allocation code to use these available buses to extend the possible
hotplug bridges below.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216000
Reported-by: Chris Chiu <chris.chiu@canonical.com>
Tested-by: Chris Chiu <chris.chiu@canonical.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/pci/probe.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4f940dcd102c..86130926a74f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1297,7 +1297,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
 
 	if ((secondary || subordinate) && !pcibios_assign_all_busses() &&
 	    !is_cardbus && !broken) {
-		unsigned int cmax;
+		unsigned int cmax, buses;
 
 		/*
 		 * Bus already configured by firmware, process it in the
@@ -1322,7 +1322,8 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
 			child->bridge_ctl = bctl;
 		}
 
-		cmax = pci_scan_child_bus(child);
+		buses = subordinate - secondary;
+		cmax = pci_scan_child_bus_extend(child, buses);
 		if (cmax > subordinate)
 			pci_warn(dev, "bridge has subordinate %02x but max busn %02x\n",
 				 subordinate, cmax);
-- 
2.35.1


  parent reply	other threads:[~2022-09-05  8:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  8:02 [PATCH v2 0/6] PCI: Allow for future resource expansion on initial root bus scan Mika Westerberg
2022-09-05  8:02 ` [PATCH v2 1/6] PCI: Fix used_buses calculation in pci_scan_child_bus_extend() Mika Westerberg
2022-09-05  8:02 ` Mika Westerberg [this message]
2022-09-05  8:02 ` [PATCH v2 3/6] PCI: Move pci_assign_unassigned_root_bus_resources() Mika Westerberg
2022-09-05  8:02 ` [PATCH v2 4/6] PCI: Distribute available resources for root buses too Mika Westerberg
2022-10-14 11:45   ` Regression: " Jonathan Cameron
2022-10-14 13:30     ` Mika Westerberg
2022-10-14 14:48       ` Jonathan Cameron
2022-10-24 11:13         ` Mika Westerberg
2022-10-24 11:25           ` Mika Westerberg
2022-10-25 12:36             ` Mika Westerberg
2022-10-25 13:23               ` Andy Shevchenko
2022-10-31  7:40                 ` Mika Westerberg
2022-10-25 14:05               ` Jonathan Cameron
2022-10-26  8:38                 ` Mika Westerberg
2022-10-26  8:49     ` Regression: Re: [PATCH v2 4/6] PCI: Distribute available resources for root buses too #forregzbot Thorsten Leemhuis
2022-10-26 18:16       ` Thorsten Leemhuis
2022-10-26 18:17     ` Thorsten Leemhuis
2022-09-05  8:02 ` [PATCH v2 5/6] PCI: Fix whitespace and indentation Mika Westerberg
2022-09-05  8:02 ` [PATCH v2 6/6] PCI: Fix typo in pci_scan_child_bus_extend() Mika Westerberg
2022-09-21 19:52 ` [PATCH v2 0/6] PCI: Allow for future resource expansion on initial root bus scan Bjorn Helgaas

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=20220905080232.36087-3-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=chris.chiu@canonical.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=rafael.j.wysocki@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.