Skip to content

Commit

Permalink
Merge branch 'irqchip/handle_domain' into irqchip/core
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Cooper committed Sep 14, 2014
2 parents ce92bfe + 087fe00 commit 468a903
Show file tree
Hide file tree
Showing 31 changed files with 116 additions and 130 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ config ARM
select GENERIC_SMP_IDLE_THREAD
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HANDLE_DOMAIN_IRQ
select HARDIRQS_SW_RESEND
select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
Expand Down
19 changes: 1 addition & 18 deletions arch/arm/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
*/
void handle_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);

irq_enter();

/*
* Some hardware gives randomly wrong interrupts. Rather
* than crashing, do something sensible.
*/
if (unlikely(irq >= nr_irqs)) {
if (printk_ratelimit())
printk(KERN_WARNING "Bad IRQ%u\n", irq);
ack_bad_irq(irq);
} else {
generic_handle_irq(irq);
}

irq_exit();
set_irq_regs(old_regs);
__handle_domain_irq(NULL, irq, false, regs);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/avic.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
if (nivector == 0xffff)
break;

handle_IRQ(irq_find_mapping(domain, nivector), regs);
handle_domain_irq(domain, nivector, regs);
} while (1);
}

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-imx/tzic.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ static void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
while (stat) {
handled = 1;
irqofs = fls(stat) - 1;
handle_IRQ(irq_find_mapping(domain,
irqofs + i * 32), regs);
handle_domain_irq(domain, irqofs + i * 32, regs);
stat &= ~(1 << irqofs);
}
}
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-omap2/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs
irqnr &= ACTIVEIRQ_MASK;

if (irqnr) {
irqnr = irq_find_mapping(domain, irqnr);
handle_IRQ(irqnr, regs);
handle_domain_irq(domain, irqnr, regs);
handled_irq = 1;
}
} while (irqnr);
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ config ARM64
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select GENERIC_TIME_VSYSCALL
select HANDLE_DOMAIN_IRQ
select HARDIRQS_SW_RESEND
select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_JUMP_LABEL
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ static inline void ack_bad_irq(unsigned int irq)
irq_err_count++;
}

extern void handle_IRQ(unsigned int, struct pt_regs *);

/*
* No arch-specific IRQ flags.
*/
Expand Down
27 changes: 0 additions & 27 deletions arch/arm64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
return 0;
}

/*
* handle_IRQ handles all hardware IRQ's. Decoded IRQs should
* not come via this function. Instead, they should provide their
* own 'handler'. Used by platform code implementing C-based 1st
* level decoding.
*/
void handle_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);

irq_enter();

/*
* Some hardware gives randomly wrong interrupts. Rather
* than crashing, do something sensible.
*/
if (unlikely(irq >= nr_irqs)) {
pr_warn_ratelimited("Bad IRQ%u\n", irq);
ack_bad_irq(irq);
} else {
generic_handle_irq(irq);
}

irq_exit();
set_irq_regs(old_regs);
}

void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
{
if (handle_arch_irq)
Expand Down
1 change: 1 addition & 0 deletions arch/openrisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config OPENRISC
select OF
select OF_EARLY_FLATTREE
select IRQ_DOMAIN
select HANDLE_DOMAIN_IRQ
select HAVE_MEMBLOCK
select ARCH_REQUIRE_GPIOLIB
select HAVE_ARCH_TRACEHOOK
Expand Down
1 change: 0 additions & 1 deletion arch/openrisc/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#define NO_IRQ (-1)

void handle_IRQ(unsigned int, struct pt_regs *);
extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));

#endif /* __ASM_OPENRISC_IRQ_H__ */
12 changes: 0 additions & 12 deletions arch/openrisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
handle_arch_irq = handle_irq;
}

void handle_IRQ(unsigned int irq, struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);

irq_enter();

generic_handle_irq(irq);

irq_exit();
set_irq_regs(old_regs);
}

void __irq_entry do_IRQ(struct pt_regs *regs)
{
handle_arch_irq(regs);
Expand Down
19 changes: 10 additions & 9 deletions drivers/irqchip/irq-armada-370-xp.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,15 @@ static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained)
if (!(msimask & BIT(msinr)))
continue;

irq = irq_find_mapping(armada_370_xp_msi_domain,
msinr - 16);

