[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SN6PR02MB41570D82338A45E13B7A3689D4D62@SN6PR02MB4157.namprd02.prod.outlook.com>
Date: Mon, 10 Mar 2025 23:26:28 +0000
From: Michael Kelley <mhklinux@...look.com>
To: Roman Kisel <romank@...ux.microsoft.com>, "arnd@...db.de" <arnd@...db.de>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>, "bp@...en8.de" <bp@...en8.de>,
"catalin.marinas@....com" <catalin.marinas@....com>, "conor+dt@...nel.org"
<conor+dt@...nel.org>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "decui@...rosoft.com" <decui@...rosoft.com>,
"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>, "hpa@...or.com"
<hpa@...or.com>, "joey.gouly@....com" <joey.gouly@....com>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "kw@...ux.com" <kw@...ux.com>,
"kys@...rosoft.com" <kys@...rosoft.com>, "lenb@...nel.org" <lenb@...nel.org>,
"lpieralisi@...nel.org" <lpieralisi@...nel.org>,
"manivannan.sadhasivam@...aro.org" <manivannan.sadhasivam@...aro.org>,
"mark.rutland@....com" <mark.rutland@....com>, "maz@...nel.org"
<maz@...nel.org>, "mingo@...hat.com" <mingo@...hat.com>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>, "rafael@...nel.org"
<rafael@...nel.org>, "robh@...nel.org" <robh@...nel.org>,
"ssengar@...ux.microsoft.com" <ssengar@...ux.microsoft.com>,
"sudeep.holla@....com" <sudeep.holla@....com>, "suzuki.poulose@....com"
<suzuki.poulose@....com>, "tglx@...utronix.de" <tglx@...utronix.de>,
"wei.liu@...nel.org" <wei.liu@...nel.org>, "will@...nel.org"
<will@...nel.org>, "yuzenghui@...wei.com" <yuzenghui@...wei.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-hyperv@...r.kernel.org"
<linux-hyperv@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-pci@...r.kernel.org"
<linux-pci@...r.kernel.org>, "x86@...nel.org" <x86@...nel.org>
CC: "apais@...rosoft.com" <apais@...rosoft.com>, "benhill@...rosoft.com"
<benhill@...rosoft.com>, "bperkins@...rosoft.com" <bperkins@...rosoft.com>,
"sunilmut@...rosoft.com" <sunilmut@...rosoft.com>
Subject: RE: [PATCH hyperv-next v5 10/11] ACPI: irq: Introduce
acpi_get_gsi_dispatcher()
From: Roman Kisel <romank@...ux.microsoft.com> Sent: Friday, March 7, 2025 2:03 PM
>
> Using acpi_irq_create_hierarchy() in the cases where the code
> also handles OF leads to code duplication as the ACPI subsystem
> doesn't provide means to compute the IRQ domain parent whereas
> the OF does.
>
> Introduce acpi_get_gsi_dispatcher() so that the drivers relying
> on both ACPI and OF may use irq_domain_create_hierarchy() in the
> common code paths.
>
> No functional changes.
>
> Signed-off-by: Roman Kisel <romank@...ux.microsoft.com>
> ---
> drivers/acpi/irq.c | 14 ++++++++++++--
> include/linux/acpi.h | 5 ++++-
> 2 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
> index 1687483ff319..6243db610137 100644
> --- a/drivers/acpi/irq.c
> +++ b/drivers/acpi/irq.c
> @@ -12,7 +12,7 @@
>
> enum acpi_irq_model_id acpi_irq_model;
>
> -static struct fwnode_handle *(*acpi_get_gsi_domain_id)(u32 gsi);
> +static acpi_gsi_domain_disp_fn acpi_get_gsi_domain_id;
> static u32 (*acpi_gsi_to_irq_fallback)(u32 gsi);
>
> /**
> @@ -307,12 +307,22 @@ EXPORT_SYMBOL_GPL(acpi_irq_get);
> * for a given GSI
> */
> void __init acpi_set_irq_model(enum acpi_irq_model_id model,
> - struct fwnode_handle *(*fn)(u32))
> + acpi_gsi_domain_disp_fn fn)
> {
> acpi_irq_model = model;
> acpi_get_gsi_domain_id = fn;
> }
>
> +/**
> + * acpi_get_gsi_dispatcher - Returns dispatcher function that
> + * computes the domain fwnode for a
> + * given GSI.
> + */
> +acpi_gsi_domain_disp_fn acpi_get_gsi_dispatcher(void)
> +{
> + return acpi_get_gsi_domain_id;
> +}
This new function is needed by pci-hyperv.c. It will
need to be marked as EXPORT_SYMBOL_GPL since
pci-hyperv.c can be built as a module.
> +
> /**
> * acpi_set_gsi_to_irq_fallback - Register a GSI transfer
> * callback to fallback to arch specified implementation.
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 4e495b29c640..abc51288e867 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -336,8 +336,11 @@ int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int
> polarity
> int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
> int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
>
> +typedef struct fwnode_handle *(*acpi_gsi_domain_disp_fn)(u32);
> +
> void acpi_set_irq_model(enum acpi_irq_model_id model,
> - struct fwnode_handle *(*)(u32));
> + acpi_gsi_domain_disp_fn fn);
> +acpi_gsi_domain_disp_fn acpi_get_gsi_dispatcher(void);
> void acpi_set_gsi_to_irq_fallback(u32 (*)(u32));
>
> struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
> --
> 2.43.0
>
I'm not at all expert in ACPI code and IRQ domains, but the changes
here look reasonable to me. Modulo adding the EXPORT_SYMBOL_GPL,
Reviewed-by: Michael Kelley <mhklinux@...look.com>
Powered by blists - more mailing lists