diff mbox series

[3/4] pci: Do not auto-enable PCI reallocation when _DSM #5 returns 0

Message ID 20190615002359.29577-3-benh@kernel.crashing.org (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series [1/4] arm64: pci: acpi: Use pci_assign_unassigned_root_bus_resources() | expand

Commit Message

Benjamin Herrenschmidt June 15, 2019, 12:23 a.m. UTC
This prevents auto-enabling of bridges reallocation when the FW tells
us that the initial configuration must be preserved for a given host
bridge.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/pci/setup-bus.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Bjorn Helgaas June 21, 2019, 8:07 p.m. UTC | #1
PCI: Don't auto-realloc if we're preserving firmware config

On Sat, Jun 15, 2019 at 10:23:58AM +1000, Benjamin Herrenschmidt wrote:
> This prevents auto-enabling of bridges reallocation when the FW tells
> us that the initial configuration must be preserved for a given host
> bridge.

"Prevent auto-enabling ..." to follow usual style of imperative mood in
commit logs.

> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  drivers/pci/setup-bus.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 0cdd5ff389de..049a5602b942 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -1684,10 +1684,16 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
>  					   enum enable_type enable_local)
>  {
>  	bool unassigned = false;
> +	struct pci_host_bridge *hb;

Conventional variable names are "bridge" or "host".

>  	if (enable_local != undefined)
>  		return enable_local;
>  
> +	/* Don't realloc if ACPI tells us not to */

I'd drop the comment, since there might be other mechanisms, e.g., DT,
someday.

> +	hb = pci_find_host_bridge(bus);
> +	if (hb->preserve_config)
> +		return auto_disabled;
> +
>  	pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
>  	if (unassigned)
>  		return auto_enabled;
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 0cdd5ff389de..049a5602b942 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1684,10 +1684,16 @@  static enum enable_type pci_realloc_detect(struct pci_bus *bus,
 					   enum enable_type enable_local)
 {
 	bool unassigned = false;
+	struct pci_host_bridge *hb;
 
 	if (enable_local != undefined)
 		return enable_local;
 
+	/* Don't realloc if ACPI tells us not to */
+	hb = pci_find_host_bridge(bus);
+	if (hb->preserve_config)
+		return auto_disabled;
+
 	pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
 	if (unassigned)
 		return auto_enabled;