if (is_chained)
if (is_chained) {
irq = irq_find_mapping(armada_370_xp_msi_domain,
msinr - 16);
generic_handle_irq(irq);
else
handle_IRQ(irq, regs);
} else {
irq = msinr - 16;
handle_domain_irq(armada_370_xp_msi_domain,
irq, regs);
}
}
}
#else
Expand Down Expand Up @@ -444,9 +446,8 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
break;

if (irqnr > 1) {
irqnr = irq_find_mapping(armada_370_xp_mpic_domain,
irqnr);
handle_IRQ(irqnr, regs);
handle_domain_irq(armada_370_xp_mpic_domain,
irqnr, regs);
continue;
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/irqchip/irq-atmel-aic.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ aic_handle(struct pt_regs *regs)
irqnr = irq_reg_readl(gc->reg_base + AT91_AIC_IVR);
irqstat = irq_reg_readl(gc->reg_base + AT91_AIC_ISR);

irqnr = irq_find_mapping(aic_domain, irqnr);

if (!irqstat)
irq_reg_writel(0, gc->reg_base + AT91_AIC_EOICR);
else
handle_IRQ(irqnr, regs);
handle_domain_irq(aic_domain, irqnr, regs);
}

static int aic_retrigger(struct irq_data *d)
Expand Down
4 changes: 1 addition & 3 deletions drivers/irqchip/irq-atmel-aic5.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ aic5_handle(struct pt_regs *regs)
irqnr = irq_reg_readl(gc->reg_base + AT91_AIC5_IVR);
irqstat = irq_reg_readl(gc->reg_base + AT91_AIC5_ISR);

irqnr = irq_find_mapping(aic5_domain, irqnr);

if (!irqstat)
irq_reg_writel(0, gc->reg_base + AT91_AIC5_EOICR);
else
handle_IRQ(irqnr, regs);
handle_domain_irq(aic5_domain, irqnr, regs);
}

static void aic5_mask(struct irq_data *d)
Expand Down
18 changes: 7 additions & 11 deletions drivers/irqchip/irq-clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,20 @@ static struct {

static asmlinkage void __exception_irq_entry clps711x_irqh(struct pt_regs *regs)
{
u32 irqnr, irqstat;
u32 irqstat;

do {
irqstat = readw_relaxed(clps711x_intc->intmr[0]) &
readw_relaxed(clps711x_intc->intsr[0]);
if (irqstat) {
irqnr = irq_find_mapping(clps711x_intc->domain,
fls(irqstat) - 1);
handle_IRQ(irqnr, regs);
}
if (irqstat)
handle_domain_irq(clps711x_intc->domain,
fls(irqstat) - 1, regs);

irqstat = readw_relaxed(clps711x_intc->intmr[1]) &
readw_relaxed(clps711x_intc->intsr[1]);
if (irqstat) {
irqnr = irq_find_mapping(clps711x_intc->domain,
fls(irqstat) - 1 + 16);
handle_IRQ(irqnr, regs);
}
if (irqstat)
handle_domain_irq(clps711x_intc->domain,
fls(irqstat) - 1 + 16, regs);
} while (irqstat);
}

Expand Down
13 changes: 6 additions & 7 deletions drivers/irqchip/irq-gic-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,13 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
irqnr = gic_read_iar();

if (likely(irqnr > 15 && irqnr < 1020)) {
u64 irq = irq_find_mapping(gic_data.domain, irqnr);
if (likely(irq)) {
handle_IRQ(irq, regs);
continue;
int err;
err = handle_domain_irq(gic_data.domain, irqnr, regs);
if (err) {
WARN_ONCE(true, "Unexpected SPI received!\n");
gic_write_eoir(irqnr);
}

WARN_ONCE(true, "Unexpected SPI received!\n");
gic_write_eoir(irqnr);
continue;
}
if (irqnr < 16) {
gic_write_eoir(irqnr);
Expand Down
3 changes: 1 addition & 2 deletions drivers/irqchip/irq-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
irqnr = irqstat & GICC_IAR_INT_ID_MASK;

if (likely(irqnr > 15 && irqnr < 1021)) {
irqnr = irq_find_mapping(gic->domain, irqnr);
handle_IRQ(irqnr, regs);
handle_domain_irq(gic->domain, irqnr, regs);
continue;
}
if (irqnr < 16) {
Expand Down
10 changes: 4 additions & 6 deletions drivers/irqchip/irq-mmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,26 +196,24 @@ static struct mmp_intc_conf mmp2_conf = {

static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
{
int irq, hwirq;
int hwirq;

hwirq = readl_relaxed(mmp_icu_base + PJ1_INT_SEL);
if (!(hwirq & SEL_INT_PENDING))
return;
hwirq &= SEL_INT_NUM_MASK;
irq = irq_find_mapping(icu_data[0].domain, hwirq);
handle_IRQ(irq, regs);
handle_domain_irq(icu_data[0].domain, hwirq, regs);
}

static void __exception_irq_entry mmp2_handle_irq(struct pt_regs *regs)
{
int irq, hwirq;
int hwirq;

hwirq = readl_relaxed(mmp_icu_base + PJ4_INT_SEL);
if (!(hwirq & SEL_INT_PENDING))
return;
hwirq &= SEL_INT_NUM_MASK;
irq = irq_find_mapping(icu_data[0].domain, hwirq);
handle_IRQ(irq, regs);
handle_domain_irq(icu_data[0].domain, hwirq, regs);
}

/* MMP (ARMv5) */
Expand Down
3 changes: 1 addition & 2 deletions drivers/irqchip/irq-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)

irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET);
__raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR);
irqnr = irq_find_mapping(icoll_domain, irqnr);
handle_IRQ(irqnr, regs);
handle_domain_irq(icoll_domain, irqnr, regs);
}

static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
Expand Down
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-or1k-pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ static inline int pic_get_irq(int first)
else
hwirq = hwirq + first - 1;

return irq_find_mapping(root_domain, hwirq);
return hwirq;
}

