mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH v3 5/5] PCI: Retry assign unassigned resources for hotadd root bus
Date: Tue,  7 May 2013 15:17:34 -0700	[thread overview]
Message-ID: <1367965054-9013-6-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1367965054-9013-1-git-send-email-yinghai@kernel.org>

Let root bus hotadd path use same code for booting path.
As driver is not loaded yet, we could retry to make sure
all pci devices get resources allocated.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/acpi/pci_root.c |    2 +-
 drivers/pci/setup-bus.c |   11 +++++------
 include/linux/pci.h     |    1 +
 3 files changed, 7 insertions(+), 7 deletions(-)

Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -1331,7 +1331,7 @@ static void pci_bus_dump_resources(struc
 	}
 }
 
-static int __init pci_bus_get_depth(struct pci_bus *bus)
+static int pci_bus_get_depth(struct pci_bus *bus)
 {
 	int depth = 0;
 	struct pci_dev *dev;
@@ -1365,7 +1365,7 @@ enum enable_type {
 	auto_enabled,
 };
 
-static enum enable_type pci_realloc_enable __initdata = undefined;
+static enum enable_type pci_realloc_enable = undefined;
 void __init pci_realloc_get_opt(char *str)
 {
 	if (!strncmp(str, "off", 3))
@@ -1373,12 +1373,12 @@ void __init pci_realloc_get_opt(char *st
 	else if (!strncmp(str, "on", 2))
 		pci_realloc_enable = user_enabled;
 }
-static bool __init pci_realloc_enabled(enum enable_type enable)
+static bool pci_realloc_enabled(enum enable_type enable)
 {
 	return enable >= user_enabled;
 }
 
-static enum enable_type __init pci_realloc_detect(struct pci_bus *bus,
+static enum enable_type pci_realloc_detect(struct pci_bus *bus,
 			 enum enable_type enable_local)
 {
 #if defined(CONFIG_PCI_IOV) && defined(CONFIG_PCI_REALLOC_ENABLE_AUTO)
@@ -1442,8 +1442,7 @@ static unsigned long pci_bus_res_type_ma
  * second  and later try will clear small leaf bridge res
  * will stop till to the max  deepth if can not find good one
  */
-static void __init
-pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
+void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
 {
 	LIST_HEAD(realloc_head); /* list of resources that
 					want additional resources */
Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================
--- linux-2.6.orig/drivers/acpi/pci_root.c
+++ linux-2.6/drivers/acpi/pci_root.c
@@ -535,7 +535,7 @@ static int acpi_pci_root_add(struct acpi
 
 	if (system_state != SYSTEM_BOOTING) {
 		pcibios_resource_survey_bus(root->bus);
-		pci_assign_unassigned_bus_resources(root->bus);
+		pci_assign_unassigned_root_bus_resources(root->bus);
 	}
 
 	pci_bus_add_devices(root->bus);
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -1002,6 +1002,7 @@ int pci_claim_resource(struct pci_dev *,
 void pci_assign_unassigned_resources(void);
 void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
 void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
+void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus);
 void pdev_enable_device(struct pci_dev *);
 int pci_enable_resources(struct pci_dev *, int mask);
 void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),

  parent reply	other threads:[~2013-05-07 22:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367837311.15842.31.camel@pasglop>
2013-05-06 23:15 ` [PATCH 1/2] PCI: Split pci_assign_unassigned_resources to per " Yinghai Lu
2013-05-06 23:15   ` [PATCH 2/2] PCI: Skip IORESOURCE_IO size and allocation for root bus without ioport range Yinghai Lu
2013-05-07  0:50   ` [PATCH 1/2] PCI: Split pci_assign_unassigned_resources to per root bus Benjamin Herrenschmidt
     [not found]     ` <51885a04.c181440a.37c9.ffffa88eSMTPIN_ADDED_BROKEN@mx.google.com>
2013-05-07  7:34       ` Yinghai Lu
2013-05-21 20:41   ` Bjorn Helgaas
2013-05-07 22:17 ` [PATCH v3 0/5] PCI: Skip resource allocation for root bus without conresponding type resource Yinghai Lu
2013-05-07 22:17   ` [PATCH v3 1/5] PCI: Split pci_assign_unassigned_resources to per root bus Yinghai Lu
2013-05-07 22:17   ` [PATCH v3 2/5] PCI: Skip IORESOURCE_IO allocation for root bus without ioport range Yinghai Lu
2013-05-07 22:17   ` [PATCH v3 3/5] PCI: Skip IORESOURCE_MMIO allocation for root bus without MMIO range Yinghai Lu
2013-05-07 22:28     ` Benjamin Herrenschmidt
2013-05-07 22:44       ` Yinghai Lu
2013-05-08  1:16         ` Benjamin Herrenschmidt
2013-05-08  3:57           ` Yinghai Lu
2013-05-07 22:17   ` [PATCH v3 4/5] PCI: Enable pci bridge when it is needed Yinghai Lu
2013-05-07 22:17   ` Yinghai Lu [this message]
2013-05-22  6:38 ` [PATCH v4 0/8] PCI: Skip resource allocation for root bus without conresponding type resource Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 1/8] PCI: Don't use temp bus for pci_bus_release_bridge_resources Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 2/8] PCI: Use pci_walk_bus to detect unassigned resources Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 3/8] PCI: Introduce enable_local to prepare per root bus handling Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 4/8] PCI: Split pci_assign_unassigned_resources to per root bus Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 5/8] PCI: Skip IORESOURCE_IO allocation for root bus without ioport range Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 6/8] PCI: Skip IORESOURCE_MMIO allocation for root bus without MMIO range Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 7/8] PCI: Enable pci bridge when it is needed Yinghai Lu
2013-05-22  6:38   ` [PATCH v4 8/8] PCI: Retry assign unassigned resources for hotadd root bus Yinghai Lu
2013-06-01  6:03 ` [PATCH v5 0/7] PCI: Change assign unassigned resources per root bus bassis Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 2/7] PCI: Don't use temp bus for pci_bus_release_bridge_resources Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 3/7] PCI: Use pci_walk_bus to detect unassigned resources Yinghai Lu
2013-06-25 21:15     ` Bjorn Helgaas
2013-06-25 21:38       ` Benjamin Herrenschmidt
2013-06-25 21:46         ` Bjorn Helgaas
2013-06-26  8:07           ` Yinghai Lu
2013-06-26  7:38       ` Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 4/7] PCI: Introduce enable_local to prepare per root bus handling Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 5/7] PCI: Split pci_assign_unassigned_resources to per root bus Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 6/7] PCI: Enable pci bridge when it is needed Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 7/7] PCI: Retry assign unassigned resources for hotadd root bus Yinghai Lu
2013-06-01  6:03   ` [PATCH v5 1/7] PCI: Don't let mmio fallback to must-only, if ioport fails with must+optional Yinghai Lu
2013-06-22  3:00   ` [PATCH v5 0/7] PCI: Change assign unassigned resources per root bus bassis Yinghai Lu

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=1367965054-9013-6-git-send-email-yinghai@kernel.org \
    --to=yinghai@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=shangw@linux.vnet.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

Powered by JetHome