Linux-ACPI Archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Vidya Sagar" <vidyas@nvidia.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>, "Will Deacon" <will@kernel.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Frank Rowand" <frowand.list@gmail.com>,
	"Thierry Reding" <treding@nvidia.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Krishna Thota" <kthota@nvidia.com>,
	"Manikanta Maddireddy" <mmaddireddy@nvidia.com>,
	"Vidya Sagar" <sagar.tv@gmail.com>,
	linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH v7-incomplete 1/3] PCI: Move PRESERVE_BOOT_CONFIG _DSM evaluation to pci_register_host_bridge()
Date: Mon, 22 Apr 2024 10:45:46 +0300	[thread overview]
Message-ID: <ZiYVqulm8cE_FGKx@surfacebook.localdomain> (raw)
In-Reply-To: <20240421190914.374399-2-helgaas@kernel.org>

Sun, Apr 21, 2024 at 02:09:12PM -0500, Bjorn Helgaas kirjoitti:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> Move the PRESERVE_BOOT_CONFIG _DSM evaluation from acpi_pci_root_create()
> to pci_register_host_bridge().
> 
> This will help unify the ACPI _DSM path and the DT-based
> "linux,pci-probe-only" paths.

...

> +bool pci_acpi_preserve_config(struct pci_host_bridge *host_bridge)
> +{
> +	if (ACPI_HANDLE(&host_bridge->dev)) {

Wouldn't the below looks nicer if you invert the conditional?

	handle = ACPI_HANDLE(...);

	if (!handle)
		return false;

	...

> +		union acpi_object *obj;
> +
> +		/*
> +		 * Evaluate the "PCI Boot Configuration" _DSM Function.  If it
> +		 * exists and returns 0, we must preserve any PCI resource
> +		 * assignments made by firmware for this host bridge.
> +		 */
> +		obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(&host_bridge->dev),
> +					      &pci_acpi_dsm_guid,
> +					      1, DSM_PCI_PRESERVE_BOOT_CONFIG,
> +					      NULL, ACPI_TYPE_INTEGER);
> +		if (obj && obj->integer.value == 0)
> +			return true;
> +		ACPI_FREE(obj);
> +	}
> +
> +	return false;
> +}


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-04-22  7:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240110030725.710547-3-vidyas@nvidia.com>
2024-02-22 12:41 ` [PATCH V3] PCI: Add support for preserving boot configuration Vidya Sagar
2024-02-22 17:06   ` Bjorn Helgaas
2024-02-22 21:18     ` Vidya Sagar
2024-02-22 22:08       ` Bjorn Helgaas
2024-02-23  8:00   ` [PATCH V4] " Vidya Sagar
2024-03-05 14:10     ` Rob Herring
2024-03-05 14:24     ` Rob Herring
2024-04-01  7:50     ` [PATCH V5] " Vidya Sagar
2024-04-02 16:01       ` Rob Herring
2024-04-10  7:44         ` Vidya Sagar
2024-04-10 20:50       ` Bjorn Helgaas
2024-04-18 17:31         ` Vidya Sagar
2024-04-18 17:40       ` [PATCH V6] " Vidya Sagar
2024-04-21 19:03         ` Bjorn Helgaas
2024-04-21 19:09         ` [PATCH v7-incomplete 0/3] " Bjorn Helgaas
2024-04-21 19:09           ` [PATCH v7-incomplete 1/3] PCI: Move PRESERVE_BOOT_CONFIG _DSM evaluation to pci_register_host_bridge() Bjorn Helgaas
2024-04-22  7:45             ` Andy Shevchenko [this message]
2024-04-21 19:09           ` [PATCH v7-incomplete 2/3] PCI: of: Add of_pci_preserve_config() for per-host bridge support Bjorn Helgaas
2024-04-21 19:09           ` [PATCH v7-incomplete 3/3] PCI: Unify ACPI and DT 'preserve config' support Bjorn Helgaas
2024-04-22  7:43             ` Andy Shevchenko

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=ZiYVqulm8cE_FGKx@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kthota@nvidia.com \
    --cc=kw@linux.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sagar.tv@gmail.com \
    --cc=treding@nvidia.com \
    --cc=vidyas@nvidia.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).