static void or1k_pic_handle_irq(struct pt_regs *regs)
{
int irq = -1;

while ((irq = pic_get_irq(irq + 1)) != NO_IRQ)
handle_IRQ(irq, regs);
handle_domain_irq(root_domain, irq, regs);
}

static int or1k_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
Expand Down
5 changes: 2 additions & 3 deletions drivers/irqchip/irq-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ __exception_irq_entry orion_handle_irq(struct pt_regs *regs)
gc->mask_cache;
while (stat) {
u32 hwirq = __fls(stat);
u32 irq = irq_find_mapping(orion_irq_domain,
gc->irq_base + hwirq);
handle_IRQ(irq, regs);
handle_domain_irq(orion_irq_domain,
gc->irq_base + hwirq, regs);
stat &= ~(1 << hwirq);
}
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/irqchip/irq-s3c24xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc,
{
int pnd;
int offset;
int irq;

pnd = __raw_readl(intc->reg_intpnd);
if (!pnd)
Expand All @@ -365,8 +364,7 @@ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc,
if (!(pnd & (1 << offset)))
offset = __ffs(pnd);

irq = irq_find_mapping(intc->domain, intc_offset + offset);
handle_IRQ(irq, regs);
handle_domain_irq(intc->domain, intc_offset + offset, regs);
return true;
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/irqchip/irq-sirfsoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
static void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
{
void __iomem *base = sirfsoc_irqdomain->host_data;
u32 irqstat, irqnr;
u32 irqstat;

irqstat = readl_relaxed(base + SIRFSOC_INIT_IRQ_ID);
irqnr = irq_find_mapping(sirfsoc_irqdomain, irqstat & 0xff);

handle_IRQ(irqnr, regs);
handle_domain_irq(sirfsoc_irqdomain, irqstat & 0xff, regs);
}

static int __init sirfsoc_irq_init(struct device_node *np,
Expand Down
5 changes: 2 additions & 3 deletions drivers/irqchip/irq-sun4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ IRQCHIP_DECLARE(allwinner_sun4i_ic, "allwinner,sun4i-a10-ic", sun4i_of_init);

static void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs)
{
u32 irq, hwirq;
u32 hwirq;

/*
* hwirq == 0 can mean one of 3 things:
Expand All @@ -154,8 +154,7 @@ static void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs)
return;

do {
irq = irq_find_mapping(sun4i_irq_domain, hwirq);
handle_IRQ(irq, regs);
handle_domain_irq(sun4i_irq_domain, hwirq, regs);
hwirq = readl(sun4i_irq_base + SUN4I_IRQ_VECTOR_REG) >> 2;
} while (hwirq != 0);
}
Loading

0 comments on commit 468a903

Please sign in to comment.