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]
Date:	Mon, 13 Jul 2015 16:14:17 +0700
From:	Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
To:	<tglx@...utronix.de>, <marc.zyngier@....com>,
	<lorenzo.pieralisi@....com>, <hanjun.guo@...aro.org>,
	<tomasz.nowicki@...aro.org>
CC:	<rjw@...ysocki.net>, <al.stone@...aro.org>,
	<catalin.marinas@....com>, <will.deacon@....com>,
	<msalter@...hat.com>, <grant.likely@...aro.org>,
	<leo.duran@....com>, <sherry.hurwitz@....com>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
Subject: [RFCv2 PATCH 1/8] irqdomain: Introduce irq_domain_ops.init_alloc_info

Currently, when calling irq_domain_alloc_irqs() on ARM64, it uses
struct of_phandle_args to pass irq information. However, this is not
appropriate for ACPI since of_phandle_args is specific to DT.

Therefore, this patch introduces a new function pointer,
irq_domain_ops.init_alloc_info, which can be used by irqchips to provide
a way to initialize irqchip-specific data-structure for allocating IRQ.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>
---
NOTE:
Similarly, x86 is currently using struct irq_alloc_info
(see arch/x86/include/asm/hw_irq.h) and each irq_domain has different
way of initializing this structure.

Patch 2 also has an example of how I am planning to use this new op.

Alternative would be to keep re-using of_phandle_args for ACPI as done
currently. Any suggestions / feedbacks here are appreciated.

Thanks,

Suravee

 include/linux/irqdomain.h |  2 ++
 kernel/irq/irqdomain.c    | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index b4a74f7..1e51369 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -86,6 +86,8 @@ struct irq_domain_ops {
 	/* extended V2 interfaces to support hierarchy irq_domains */
 	int (*alloc)(struct irq_domain *d, unsigned int virq,
 		     unsigned int nr_irqs, void *arg);
+	int (*init_alloc_info)(uint32_t *data, int nr, void *ref,
+			       void **info);
 	void (*free)(struct irq_domain *d, unsigned int virq,
 		     unsigned int nr_irqs);
 	void (*activate)(struct irq_domain *d, struct irq_data *irq_data);
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 995d217..54434d2 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -478,6 +478,7 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
 	irq_hw_number_t hwirq;
 	unsigned int type = IRQ_TYPE_NONE;
 	int virq;
+	void *info;
 
 	domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
 	if (!domain) {
@@ -504,7 +505,14 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
 		if (virq)
 			return virq;
 
-		virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, irq_data);
+		if (domain->ops->init_alloc_info)
+			if (domain->ops->init_alloc_info(irq_data->args,
+							 irq_data->args_count,
+							 irq_data->np,
+							 &info))
+				return 0;
+
+		virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, info);
 		if (virq <= 0)
 			return 0;
 	} else {
-- 
2.1.0

--
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