Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fa6c8e2 authored by Grant Likely's avatar Grant Likely
Browse files

irq_domain: Move irq_virq_count into NOMAP revmap



This patch replaces the old global setting of irq_virq_count that is only
used by the NOMAP mapping and instead uses a revmap_data property so that
the maximum NOMAP allocation can be set per NOMAP irq_domain.

There is exactly one user of irq_virq_count in-tree right now: PS3.
Also, irq_virq_count is only useful for the NOMAP mapping.  So,
instead of having a single global irq_virq_count values, this change
drops it entirely and added a max_irq argument to irq_domain_add_nomap().
That makes it a property of an individual nomap irq domain instead of
a global system settting.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Tested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
parent 15e06bf6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ static int axon_msi_probe(struct platform_device *device)
	}
	memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);

	msic->irq_domain = irq_domain_add_nomap(dn, &msic_host_ops, msic);
	msic->irq_domain = irq_domain_add_nomap(dn, 0, &msic_host_ops, msic);
	if (!msic->irq_domain) {
		printk(KERN_ERR "axon_msi: couldn't allocate irq_domain for %s\n",
		       dn->full_name);
+1 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ void __init beatic_init_IRQ(void)
	ppc_md.get_irq = beatic_get_irq;

	/* Allocate an irq host */
	beatic_host = irq_domain_add_nomap(NULL, &beatic_pic_host_ops, NULL);
	beatic_host = irq_domain_add_nomap(NULL, 0, &beatic_pic_host_ops, NULL);
	BUG_ON(beatic_host == NULL);
	irq_set_default_host(beatic_host);
}
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static int psurge_secondary_ipi_init(void)
{
	int rc = -ENOMEM;

	psurge_host = irq_domain_add_nomap(NULL, &psurge_host_ops, NULL);
	psurge_host = irq_domain_add_nomap(NULL, 0, &psurge_host_ops, NULL);

	if (psurge_host)
		psurge_secondary_virq = irq_create_direct_mapping(psurge_host);
+1 −2
Original line number Diff line number Diff line
@@ -753,9 +753,8 @@ void __init ps3_init_IRQ(void)
	unsigned cpu;
	struct irq_domain *host;

	host = irq_domain_add_nomap(NULL, &ps3_host_ops, NULL);
	host = irq_domain_add_nomap(NULL, PS3_PLUG_MAX + 1, &ps3_host_ops, NULL);
	irq_set_default_host(host);
	irq_set_virq_count(PS3_PLUG_MAX + 1);

	for_each_possible_cpu(cpu) {
		struct ps3_private *pd = &per_cpu(ps3_private, cpu);
+4 −2
Original line number Diff line number Diff line
@@ -98,6 +98,9 @@ struct irq_domain {
			unsigned int size;
			unsigned int *revmap;
		} linear;
		struct {
			unsigned int max_irq;
		} nomap;
		struct radix_tree_root tree;
	} revmap_data;
	const struct irq_domain_ops *ops;
@@ -120,6 +123,7 @@ struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
					 const struct irq_domain_ops *ops,
					 void *host_data);
struct irq_domain *irq_domain_add_nomap(struct device_node *of_node,
					 unsigned int max_irq,
					 const struct irq_domain_ops *ops,
					 void *host_data);
struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
@@ -128,7 +132,6 @@ struct irq_domain *irq_domain_add_tree(struct device_node *of_node,

extern struct irq_domain *irq_find_host(struct device_node *node);
extern void irq_set_default_host(struct irq_domain *host);
extern void irq_set_virq_count(unsigned int count);

static inline struct irq_domain *irq_domain_add_legacy_isa(
				struct device_node *of_node,
@@ -140,7 +143,6 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
}
extern struct irq_domain *irq_find_host(struct device_node *node);
extern void irq_set_default_host(struct irq_domain *host);
extern void irq_set_virq_count(unsigned int count);


extern unsigned int irq_create_mapping(struct irq_domain *host,
Loading