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: <tip-d7f8504d234450bf10bb2eb2d4565d6e9af78e5c@git.kernel.org>
Date:	Tue, 13 Oct 2015 10:57:22 -0700
From:	tip-bot for Marc Zyngier <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	rjw@...ysocki.net, marc.zyngier@....com,
	linux-arm-kernel@...ts.infradead.org, tglx@...utronix.de,
	hpa@...or.com, rafael.j.wysocki@...el.com, hanjun.guo@...aro.org,
	jiang.liu@...ux.intel.com, mingo@...nel.org, graeme@...a.org.uk,
	Suravee.Suthikulpanit@....com, lorenzo.pieralisi@....com,
	jason@...edaemon.net, linux-kernel@...r.kernel.org,
	jakeo@...rosoft.com, tomasz.nowicki@...aro.org
Subject: [tip:irq/core] acpi/gsi: Always perform an irq domain lookup

Commit-ID:  d7f8504d234450bf10bb2eb2d4565d6e9af78e5c
Gitweb:     http://git.kernel.org/tip/d7f8504d234450bf10bb2eb2d4565d6e9af78e5c
Author:     Marc Zyngier <marc.zyngier@....com>
AuthorDate: Tue, 13 Oct 2015 12:51:37 +0100
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 13 Oct 2015 19:01:24 +0200

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: Marc Zyngier <marc.zyngier@....com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-and-tested-by: Hanjun Guo <hanjun.guo@...aro.org>
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc: <linux-arm-kernel@...ts.infradead.org>
Cc: Tomasz Nowicki <tomasz.nowicki@...aro.org>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
Cc: Graeme Gregory <graeme@...a.org.uk>
Cc: Jake Oshins <jakeo@...rosoft.com>
Cc: Jiang Liu <jiang.liu@...ux.intel.com>
Cc: Jason Cooper <jason@...edaemon.net>
Cc: Rafael J. Wysocki <rjw@...ysocki.net>
Link: http://lkml.kernel.org/r/1444737105-31573-10-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
 drivers/acpi/gsi.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/gsi.c b/drivers/acpi/gsi.c
index 38208f2..2c39fe1 100644
--- a/drivers/acpi/gsi.c
+++ b/drivers/acpi/gsi.c
@@ -11,9 +11,12 @@
 #include <linux/acpi.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
+#include <linux/of.h>
 
 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)
 {
 	switch (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)
 {
-	/*
-	 * Only default domain is supported at present, always find
-	 * the mapping corresponding to default domain by passing NULL
-	 * as irq_domain parameter
-	 */
-	*irq = irq_find_mapping(NULL, gsi);
+	struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
+							DOMAIN_BUS_ANY);
+
+	*irq = irq_find_mapping(d, gsi);
 	/*
 	 * *irq == 0 means no mapping, that should
 	 * be reported as a failure
@@ -74,13 +75,10 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
 {
 	unsigned int irq;
 	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);
 
-	/*
-	 * 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);
+	irq = irq_create_mapping(d, gsi);
 	if (!irq)
 		return -EINVAL;
 
@@ -98,7 +96,9 @@ EXPORT_SYMBOL_GPL(acpi_register_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);
 }
--
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