cregit-Linux how code gets into the kernel

Release 4.14 arch/ia64/kernel/irq.c

Directory: arch/ia64/kernel
// 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

PersonTokensPropCommitsCommitProp
Tony Luck20100.00%1100.00%
Total20100.00%1100.00%

#ifdef CONFIG_IA64_GENERIC
ia64_vector __ia64_irq_to_vector(int irq) { return irq_cfg[irq].vector; }

Contributors

PersonTokensPropCommitsCommitProp
Kenji Kaneshige16100.00%1100.00%
Total16100.00%1100.00%


unsigned int __ia64_local_vector_to_irq (ia64_vector vec) { return __this_cpu_read(vector_irq[vec]); }

Contributors

PersonTokensPropCommitsCommitProp
Björn Helgaas1266.67%133.33%
Yasuaki Ishimatsu422.22%133.33%
Christoph Lameter211.11%133.33%
Total18100.00%3100.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

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)1344.83%228.57%
Linus Torvalds827.59%228.57%
Tony Luck413.79%114.29%
Thomas Gleixner310.34%114.29%
John Hawkes13.45%114.29%
Total29100.00%7100.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

PersonTokensPropCommitsCommitProp
Tony Luck1935.85%110.00%
Mike Travis1120.75%110.00%
Linus Torvalds (pre-git)1018.87%110.00%
Andrew Morton59.43%220.00%
Kenji Kaneshige23.77%110.00%
David Mosberger-Tang23.77%110.00%
Thomas Gleixner23.77%110.00%
Jiang Liu11.89%110.00%
Paul Jackson11.89%110.00%
Total53100.00%10100.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

PersonTokensPropCommitsCommitProp
John Keller3186.11%133.33%
Mike Travis411.11%133.33%
Ingo Molnar12.78%133.33%
Total36100.00%3100.00%

#endif /* CONFIG_SMP */
int __init arch_early_irq_init(void) { ia64_mca_irq_init(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Tony Luck14100.00%1100.00%
Total14100.00%1100.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

PersonTokensPropCommitsCommitProp
Andrew Morton9754.19%111.11%
Thomas Gleixner5128.49%222.22%
Ingo Molnar126.70%222.22%
Rusty Russell105.59%111.11%
Magnus Damm42.23%111.11%
Jiang Liu31.68%111.11%
Mike Travis21.12%111.11%
Total179100.00%9100.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

PersonTokensPropCommitsCommitProp
Andrew Morton7158.20%114.29%
Ashok Raj2520.49%114.29%
Tony Luck1512.30%114.29%
Hidetoshi Seto75.74%114.29%
Mike Travis21.64%114.29%
Ingo Molnar10.82%114.29%
Simon Arlott10.82%114.29%
Total122100.00%7100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton18533.76%37.69%
Tony Luck9116.61%37.69%
Thomas Gleixner5610.22%410.26%
Linus Torvalds (pre-git)356.39%25.13%
John Keller315.66%12.56%
Ashok Raj254.56%12.56%
Mike Travis203.65%12.56%
Kenji Kaneshige183.28%25.13%
Björn Helgaas173.10%12.56%
Ingo Molnar142.55%410.26%
Linus Torvalds122.19%37.69%
Rusty Russell101.82%12.56%
Hidetoshi Seto71.28%12.56%
Yasuaki Ishimatsu40.73%12.56%
Jiang Liu40.73%12.56%
Magnus Damm40.73%12.56%
David Mosberger-Tang30.55%25.13%
Arnaldo Carvalho de Melo30.55%12.56%
Steven Cole20.36%12.56%
Simon Arlott20.36%12.56%
Christoph Lameter20.36%12.56%
Greg Kroah-Hartman10.18%12.56%
John Hawkes10.18%12.56%
Paul Jackson10.18%12.56%
Total548100.00%39100.00%
Directory: arch/ia64/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.