All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	Mario.Limonciello@dell.com,
	Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v8 4/7] ACPI/hotplug/PCI: Do not scan all bridges when native PCIe hotplug is used
Date: Fri, 1 Jun 2018 16:35:05 -0500	[thread overview]
Message-ID: <20180601213505.GA199634@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20180529160155.1738-1-mika.westerberg@linux.intel.com>

On Tue, May 29, 2018 at 07:01:55PM +0300, Mika Westerberg wrote:
> When a system is using native PCIe hotplug for Thunderbolt it will be
> only present in the system when there is a device connected. This pretty
> much follows the BIOS assisted hotplug behaviour.
> ...

> +static void acpiphp_native_scan_bridge(struct pci_dev *bridge)
> +{
> +	struct pci_bus *bus = bridge->subordinate;
> +	struct pci_dev *dev;
> +	int max;
> +
> +	if (!bus)
> +		return;
> +
> +	max = bus->busn_res.start;
> +	/* Scan already configured non-hotplug bridges */
> +	for_each_pci_bridge(dev, bus) {
> +		if (!dev->is_hotplug_bridge)

Here we test "dev->is_hotplug_bridge" and below we use
"hotplug_is_native(bus->self)".  Is the difference significant, or
should we use hotplug_is_native() here as well?

If we do need to use is_hotplug_bridge here, maybe a comment about the
difference would be helpful.

> +			max = pci_scan_bridge(bus, dev, max, 0);
> +	}
> +
> +	/* Scan non-hotplug bridges that need to be reconfigured */
> +	for_each_pci_bridge(dev, bus) {
> +		if (!dev->is_hotplug_bridge)
> +			max = pci_scan_bridge(bus, dev, max, 1);
> +	}
> +}
> +
>  /**
>   * enable_slot - enable, configure a slot
>   * @slot: slot to be enabled
> @@ -442,25 +466,42 @@ static void enable_slot(struct acpiphp_slot *slot)
>  	struct pci_dev *dev;
>  	struct pci_bus *bus = slot->bus;
>  	struct acpiphp_func *func;
> -	int max, pass;
> -	LIST_HEAD(add_list);
>  
> -	acpiphp_rescan_slot(slot);
> -	max = acpiphp_max_busnr(bus);
> -	for (pass = 0; pass < 2; pass++) {
> +	if (bus->self && hotplug_is_native(bus->self)) {
> +		/*
> +		 * If native hotplug is used, it will take care of hotplug
> +		 * slot management and resource allocation for hotplug
> +		 * bridges. However, ACPI hotplug may still be used for
> +		 * non-hotplug bridges to bring in additional devices such
> +		 * as Thunderbolt host controller.
> +		 */
>  		for_each_pci_bridge(dev, bus) {
> -			if (PCI_SLOT(dev->devfn) != slot->device)
> -				continue;
> -
> -			max = pci_scan_bridge(bus, dev, max, pass);
> -			if (pass && dev->subordinate) {
> -				check_hotplug_bridge(slot, dev);
> -				pcibios_resource_survey_bus(dev->subordinate);
> -				__pci_bus_size_bridges(dev->subordinate, &add_list);
> +			if (PCI_SLOT(dev->devfn) == slot->device)
> +				acpiphp_native_scan_bridge(dev);
> +		}
> +		pci_assign_unassigned_bridge_resources(bus->self);
> +	} else {

  parent reply	other threads:[~2018-06-01 21:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28 12:47 [PATCH v8 0/7] PCI: Fixes and cleanups for native PCIe, SHPC and ACPI hotplug Mika Westerberg
2018-05-28 12:47 ` [PATCH v8 1/7] PCI: Take all bridges into account when calculating bus numbers for extension Mika Westerberg
2018-06-01 13:49   ` Bjorn Helgaas
2018-06-01 13:55     ` Mika Westerberg
2018-05-28 12:47 ` [PATCH v8 2/7] PCI: Introduce shpchp_is_native() Mika Westerberg
2018-05-29  9:06   ` Rafael J. Wysocki
2018-05-29 16:33   ` Andy Shevchenko
2018-05-30 20:23   ` Bjorn Helgaas
2018-05-30 21:55     ` Bjorn Helgaas
2018-05-31  6:58     ` Mika Westerberg
2018-05-31 13:12       ` Bjorn Helgaas
2018-05-31 13:51         ` Mika Westerberg
2018-05-31 16:55           ` Bjorn Helgaas
2018-06-01  9:27             ` Mika Westerberg
2018-06-01 13:25               ` Bjorn Helgaas
2018-05-28 12:47 ` [PATCH v8 3/7] PCI: Introduce hotplug_is_native() Mika Westerberg
2018-05-29  9:06   ` Rafael J. Wysocki
2018-05-29 16:34   ` Andy Shevchenko
2018-05-28 12:47 ` [PATCH v8 6/7] PCI: Move resource distribution for a single bridge outside of the loop Mika Westerberg
2018-05-29 17:24   ` Andy Shevchenko
2018-05-28 12:47 ` [PATCH v8 7/7] PCI: Document return value of pci_scan_bridge() and pci_scan_bridge_extend() Mika Westerberg
2018-05-29 17:24   ` Andy Shevchenko
2018-05-29 13:26 ` [PATCH v8 0/7] PCI: Fixes and cleanups for native PCIe, SHPC and ACPI hotplug Bjorn Helgaas
2018-05-29 13:41   ` Mika Westerberg
2018-05-29 16:01 ` [PATCH v8 4/7] ACPI/hotplug/PCI: Do not scan all bridges when native PCIe hotplug is used Mika Westerberg
2018-05-29 17:16   ` Andy Shevchenko
2018-06-01 14:11   ` Bjorn Helgaas
2018-06-01 14:24     ` Mika Westerberg
2018-06-01 18:41       ` Bjorn Helgaas
2018-06-01 19:19         ` Mika Westerberg
2018-06-01 21:50           ` Bjorn Helgaas
2018-06-01 22:09             ` Mika Westerberg
2018-06-01 21:35   ` Bjorn Helgaas [this message]
2018-06-01 21:48     ` Mika Westerberg
2018-06-02  5:46       ` Bjorn Helgaas
2018-06-02 18:44         ` Mika Westerberg
2018-05-29 16:02 ` [PATCH v8 5/7] ACPI/hotplug/PCI: Mark stale PCI devices disconnected Mika Westerberg
2018-06-02  5:50 ` [PATCH v8 0/7] PCI: Fixes and cleanups for native PCIe, SHPC and ACPI hotplug Bjorn Helgaas
2018-06-02 18:47   ` Mika Westerberg

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=20180601213505.GA199634@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=Mario.Limonciello@dell.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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.