Skip to content

Commit

Permalink
Merge tag 'irq-core-2020-03-30' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/tip/tip

Pull irq updates from Thomas Gleixner:
 "Updates for the interrupt subsystem:

  Treewide:

    - Cleanup of setup_irq() which is not longer required because the
      memory allocator is available early.

      Most cleanup changes come through the various maintainer trees, so
      the final removal of setup_irq() is postponed towards the end of
      the merge window.

  Core:

    - Protection against unsafe invocation of interrupt handlers and
      unsafe interrupt injection including a fixup of the offending
      PCI/AER error injection mechanism.

      Invoking interrupt handlers from arbitrary contexts, i.e. outside
      of an actual interrupt, can cause inconsistent state on the
      fragile x86 interrupt affinity changing hardware trainwreck.

  Drivers:

    - Second wave of support for the new ARM GICv4.1

    - Multi-instance support for Xilinx and PLIC interrupt controllers

    - CPU-Hotplug support for PLIC

    - The obligatory new driver for X1000 TCU

    - Enhancements, cleanups and fixes all over the place"

* tag 'irq-core-2020-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (58 commits)
  unicore32: Replace setup_irq() by request_irq()
  sh: Replace setup_irq() by request_irq()
  hexagon: Replace setup_irq() by request_irq()
  c6x: Replace setup_irq() by request_irq()
  alpha: Replace setup_irq() by request_irq()
  irqchip/gic-v4.1: Eagerly vmap vPEs
  irqchip/gic-v4.1: Add VSGI property setup
  irqchip/gic-v4.1: Add VSGI allocation/teardown
  irqchip/gic-v4.1: Move doorbell management to the GICv4 abstraction layer
  irqchip/gic-v4.1: Plumb set_vcpu_affinity SGI callbacks
  irqchip/gic-v4.1: Plumb get/set_irqchip_state SGI callbacks
  irqchip/gic-v4.1: Plumb mask/unmask SGI callbacks
  irqchip/gic-v4.1: Add initial SGI configuration
  irqchip/gic-v4.1: Plumb skeletal VSGI irqchip
  irqchip/stm32: Retrigger both in eoi and unmask callbacks
  irqchip/gic-v3: Move irq_domain_update_bus_token to after checking for NULL domain
  irqchip/xilinx: Do not call irq_set_default_host()
  irqchip/xilinx: Enable generic irq multi handler
  irqchip/xilinx: Fill error code when irq domain registration fails
  irqchip/xilinx: Add support for multiple instances
  ...
  • Loading branch information
Linus Torvalds committed Mar 31, 2020
2 parents 673b41e + 8a13b02 commit 2d38533
Show file tree
Hide file tree
Showing 64 changed files with 1,185 additions and 420 deletions.
29 changes: 5 additions & 24 deletions arch/alpha/kernel/irq_alpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,32 +213,13 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
* The special RTC interrupt type. The interrupt itself was
* processed by PALcode, and comes in via entInt vector 1.
*/

struct irqaction timer_irqaction = {
.handler = rtc_timer_interrupt,
.name = "timer",
};

void __init
init_rtc_irq(void)
init_rtc_irq(irq_handler_t handler)
{
irq_set_chip_and_handler_name(RTC_IRQ, &dummy_irq_chip,
handle_percpu_irq, "RTC");
setup_irq(RTC_IRQ, &timer_irqaction);
if (!handler)
handler = rtc_timer_interrupt;
if (request_irq(RTC_IRQ, handler, 0, "timer", NULL))
pr_err("Failed to register timer interrupt\n");
}

/* Dummy irqactions. */
struct irqaction isa_cascade_irqaction = {
.handler = no_action,
.name = "isa-cascade"
};

struct irqaction timer_cascade_irqaction = {
.handler = no_action,
.name = "timer-cascade"
};

