From: Marc Zyngier <marc.zyngier@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>, Hanjun Guo <hanjun.guo@linaro.org>,
Tomasz Nowicki <tn@semihalf.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Sudeep Holla <sudeep.holla@arm.com>,
Will Deacon <will.deacon@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linaro-acpi@lists.linaro.org
Subject: [PATCH 2/5] irqchip/acpi: Add probing infrastructure for ACPI-based irqchips
Date: Fri, 4 Sep 2015 18:06:49 +0100 [thread overview]
Message-ID: <1441386412-8139-3-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1441386412-8139-1-git-send-email-marc.zyngier@arm.com>
DT enjoys a rather nice probing infrastructure for irqchips, while
ACPI is so far stuck into a very distant past.
This patch introduces a declarative API, allowing irqchips to be
self-contained and be called when a particular entry is matched
in the MADT table.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
arch/arm64/include/asm/irq.h | 11 -----------
drivers/irqchip/irqchip.c | 8 +++++---
include/linux/acpi_irq.h | 10 ----------
include/linux/irqchip.h | 16 ++++++++++++++++
4 files changed, 21 insertions(+), 24 deletions(-)
delete mode 100644 include/linux/acpi_irq.h
diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h
index bbb251b..1a1037a 100644
--- a/arch/arm64/include/asm/irq.h
+++ b/arch/arm64/include/asm/irq.h
@@ -10,15 +10,4 @@ struct pt_regs;
extern void migrate_irqs(void);
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
-static inline void acpi_irq_init(void)
-{
- /*
- * Hardcode ACPI IRQ chip initialization to GICv2 for now.
- * Proper irqchip infrastructure will be implemented along with
- * incoming GICv2m|GICv3|ITS bits.
- */
- acpi_gic_init();
-}
-#define acpi_irq_init acpi_irq_init
-
#endif
diff --git a/drivers/irqchip/irqchip.c b/drivers/irqchip/irqchip.c
index afd1af3..0644d17 100644
--- a/drivers/irqchip/irqchip.c
+++ b/drivers/irqchip/irqchip.c
@@ -8,7 +8,7 @@
* warranty of any kind, whether express or implied.
*/
-#include <linux/acpi_irq.h>
+#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/of_irq.h>
#include <linux/irqchip.h>
@@ -27,6 +27,8 @@ extern struct of_device_id __irqchip_of_table[];
void __init irqchip_init(void)
{
of_irq_init(__irqchip_of_table);
-
- acpi_irq_init();
+#if defined(CONFIG_ARM64) && defined(CONFIG_ACPI)
+ acpi_gic_init(); /* Temporary hack */
+#endif
+ acpi_probe_device_table(ACPI_SIG_MADT);
}
diff --git a/include/linux/acpi_irq.h b/include/linux/acpi_irq.h
deleted file mode 100644
index f10c872..0000000
--- a/include/linux/acpi_irq.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _LINUX_ACPI_IRQ_H
-#define _LINUX_ACPI_IRQ_H
-
-#include <linux/irq.h>
-
-#ifndef acpi_irq_init
-static inline void acpi_irq_init(void) { }
-#endif
-
-#endif /* _LINUX_ACPI_IRQ_H */
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index 6388873..1df3123 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -11,6 +11,7 @@
#ifndef _LINUX_IRQCHIP_H
#define _LINUX_IRQCHIP_H
+#include <linux/acpi.h>
#include <linux/of.h>
/*
@@ -25,6 +26,21 @@
*/
#define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
+/*
+ * This macro must be used by the different irqchip drivers to declare
+ * the association between their version and their initialization function.
+ *
+ * @name: name that must be unique accross all IRQCHIP_ACPI_DECLARE of the
+ * same file.
+ * @subtable: Subtable to be identified in MADT
+ * @validate: Function to be called on that subtable to check its validity.
+ * Can be NULL.
+ * @data: data to be checked by the validate function.
+ * @fn: initialization function
+ */
+#define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \
+ ACPI_DECLARE(device, name, ACPI_SIG_MADT, subtable, validate, data, fn)
+
#ifdef CONFIG_IRQCHIP
void irqchip_init(void);
#else
--
2.1.4
next prev parent reply other threads:[~2015-09-04 17:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 17:06 [PATCH 0/5] ACPI probing infrastructure Marc Zyngier
2015-09-04 17:06 ` [PATCH 1/5] acpi: Add basic device " Marc Zyngier
2015-09-07 16:00 ` Lorenzo Pieralisi
2015-09-07 17:35 ` Marc Zyngier
2015-09-07 21:29 ` Rafael J. Wysocki
2015-09-08 9:57 ` Marc Zyngier
2015-09-08 13:01 ` Hanjun Guo
2015-09-04 17:06 ` Marc Zyngier [this message]
2015-09-04 17:06 ` [PATCH 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Marc Zyngier
2015-09-04 17:06 ` [PATCH 4/5] clocksource/acpi: Add probing infrastructure for ACPI-based clocksources Marc Zyngier
2015-09-04 17:06 ` [PATCH 5/5] clocksource/arm_arch_timer: Convert to ACPI probing Marc Zyngier
2015-09-07 6:58 ` [PATCH 0/5] ACPI probing infrastructure Tomasz Nowicki
2015-09-08 14:38 ` Tomasz Nowicki
2015-09-07 21:26 ` Rafael J. Wysocki
2015-09-08 9:45 ` Marc Zyngier
2015-09-08 22:26 ` Rafael J. Wysocki
2015-09-08 13:19 ` Hanjun Guo
2015-09-10 9:03 ` Hanjun Guo
2015-09-11 14:06 ` Marc Zyngier
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=1441386412-8139-3-git-send-email-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=catalin.marinas@arm.com \
--cc=hanjun.guo@linaro.org \
--cc=jason@lakedaemon.net \
--cc=lenb@kernel.org \
--cc=linaro-acpi@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@arm.com \
--cc=tglx@linutronix.de \
--cc=tn@semihalf.com \
--cc=will.deacon@arm.com \
/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 NNTP newsgroup(s).