Release 4.14 arch/ia64/kernel/irq.c
// SPDX-License-Identifier: GPL-2.0
/*
* linux/arch/ia64/kernel/irq.c
*
* Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
*
* This file contains the code used by various IRQ handling routines:
* asking for different IRQs should be done through these routines
* instead of just grabbing them. Thus setups with different IRQ numbers
* shouldn't result in any weird surprises, and installing new handlers
* should be easier.
*
* Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004
*
* 4/14/2004: Added code to handle cpu migration and do safe irq
* migration without losing interrupts for iosapic
* architecture.
*/
#include <asm/delay.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <asm/mca.h>
/*
* 'what should we do if we get a hw irq event on an illegal vector'.
* each architecture has to answer this themselves.
*/
void ack_bad_irq(unsigned int irq)
{
printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id());
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tony Luck | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
#ifdef CONFIG_IA64_GENERIC
ia64_vector __ia64_irq_to_vector(int irq)
{
return irq_cfg[irq].vector;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Kenji Kaneshige | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
unsigned int __ia64_local_vector_to_irq (ia64_vector vec)
{
return __this_cpu_read(vector_irq[vec]);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 12 | 66.67% | 1 | 33.33% |
Yasuaki Ishimatsu | 4 | 22.22% | 1 | 33.33% |
Christoph Lameter | 2 | 11.11% | 1 | 33.33% |
Total | 18 | 100.00% | 3 | 100.00% |
#endif
/*
* Interrupt statistics:
*/
atomic_t irq_err_count;
/*
* /proc/interrupts printing:
*/
int arch_show_interrupts(struct seq_file *p, int prec)
{
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 13 | 44.83% | 2 | 28.57% |
Linus Torvalds | 8 | 27.59% | 2 | 28.57% |
Tony Luck | 4 | 13.79% | 1 | 14.29% |
Thomas Gleixner | 3 | 10.34% | 1 | 14.29% |
John Hawkes | 1 | 3.45% | 1 | 14.29% |
Total | 29 | 100.00% | 7 | 100.00% |
#ifdef CONFIG_SMP
static char irq_redir [NR_IRQS];
// = { [0 ... NR_IRQS-1] = 1 };
void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
{
if (irq < NR_IRQS) {
cpumask_copy(irq_get_affinity_mask(irq),
cpumask_of(cpu_logical_id(hwid)));
irq_redir[irq] = (char) (redir & 0xff);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tony Luck | 19 | 35.85% | 1 | 10.00% |
Mike Travis | 11 | 20.75% | 1 | 10.00% |
Linus Torvalds (pre-git) | 10 | 18.87% | 1 | 10.00% |
Andrew Morton | 5 | 9.43% | 2 | 20.00% |
Kenji Kaneshige | 2 | 3.77% | 1 | 10.00% |
David Mosberger-Tang | 2 | 3.77% | 1 | 10.00% |
Thomas Gleixner | 2 | 3.77% | 1 | 10.00% |
Jiang Liu | 1 | 1.89% | 1 | 10.00% |
Paul Jackson | 1 | 1.89% | 1 | 10.00% |
Total | 53 | 100.00% | 10 | 100.00% |
bool is_affinity_mask_valid(const struct cpumask *cpumask)
{
if (ia64_platform_is("sn2")) {
/* Only allow one CPU to be specified in the smp_affinity mask */
if (cpumask_weight(cpumask) != 1)
return false;
}
return true;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Keller | 31 | 86.11% | 1 | 33.33% |
Mike Travis | 4 | 11.11% | 1 | 33.33% |
Ingo Molnar | 1 | 2.78% | 1 | 33.33% |
Total | 36 | 100.00% | 3 | 100.00% |
#endif /* CONFIG_SMP */
int __init arch_early_irq_init(void)
{
ia64_mca_irq_init();
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tony Luck | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
#ifdef CONFIG_HOTPLUG_CPU
unsigned int vectors_in_migration[NR_IRQS];
/*
* Since cpu_online_mask is already updated, we just need to check for
* affinity that has zeros
*/
static void migrate_irqs(void)
{
int irq, new_cpu;
for (irq=0; irq < NR_IRQS; irq++) {
struct irq_desc *desc = irq_to_desc(irq);
struct irq_data *data = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(data);
if (irqd_irq_disabled(data))
continue;
/*
* No handling for now.
* TBD: Implement a disable function so we can now
* tell CPU not to respond to these local intr sources.
* such as ITV,CPEI,MCA etc.
*/
if (irqd_is_per_cpu(data))
continue;
if (cpumask_any_and(irq_data_get_affinity_mask(data),
cpu_online_mask) >= nr_cpu_ids) {
/*
* Save it for phase 2 processing
*/
vectors_in_migration[irq] = irq;
new_cpu = cpumask_any(cpu_online_mask);
/*
* Al three are essential, currently WARN_ON.. maybe panic?
*/
if (chip && chip->irq_disable &&
chip->irq_enable && chip->irq_set_affinity) {
chip->irq_disable(data);
chip->irq_set_affinity(data,
cpumask_of(new_cpu), false);
chip->irq_enable(data);
} else {
WARN_ON((!chip || !chip->irq_disable ||
!chip->irq_enable ||
!chip->irq_set_affinity));
}
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrew Morton | 97 | 54.19% | 1 | 11.11% |
Thomas Gleixner | 51 | 28.49% | 2 | 22.22% |
Ingo Molnar | 12 | 6.70% | 2 | 22.22% |
Rusty Russell | 10 | 5.59% | 1 | 11.11% |
Magnus Damm | 4 | 2.23% | 1 | 11.11% |
Jiang Liu | 3 | 1.68% | 1 | 11.11% |
Mike Travis | 2 | 1.12% | 1 | 11.11% |
Total | 179 | 100.00% | 9 | 100.00% |
void fixup_irqs(void)
{
unsigned int irq;
extern void ia64_process_pending_intr(void);
extern volatile int time_keeper_id;
/* Mask ITV to disable timer */
ia64_set_itv(1 << 16);
/*
* Find a new timesync master
*/
if (smp_processor_id() == time_keeper_id) {
time_keeper_id = cpumask_first(cpu_online_mask);
printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id);
}
/*
* Phase 1: Locate IRQs bound to this cpu and
* relocate them for cpu removal.
*/
migrate_irqs();
/*
* Phase 2: Perform interrupt processing for all entries reported in
* local APIC.
*/
ia64_process_pending_intr();
/*
* Phase 3: Now handle any interrupts not captured in local APIC.
* This is to account for cases that device interrupted during the time the
* rte was being disabled and re-programmed.
*/
for (irq=0; irq < NR_IRQS; irq++) {
if (vectors_in_migration[irq]) {
struct pt_regs *old_regs = set_irq_regs(NULL);
vectors_in_migration[irq]=0;
generic_handle_irq(irq);
set_irq_regs(old_regs);
}
}
/*
* Now let processor die. We do irq disable and max_xtp() to
* ensure there is no more interrupts routed to this processor.
* But the local timer interrupt can have 1 pending which we
* take care in timer_interrupt().
*/
max_xtp();
local_irq_disable();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrew Morton | 71 | 58.20% | 1 | 14.29% |
Ashok Raj | 25 | 20.49% | 1 | 14.29% |
Tony Luck | 15 | 12.30% | 1 | 14.29% |
Hidetoshi Seto | 7 | 5.74% | 1 | 14.29% |
Mike Travis | 2 | 1.64% | 1 | 14.29% |
Ingo Molnar | 1 | 0.82% | 1 | 14.29% |
Simon Arlott | 1 | 0.82% | 1 | 14.29% |
Total | 122 | 100.00% | 7 | 100.00% |
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Andrew Morton | 185 | 33.76% | 3 | 7.69% |
Tony Luck | 91 | 16.61% | 3 | 7.69% |
Thomas Gleixner | 56 | 10.22% | 4 | 10.26% |
Linus Torvalds (pre-git) | 35 | 6.39% | 2 | 5.13% |
John Keller | 31 | 5.66% | 1 | 2.56% |
Ashok Raj | 25 | 4.56% | 1 | 2.56% |
Mike Travis | 20 | 3.65% | 1 | 2.56% |
Kenji Kaneshige | 18 | 3.28% | 2 | 5.13% |
Björn Helgaas | 17 | 3.10% | 1 | 2.56% |
Ingo Molnar | 14 | 2.55% | 4 | 10.26% |
Linus Torvalds | 12 | 2.19% | 3 | 7.69% |
Rusty Russell | 10 | 1.82% | 1 | 2.56% |
Hidetoshi Seto | 7 | 1.28% | 1 | 2.56% |
Yasuaki Ishimatsu | 4 | 0.73% | 1 | 2.56% |
Jiang Liu | 4 | 0.73% | 1 | 2.56% |
Magnus Damm | 4 | 0.73% | 1 | 2.56% |
David Mosberger-Tang | 3 | 0.55% | 2 | 5.13% |
Arnaldo Carvalho de Melo | 3 | 0.55% | 1 | 2.56% |
Steven Cole | 2 | 0.36% | 1 | 2.56% |
Simon Arlott | 2 | 0.36% | 1 | 2.56% |
Christoph Lameter | 2 | 0.36% | 1 | 2.56% |
Greg Kroah-Hartman | 1 | 0.18% | 1 | 2.56% |
John Hawkes | 1 | 0.18% | 1 | 2.56% |
Paul Jackson | 1 | 0.18% | 1 | 2.56% |
Total | 548 | 100.00% | 39 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.