struct irqaction halt_switch_irqaction = {
.handler = no_action,
.name = "halt-switch"
};
8 changes: 2 additions & 6 deletions arch/alpha/kernel/irq_i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ struct irq_chip i8259a_irq_type = {
void __init
init_i8259a_irqs(void)
{
static struct irqaction cascade = {
.handler = no_action,
.name = "cascade",
};

long i;

outb(0xff, 0x21); /* mask all of 8259A-1 */
Expand All @@ -96,7 +91,8 @@ init_i8259a_irqs(void)
irq_set_chip_and_handler(i, &i8259a_irq_type, handle_level_irq);
}

setup_irq(2, &cascade);
if (request_irq(2, no_action, 0, "cascade", NULL))
pr_err("Failed to request irq 2 (cascade)\n");
}


Expand Down
7 changes: 1 addition & 6 deletions arch/alpha/kernel/irq_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,9 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long);
extern void srm_device_interrupt(unsigned long);
extern void pyxis_device_interrupt(unsigned long);

extern struct irqaction timer_irqaction;
extern struct irqaction isa_cascade_irqaction;
extern struct irqaction timer_cascade_irqaction;
extern struct irqaction halt_switch_irqaction;

extern void init_srm_irqs(long, unsigned long);
extern void init_pyxis_irqs(unsigned long);
extern void init_rtc_irq(void);
extern void init_rtc_irq(irq_handler_t handler);

extern void common_init_isa_dma(void);

Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/irq_pyxis.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@ init_pyxis_irqs(unsigned long ignore_mask)
irq_set_status_flags(i, IRQ_LEVEL);
}

setup_irq(16+7, &isa_cascade_irqaction);
if (request_irq(16 + 7, no_action, 0, "isa-cascade", NULL))
pr_err("Failed to register isa-cascade interrupt\n");
}
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_alcor.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ alcor_init_irq(void)
init_i8259a_irqs();
common_init_isa_dma();

setup_irq(16+31, &isa_cascade_irqaction);
if (request_irq(16 + 31, no_action, 0, "isa-cascade", NULL))
pr_err("Failed to register isa-cascade interrupt\n");
}


Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_cabriolet.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ common_init_irq(void (*srm_dev_int)(unsigned long v))
}

common_init_isa_dma();
setup_irq(16+4, &isa_cascade_irqaction);
if (request_irq(16 + 4, no_action, 0, "isa-cascade", NULL))
pr_err("Failed to register isa-cascade interrupt\n");
}

#ifndef CONFIG_ALPHA_PC164
Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_eb64p.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ eb64p_init_irq(void)
}

common_init_isa_dma();
setup_irq(16+5, &isa_cascade_irqaction);
if (request_irq(16 + 5, no_action, 0, "isa-cascade", NULL))
pr_err("Failed to register isa-cascade interrupt\n");
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_marvel.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ marvel_init_pci(void)
static void __init
marvel_init_rtc(void)
{
init_rtc_irq();
init_rtc_irq(NULL);
}

static void
Expand Down
6 changes: 4 additions & 2 deletions arch/alpha/kernel/sys_miata.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ miata_init_irq(void)
init_pyxis_irqs(0x63b0000);

common_init_isa_dma();
setup_irq(16+2, &halt_switch_irqaction); /* SRM only? */
setup_irq(16+6, &timer_cascade_irqaction);
if (request_irq(16 + 2, no_action, 0, "halt-switch", NULL))
pr_err("Failed to register halt-switch interrupt\n");
if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL))
pr_err("Failed to register timer-cascade interrupt\n");
}


Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_ruffian.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ ruffian_init_rtc(void)
outb(0x31, 0x42);
outb(0x13, 0x42);

setup_irq(0, &timer_irqaction);
if (request_irq(0, rtc_timer_interrupt, 0, "timer", NULL))
pr_err("Failed to request irq 0 (timer)\n");
}

static void
Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_rx164.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ rx164_init_irq(void)
init_i8259a_irqs();
common_init_isa_dma();

setup_irq(16+20, &isa_cascade_irqaction);
if (request_irq(16 + 20, no_action, 0, "isa-cascade", NULL))
pr_err("Failed to register isa-cascade interrupt\n");
}


