Skip to content

Commit

Permalink
x86, irq, devicetree: Use common irqdomain map interface to program I…
Browse files Browse the repository at this point in the history
…OAPIC pins

Refine devicetree to use common irqdomain map interface to program
IOAPIC pins, so we can unify the callsite to progam IOAPIC pins.

Signed-off-by: Jiang Liu <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Tony Lindgren <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
Jiang Liu authored and KAGA-KOKO committed Jun 21, 2014
1 parent ecc527d commit 795aacf
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions arch/x86/kernel/devicetree.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,8 @@ static int ioapic_xlate(struct irq_domain *domain,
const u32 *intspec, u32 intsize,
irq_hw_number_t *out_hwirq, u32 *out_type)
{
struct io_apic_irq_attr attr;
struct of_ioapic_type *it;
u32 line, idx;
int rc;
u32 line, idx, gsi;

if (WARN_ON(intsize < 2))
return -EINVAL;
Expand All @@ -217,19 +215,17 @@ static int ioapic_xlate(struct irq_domain *domain,
it = &of_ioapic_type[intspec[1]];

idx = (u32)(long)domain->host_data;
set_io_apic_irq_attr(&attr, idx, line, it->trigger, it->polarity);

rc = io_apic_setup_irq_pin_once(irq_find_mapping(domain, line),
cpu_to_node(0), &attr);
if (rc)
return rc;
gsi = mp_pin_to_gsi(idx, line);
if (mp_set_gsi_attr(gsi, it->trigger, it->polarity, cpu_to_node(0)))
return -EBUSY;

*out_hwirq = line;
*out_type = it->out_type;
return 0;
}

const struct irq_domain_ops ioapic_irq_domain_ops = {
.map = mp_irqdomain_map,
.xlate = ioapic_xlate,
};

Expand Down

0 comments on commit 795aacf

Please sign in to comment.