lkml.org 
[lkml]   [2015]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] acpi: fix generic acpi_register_gsi() handling of shared interrupts
Date
If there are devices sharing an interrupt, acpi_register_gsi() could
be called multiple times for the same gsi. Currently, it just maps
the gsi without checking for a previous mapping. This patch adds a
check for an existing mapping and uses that if found.

Cc: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Salter <msalter@redhat.com>
---
drivers/acpi/gsi.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 38208f2..5698c4f 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -76,6 +76,13 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
unsigned int irq_type = acpi_gsi_get_irq_type(trigger, polarity);

/*
+ * The gsi may be shared with other devices, so check for a
+ * previous mapping and use that if found.
+ */
+ if (acpi_gsi_to_irq(gsi, &irq) > 0)
+ return irq;
+
+ /*
* 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
--
1.8.3.1


\
 
 \ /
  Last update: 2015-04-28 19:21    [W:0.029 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site