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

Bjorn Helgaas
2019-06-21T20:07:50Z

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
>