Expand Down
3 changes: 2 additions & 1 deletion arch/alpha/kernel/sys_sx164.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ sx164_init_irq(void)
else
init_pyxis_irqs(0xff00003f0000UL);

setup_irq(16+6, &timer_cascade_irqaction);
if (request_irq(16 + 6, no_action, 0, "timer-cascade", NULL))
pr_err("Failed to register timer-cascade interrupt\n");
}

/*
Expand Down
7 changes: 2 additions & 5 deletions arch/alpha/kernel/sys_wildfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ static void __init
wildfire_init_irq_per_pca(int qbbno, int pcano)
{
int i, irq_bias;
static struct irqaction isa_enable = {
.handler = no_action,
.name = "isa_enable",
};

irq_bias = qbbno * (WILDFIRE_PCA_PER_QBB * WILDFIRE_IRQ_PER_PCA)
+ pcano * WILDFIRE_IRQ_PER_PCA;
Expand Down Expand Up @@ -198,7 +194,8 @@ wildfire_init_irq_per_pca(int qbbno, int pcano)
irq_set_status_flags(i + irq_bias, IRQ_LEVEL);
}

setup_irq(32+irq_bias, &isa_enable);
if (request_irq(32 + irq_bias, no_action, 0, "isa_enable", NULL))
pr_err("Failed to register isa_enable interrupt\n");
}

static void __init
Expand Down
6 changes: 2 additions & 4 deletions arch/alpha/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ common_init_rtc(void)
outb(0x31, 0x42);
outb(0x13, 0x42);

init_rtc_irq();
init_rtc_irq(NULL);
}


Expand Down Expand Up @@ -396,9 +396,7 @@ time_init(void)
if (alpha_using_qemu) {
clocksource_register_hz(&qemu_cs, NSEC_PER_SEC);
init_qemu_clockevent();

timer_irqaction.handler = qemu_timer_interrupt;
init_rtc_irq();
init_rtc_irq(qemu_timer_interrupt);
return;
}

Expand Down
7 changes: 5 additions & 2 deletions arch/arm/common/sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,13 @@ static int sa1111_retrigger_irq(struct irq_data *d)
break;
}

if (i == 8)
if (i == 8) {
pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n",
d->irq);
return i == 8 ? -1 : 0;
return 0;
}

return 1;
}

static int sa1111_type_irq(struct irq_data *d, unsigned int flags)
Expand Down
11 changes: 3 additions & 8 deletions arch/c6x/platforms/timer64.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

static struct irqaction timer_iact = {
.name = "timer",
.flags = IRQF_TIMER,
.handler = timer_interrupt,
.dev_id = &t64_clockevent_device,
};

void __init timer64_init(void)
{
struct clock_event_device *cd = &t64_clockevent_device;
Expand Down Expand Up @@ -238,7 +231,9 @@ void __init timer64_init(void)
cd->cpumask = cpumask_of(smp_processor_id());

clockevents_register_device(cd);
setup_irq(cd->irq, &timer_iact);
if (request_irq(cd->irq, timer_interrupt, IRQF_TIMER, "timer",
&t64_clockevent_device))
pr_err("Failed to request irq %d (timer)\n", cd->irq);

out:
of_node_put(np);
Expand Down
22 changes: 11 additions & 11 deletions arch/hexagon/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg)
local_irq_restore(flags);
}

static struct irqaction ipi_intdesc = {
.handler = handle_ipi,
.flags = IRQF_TRIGGER_RISING,
.name = "ipi_handler"
};

void __init smp_prepare_boot_cpu(void)
{
}
Expand All @@ -132,8 +126,8 @@ void __init smp_prepare_boot_cpu(void)

void start_secondary(void)
{
unsigned int cpu;
unsigned long thread_ptr;
unsigned int cpu, irq;

/* Calculate thread_info pointer from stack pointer */
__asm__ __volatile__(
Expand All @@ -155,7 +149,10 @@ void start_secondary(void)

cpu = smp_processor_id();

setup_irq(BASE_IPI_IRQ + cpu, &ipi_intdesc);
irq = BASE_IPI_IRQ + cpu;
if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING, "ipi_handler",
NULL))
pr_err("Failed to request irq %u (ipi_handler)\n", irq);

