Commit 3ee62d36 authored by Milton Miller's avatar Milton Miller Committed by Benjamin Herrenschmidt

powerpc: Add virq_is_host to reduce virq_to_host usage

Some irq_host implementations are using virq_to_host to check if
they are the irq_host for a virtual irq.  To allow us to make space
versus time tradeoffs, replace this usage with an assertive
virq_is_host that confirms or denies the irq is associated with the
given irq_host.
Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 95533614
...@@ -128,6 +128,7 @@ struct irq_host { ...@@ -128,6 +128,7 @@ struct irq_host {
struct irq_data; struct irq_data;
extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d); extern irq_hw_number_t irqd_to_hwirq(struct irq_data *d);
extern irq_hw_number_t virq_to_hw(unsigned int virq); extern irq_hw_number_t virq_to_hw(unsigned int virq);
extern bool virq_is_host(unsigned int virq, struct irq_host *host);
extern struct irq_host *virq_to_host(unsigned int virq); extern struct irq_host *virq_to_host(unsigned int virq);
/** /**
......
...@@ -510,6 +510,12 @@ irq_hw_number_t virq_to_hw(unsigned int virq) ...@@ -510,6 +510,12 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
} }
EXPORT_SYMBOL_GPL(virq_to_hw); EXPORT_SYMBOL_GPL(virq_to_hw);
bool virq_is_host(unsigned int virq, struct irq_host *host)
{
return irq_map[virq].host == host;
}
EXPORT_SYMBOL_GPL(virq_is_host);
struct irq_host *virq_to_host(unsigned int virq) struct irq_host *virq_to_host(unsigned int virq)
{ {
return irq_map[virq].host; return irq_map[virq].host;
......
...@@ -213,7 +213,7 @@ void xics_migrate_irqs_away(void) ...@@ -213,7 +213,7 @@ void xics_migrate_irqs_away(void)
/* We can't set affinity on ISA interrupts */ /* We can't set affinity on ISA interrupts */
if (virq < NUM_ISA_INTERRUPTS) if (virq < NUM_ISA_INTERRUPTS)
continue; continue;
if (virq_to_host(virq) != xics_host) if (!virq_is_host(virq, xics_host))
continue; continue;
irq = (unsigned int)virq_to_hw(virq); irq = (unsigned int)virq_to_hw(virq);
/* We need to get IPIs still. */ /* We need to get IPIs still. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment