lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <983859ceb6fb0050f10eae205e41b3b4b687702f.1375867291.git.rubini@gnudd.com>
Date:	Wed, 7 Aug 2013 12:19:09 +0200
From:	Davide Ciminaghi <ciminaghi@...dd.com>
To:	linux-kernel@...r.kernel.org
Cc:	rubini@...dd.com, Giancarlo Asnaghi <giancarlo.asnaghi@...com>,
	x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
	Ingo Molnar <mingo@...hat.com>,
	Russell King <linux@....linux.org.uk>,
	Thomas Gleixner <tglx@...utronix.de>,
	devicetree@...r.kernel.org
Subject: [PATCH 10/26] x86 devicetree: add irq domain for msi irqs

An irqdomain is created for each MSI interrupt controller found in
the tree. This is to make irq_create_of_mapping() happy later on.

Signed-off-by: Davide Ciminaghi <ciminaghi@...dd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@...com>
---
 .../devicetree/bindings/x86/interrupt.txt          |   14 ++++++++++++++
 arch/x86/kernel/devicetree.c                       |   12 ++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/x86/interrupt.txt b/Documentation/devicetree/bindings/x86/interrupt.txt
index 7d19f49..fa6e2f0 100644
--- a/Documentation/devicetree/bindings/x86/interrupt.txt
+++ b/Documentation/devicetree/bindings/x86/interrupt.txt
@@ -24,3 +24,17 @@ Interrupt chips
   Required property:
 
      compatible = "intel,ce4100-lapic";
+
+* MSI interrupts (STA2X11)
+
+  Required properties:
+  -------------------
+     compatible = "intel,msi-irqs";
+     #interrupt-cells = <1>;
+
+  Device's interrupt property:
+
+     interrupts = <I>;
+
+  I is the MSI irq number. Should be left equal to zero in the devicetree
+  and updated at runtime, after the irq number has been allocated.
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 376dc78..d1dcfd0 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -401,6 +401,16 @@ static void __init ioapic_add_ofnode(struct device_node *np)
 	printk(KERN_ERR "IOxAPIC at %s is not registered.\n", np->full_name);
 }
 
+static const struct irq_domain_ops msi_irq_domain_ops = {
+	.xlate = irq_domain_xlate_onecell,
+};
+
+static void __init add_msi_irq_domain(struct device_node *np)
+{
+	if (!irq_domain_add_nomap(np, nr_irqs, &msi_irq_domain_ops, NULL))
+		pr_err("%s: error creating msi domain\n", __func__);
+}
+
 void __init x86_add_irq_domains(void)
 {
 	struct device_node *dp;
@@ -411,6 +421,8 @@ void __init x86_add_irq_domains(void)
 	for_each_node_with_property(dp, "interrupt-controller") {
 		if (of_device_is_compatible(dp, "intel,ce4100-ioapic"))
 			ioapic_add_ofnode(dp);
+		if (of_device_is_compatible(dp, "intel,msi-irqs"))
+			add_msi_irq_domain(dp);
 	}
 }
 #else
-- 
1.7.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