/* Register the clock_event dummy */
setup_percpu_clockdev();
Expand Down Expand Up @@ -201,7 +198,7 @@ void __init smp_cpus_done(unsigned int max_cpus)

void __init smp_prepare_cpus(unsigned int max_cpus)
{
int i;
int i, irq = BASE_IPI_IRQ;

/*
* should eventually have some sort of machine
Expand All @@ -213,8 +210,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
set_cpu_present(i, true);

/* Also need to register the interrupts for IPI */
if (max_cpus > 1)
setup_irq(BASE_IPI_IRQ, &ipi_intdesc);
if (max_cpus > 1) {
if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING,
"ipi_handler", NULL))
pr_err("Failed to request irq %d (ipi_handler)\n", irq);
}
}

void smp_send_reschedule(int cpu)
Expand Down
11 changes: 3 additions & 8 deletions arch/hexagon/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid)
return IRQ_HANDLED;
}

/* This should also be pulled from devtree */
static struct irqaction rtos_timer_intdesc = {
.handler = timer_interrupt,
.flags = IRQF_TIMER | IRQF_TRIGGER_RISING,
.name = "rtos_timer"
};

/*
* time_init_deferred - called by start_kernel to set up timer/clock source
*
Expand All @@ -163,6 +156,7 @@ void __init time_init_deferred(void)
{
struct resource *resource = NULL;
struct clock_event_device *ce_dev = &hexagon_clockevent_dev;
unsigned long flag = IRQF_TIMER | IRQF_TRIGGER_RISING;

ce_dev->cpumask = cpu_all_mask;

Expand Down Expand Up @@ -195,7 +189,8 @@ void __init time_init_deferred(void)
#endif

clockevents_register_device(ce_dev);
setup_irq(ce_dev->irq, &rtos_timer_intdesc);
if (request_irq(ce_dev->irq, timer_interrupt, flag, "rtos_timer", NULL))
pr_err("Failed to register rtos_timer interrupt\n");
}

void __init time_init(void)
Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ config MICROBLAZE
select CPU_NO_EFFICIENT_FFS
select MMU_GATHER_NO_RANGE if MMU
select SPARSE_IRQ
select GENERIC_IRQ_MULTI_HANDLER
select HANDLE_DOMAIN_IRQ

# Endianness selection
choice
Expand Down
3 changes: 0 additions & 3 deletions arch/microblaze/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@
struct pt_regs;
extern void do_IRQ(struct pt_regs *regs);

/* should be defined in each interrupt controller driver */
extern unsigned int xintc_get_irq(void);

#endif /* _ASM_MICROBLAZE_IRQ_H */
21 changes: 1 addition & 20 deletions arch/microblaze/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,10 @@
#include <linux/irqchip.h>
#include <linux/of_irq.h>

static u32 concurrent_irq;

void __irq_entry do_IRQ(struct pt_regs *regs)
{
unsigned int irq;
struct pt_regs *old_regs = set_irq_regs(regs);
trace_hardirqs_off();

irq_enter();
irq = xintc_get_irq();
next_irq:
BUG_ON(!irq);
generic_handle_irq(irq);

irq = xintc_get_irq();
if (irq != -1U) {
pr_debug("next irq: %d\n", irq);
++concurrent_irq;
goto next_irq;
}

irq_exit();
set_irq_regs(old_regs);
handle_arch_irq(regs);
trace_hardirqs_on();
}

Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ void __init trap_init(void)
/* Set the exception vector address */
csr_write(CSR_TVEC, &handle_exception);
/* Enable interrupts */
csr_write(CSR_IE, IE_SIE | IE_EIE);
csr_write(CSR_IE, IE_SIE);
}
Loading

0 comments on commit 2d38533

Please sign in to comment.