[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240501165615.GA758227@bhelgaas>
Date: Wed, 1 May 2024 11:56:15 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Sunil V L <sunilvl@...tanamicro.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-acpi@...r.kernel.org,
linux-pci@...r.kernel.org, linux-serial@...r.kernel.org,
acpica-devel@...ts.linux.dev,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Anup Patel <anup@...infault.org>,
Thomas Gleixner <tglx@...utronix.de>,
Samuel Holland <samuel.holland@...ive.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Robert Moore <robert.moore@...el.com>,
Conor Dooley <conor.dooley@...rochip.com>,
Andrew Jones <ajones@...tanamicro.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Marc Zyngier <maz@...nel.org>,
Atish Kumar Patra <atishp@...osinc.com>,
Andrei Warkentin <andrei.warkentin@...el.com>,
Haibo1 Xu <haibo1.xu@...el.com>,
Björn Töpel <bjorn@...nel.org>
Subject: Re: [PATCH v5 08/17] ACPI: pci_link: Clear the dependencies after
probe
On Wed, May 01, 2024 at 05:47:33PM +0530, Sunil V L wrote:
> RISC-V platforms need to use dependencies between PCI host bridge, Link
> devices and the interrupt controllers to ensure probe order. The
> dependency is like below.
>
> Interrupt controller <-- Link Device <-- PCI Host bridge.
>
> If there is no dependency added between Link device and PCI Host Bridge,
> then the PCI end points can get probed prior to link device, unable to
> get mapping for INTx.
>
> So, add the link device's HID to dependency honor list and also clear it
> after its probe.
>
> Since this is required only for architectures like RISC-V, enable this
> code under a new config option and set this only in RISC-V.
>
> Signed-off-by: Sunil V L <sunilvl@...tanamicro.com>
> ---
> arch/riscv/Kconfig | 1 +
> drivers/acpi/Kconfig | 3 +++
> drivers/acpi/pci_link.c | 3 +++
> drivers/acpi/scan.c | 1 +
> 4 files changed, 8 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index f961449ca077..f7a36d79ff1a 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -14,6 +14,7 @@ config RISCV
> def_bool y
> select ACPI_GENERIC_GSI if ACPI
> select ACPI_REDUCED_HARDWARE_ONLY if ACPI
> + select ARCH_ACPI_DEFERRED_GSI if ACPI
> select ARCH_DMA_DEFAULT_COHERENT
> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index e3a7c2aedd5f..ebec1707f662 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -587,6 +587,9 @@ config ACPI_PRMT
> substantially increase computational overhead related to the
> initialization of some server systems.
>
> +config ARCH_ACPI_DEFERRED_GSI
> + bool
> +
> endif # ACPI
>
> config X86_PM_TIMER
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index aa1038b8aec4..48cdcedafad6 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -748,6 +748,9 @@ static int acpi_pci_link_add(struct acpi_device *device,
> if (result)
> kfree(link);
>
> + if (IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI))
> + acpi_dev_clear_dependencies(device);
This is really a question for Rafael, but it doesn't seem right that
this completely depends on a config option.
Is there a reason this wouldn't work for all architectures, i.e., what
would happen if you just called acpi_dev_clear_dependencies()
unconditionally?
> +
> return result < 0 ? result : 1;
> }
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 3eeb4ce39fcc..67677a6ff8e3 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -834,6 +834,7 @@ static const char * const acpi_honor_dep_ids[] = {
> "INTC10CF", /* IVSC (MTL) driver must be loaded to allow i2c access to camera sensors */
> "RSCV0001", /* RISC-V PLIC */
> "RSCV0002", /* RISC-V APLIC */
> + "PNP0C0F", /* PCI Link Device */
> NULL
> };
>
> --
> 2.40.1
>
>
Powered by blists - more mailing lists