Commit d7f8504d authored by Marc Zyngier's avatar Marc Zyngier Committed by Thomas Gleixner

acpi/gsi: Always perform an irq domain lookup

Instead of directly passing NULL to the various irq_domain functions,
start by looking up the domain with a domain identifier..

As this identifier is permanently set to NULL, the lookup function will
return the same value (no domain found) and the default will be used,
preserving the current behaviour.
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-and-tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Jake Oshins <jakeo@microsoft.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Link: http://lkml.kernel.org/r/1444737105-31573-10-git-send-email-marc.zyngier@arm.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b145dcc4
...@@ -11,9 +11,12 @@ ...@@ -11,9 +11,12 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/of.h>
enum acpi_irq_model_id acpi_irq_model; enum acpi_irq_model_id acpi_irq_model;
static struct fwnode_handle *acpi_gsi_domain_id;
static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity) static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
{ {
switch (polarity) { switch (polarity) {
...@@ -45,12 +48,10 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity) ...@@ -45,12 +48,10 @@ static unsigned int acpi_gsi_get_irq_type(int trigger, int polarity)
*/ */
int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
{ {
/* struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
* Only default domain is supported at present, always find DOMAIN_BUS_ANY);
* the mapping corresponding to default domain by passing NULL
* as irq_domain parameter *irq = irq_find_mapping(d, gsi);
*/
*irq = irq_find_mapping(NULL, gsi);
/* /*
* *irq == 0 means no mapping, that should * *irq == 0 means no mapping, that should
* be reported as a failure * be reported as a failure
...@@ -74,13 +75,10 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, ...@@ -74,13 +75,10 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
{ {
unsigned int irq; unsigned int irq;
unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity); unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);
struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
DOMAIN_BUS_ANY);
/* irq = irq_create_mapping(d, gsi);
* There is no way at present to look-up the IRQ domain on ACPI,
* hence always create mapping referring to the default domain
* by passing NULL as irq_domain parameter
*/
irq = irq_create_mapping(NULL, gsi);
if (!irq) if (!irq)
return -EINVAL; return -EINVAL;
...@@ -98,7 +96,9 @@ EXPORT_SYMBOL_GPL(acpi_register_gsi); ...@@ -98,7 +96,9 @@ EXPORT_SYMBOL_GPL(acpi_register_gsi);
*/ */
void acpi_unregister_gsi(u32 gsi) void acpi_unregister_gsi(u32 gsi)
{ {
int irq = irq_find_mapping(NULL, gsi); struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
DOMAIN_BUS_ANY);
int irq = irq_find_mapping(d, gsi);
irq_dispose_mapping(irq); irq_dispose_mapping(irq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment