You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (116 commits) x86: Enable forced interrupt threading support x86: Mark low level interrupts IRQF_NO_THREAD x86: Use generic show_interrupts x86: ioapic: Avoid redundant lookup of irq_cfg x86: ioapic: Use new move_irq functions x86: Use the proper accessors in fixup_irqs() x86: ioapic: Use irq_data->state x86: ioapic: Simplify irq chip and handler setup x86: Cleanup the genirq name space genirq: Add chip flag to force mask on suspend genirq: Add desc->irq_data accessor genirq: Add comments to Kconfig switches genirq: Fixup fasteoi handler for oneshot mode genirq: Provide forced interrupt threading sched: Switch wait_task_inactive to schedule_hrtimeout() genirq: Add IRQF_NO_THREAD genirq: Allow shared oneshot interrupts genirq: Prepare the handling of shared oneshot interrupts genirq: Make warning in handle_percpu_event useful x86: ioapic: Move trigger defines to io_apic.h ... Fix up trivial(?) conflicts in arch/x86/pci/xen.c due to genirq name space changes clashing with the Xen cleanups. The set_irq_msi() had moved to xen_bind_pirq_msi_to_irq().
This commit is contained in:
@@ -2444,6 +2444,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
|
||||
<deci-seconds>: poll all this frequency
|
||||
0: no polling (default)
|
||||
|
||||
threadirqs [KNL]
|
||||
Force threading of all interrupt handlers except those
|
||||
marked explicitely IRQF_NO_THREAD.
|
||||
|
||||
topology= [S390]
|
||||
Format: {off | on}
|
||||
Specify if the kernel should make use of the cpu
|
||||
|
||||
+3
-1
@@ -68,6 +68,8 @@ config X86
|
||||
select GENERIC_FIND_NEXT_BIT
|
||||
select GENERIC_IRQ_PROBE
|
||||
select GENERIC_PENDING_IRQ if SMP
|
||||
select GENERIC_IRQ_SHOW
|
||||
select IRQ_FORCED_THREADING
|
||||
select USE_GENERIC_SMP_HELPERS if SMP
|
||||
|
||||
config INSTRUCTION_DECODER
|
||||
@@ -813,7 +815,7 @@ config X86_LOCAL_APIC
|
||||
|
||||
config X86_IO_APIC
|
||||
def_bool y
|
||||
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
|
||||
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC
|
||||
|
||||
config X86_VISWS_APIC
|
||||
def_bool y
|
||||
|
||||
@@ -426,4 +426,16 @@ struct local_apic {
|
||||
#else
|
||||
#define BAD_APICID 0xFFFFu
|
||||
#endif
|
||||
|
||||
enum ioapic_irq_destination_types {
|
||||
dest_Fixed = 0,
|
||||
dest_LowestPrio = 1,
|
||||
dest_SMI = 2,
|
||||
dest__reserved_1 = 3,
|
||||
dest_NMI = 4,
|
||||
dest_INIT = 5,
|
||||
dest__reserved_2 = 6,
|
||||
dest_ExtINT = 7
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_APICDEF_H */
|
||||
|
||||
@@ -63,17 +63,6 @@ union IO_APIC_reg_03 {
|
||||
} __attribute__ ((packed)) bits;
|
||||
};
|
||||
|
||||
enum ioapic_irq_destination_types {
|
||||
dest_Fixed = 0,
|
||||
dest_LowestPrio = 1,
|
||||
dest_SMI = 2,
|
||||
dest__reserved_1 = 3,
|
||||
dest_NMI = 4,
|
||||
dest_INIT = 5,
|
||||
dest__reserved_2 = 6,
|
||||
dest_ExtINT = 7
|
||||
};
|
||||
|
||||
struct IO_APIC_route_entry {
|
||||
__u32 vector : 8,
|
||||
delivery_mode : 3, /* 000: FIXED
|
||||
@@ -106,6 +95,10 @@ struct IR_IO_APIC_route_entry {
|
||||
index : 15;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define IOAPIC_AUTO -1
|
||||
#define IOAPIC_EDGE 0
|
||||
#define IOAPIC_LEVEL 1
|
||||
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
|
||||
/*
|
||||
@@ -150,11 +143,6 @@ extern int timer_through_8259;
|
||||
#define io_apic_assign_pci_irqs \
|
||||
(mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
|
||||
|
||||
extern u8 io_apic_unique_id(u8 id);
|
||||
extern int io_apic_get_unique_id(int ioapic, int apic_id);
|
||||
extern int io_apic_get_version(int ioapic);
|
||||
extern int io_apic_get_redir_entries(int ioapic);
|
||||
|
||||
struct io_apic_irq_attr;
|
||||
extern int io_apic_set_pci_routing(struct device *dev, int irq,
|
||||
struct io_apic_irq_attr *irq_attr);
|
||||
@@ -162,6 +150,8 @@ void setup_IO_APIC_irq_extra(u32 gsi);
|
||||
extern void ioapic_and_gsi_init(void);
|
||||
extern void ioapic_insert_resources(void);
|
||||
|
||||
int io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr);
|
||||
|
||||
extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
|
||||
extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
|
||||
extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries);
|
||||
@@ -186,6 +176,8 @@ extern void __init pre_init_apic_IRQ0(void);
|
||||
|
||||
extern void mp_save_irq(struct mpc_intsrc *m);
|
||||
|
||||
extern void disable_ioapic_support(void);
|
||||
|
||||
#else /* !CONFIG_X86_IO_APIC */
|
||||
|
||||
#define io_apic_assign_pci_irqs 0
|
||||
@@ -199,6 +191,26 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; }
|
||||
struct io_apic_irq_attr;
|
||||
static inline int io_apic_set_pci_routing(struct device *dev, int irq,
|
||||
struct io_apic_irq_attr *irq_attr) { return 0; }
|
||||
|
||||
static inline struct IO_APIC_route_entry **alloc_ioapic_entries(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void free_ioapic_entries(struct IO_APIC_route_entry **ent) { }
|
||||
static inline int save_IO_APIC_setup(struct IO_APIC_route_entry **ent)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static inline void mask_IO_APIC_setup(struct IO_APIC_route_entry **ent) { }
|
||||
static inline int restore_IO_APIC_setup(struct IO_APIC_route_entry **ent)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static inline void mp_save_irq(struct mpc_intsrc *m) { };
|
||||
static inline void disable_ioapic_support(void) { }
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_X86_IO_APIC_H */
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <asm/i8259.h>
|
||||
#include <asm/proto.h>
|
||||
#include <asm/apic.h>
|
||||
#include <asm/io_apic.h>
|
||||
#include <asm/desc.h>
|
||||
#include <asm/hpet.h>
|
||||
#include <asm/idle.h>
|
||||
@@ -1209,7 +1210,7 @@ void __cpuinit setup_local_APIC(void)
|
||||
rdtscll(tsc);
|
||||
|
||||
if (disable_apic) {
|
||||
arch_disable_smp_support();
|
||||
disable_ioapic_support();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1448,7 +1449,7 @@ int __init enable_IR(void)
|
||||
void __init enable_IR_x2apic(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct IO_APIC_route_entry **ioapic_entries = NULL;
|
||||
struct IO_APIC_route_entry **ioapic_entries;
|
||||
int ret, x2apic_enabled = 0;
|
||||
int dmar_table_init_ret;
|
||||
|
||||
|
||||
+171
-221
File diff suppressed because it is too large
Load Diff
@@ -503,7 +503,7 @@ static int hpet_assign_irq(struct hpet_dev *dev)
|
||||
if (!irq)
|
||||
return -EINVAL;
|
||||
|
||||
set_irq_data(irq, dev);
|
||||
irq_set_handler_data(irq, dev);
|
||||
|
||||
if (hpet_setup_msi_irq(irq))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -112,7 +112,7 @@ static void make_8259A_irq(unsigned int irq)
|
||||
{
|
||||
disable_irq_nosync(irq);
|
||||
io_apic_irqs &= ~(1<<irq);
|
||||
set_irq_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
|
||||
irq_set_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
|
||||
i8259A_chip.name);
|
||||
enable_irq(irq);
|
||||
}
|
||||
|
||||
+16
-66
@@ -44,9 +44,9 @@ void ack_bad_irq(unsigned int irq)
|
||||
|
||||
#define irq_stats(x) (&per_cpu(irq_stat, x))
|
||||
/*
|
||||
* /proc/interrupts printing:
|
||||
* /proc/interrupts printing for arch specific interrupts
|
||||
*/
|
||||
static int show_other_interrupts(struct seq_file *p, int prec)
|
||||
int arch_show_interrupts(struct seq_file *p, int prec)
|
||||
{
|
||||
int j;
|
||||
|
||||
@@ -122,59 +122,6 @@ static int show_other_interrupts(struct seq_file *p, int prec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int show_interrupts(struct seq_file *p, void *v)
|
||||
{
|
||||
unsigned long flags, any_count = 0;
|
||||
int i = *(loff_t *) v, j, prec;
|
||||
struct irqaction *action;
|
||||
struct irq_desc *desc;
|
||||
|
||||
if (i > nr_irqs)
|
||||
return 0;
|
||||
|
||||
for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
|
||||
j *= 10;
|
||||
|
||||
if (i == nr_irqs)
|
||||
return show_other_interrupts(p, prec);
|
||||
|
||||
/* print header */
|
||||
if (i == 0) {
|
||||
seq_printf(p, "%*s", prec + 8, "");
|
||||
for_each_online_cpu(j)
|
||||
seq_printf(p, "CPU%-8d", j);
|
||||
seq_putc(p, '\n');
|
||||
}
|
||||
|
||||
desc = irq_to_desc(i);
|
||||
if (!desc)
|
||||
return 0;
|
||||
|
||||
raw_spin_lock_irqsave(&desc->lock, flags);
|
||||
for_each_online_cpu(j)
|
||||
any_count |= kstat_irqs_cpu(i, j);
|
||||
action = desc->action;
|
||||
if (!action && !any_count)
|
||||
goto out;
|
||||
|
||||
seq_printf(p, "%*d: ", prec, i);
|
||||
for_each_online_cpu(j)
|
||||
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
|
||||
seq_printf(p, " %8s", desc->irq_data.chip->name);
|
||||
seq_printf(p, "-%-8s", desc->name);
|
||||
|
||||
if (action) {
|
||||
seq_printf(p, " %s", action->name);
|
||||
while ((action = action->next) != NULL)
|
||||
seq_printf(p, ", %s", action->name);
|
||||
}
|
||||
|
||||
seq_putc(p, '\n');
|
||||
out:
|
||||
raw_spin_unlock_irqrestore(&desc->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* /proc/stat helpers
|
||||
*/
|
||||
@@ -293,6 +240,7 @@ void fixup_irqs(void)
|
||||
static int warned;
|
||||
struct irq_desc *desc;
|
||||
struct irq_data *data;
|
||||
struct irq_chip *chip;
|
||||
|
||||
for_each_irq_desc(irq, desc) {
|
||||
int break_affinity = 0;
|
||||
@@ -307,10 +255,10 @@ void fixup_irqs(void)
|
||||
/* interrupt's are disabled at this point */
|
||||
raw_spin_lock(&desc->lock);
|
||||
|
||||
data = &desc->irq_data;
|
||||
data = irq_desc_get_irq_data(desc);
|
||||
affinity = data->affinity;
|
||||
if (!irq_has_action(irq) ||
|
||||
cpumask_equal(affinity, cpu_online_mask)) {
|
||||
cpumask_subset(affinity, cpu_online_mask)) {
|
||||
raw_spin_unlock(&desc->lock);
|
||||
continue;
|
||||
}
|
||||
@@ -327,16 +275,17 @@ void fixup_irqs(void)
|
||||
affinity = cpu_all_mask;
|
||||
}
|
||||
|
||||
if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_mask)
|
||||
data->chip->irq_mask(data);
|
||||
chip = irq_data_get_irq_chip(data);
|
||||
if (!irqd_can_move_in_process_context(data) && chip->irq_mask)
|
||||
chip->irq_mask(data);
|
||||
|
||||
if (data->chip->irq_set_affinity)
|
||||
data->chip->irq_set_affinity(data, affinity, true);
|
||||
if (chip->irq_set_affinity)
|
||||
chip->irq_set_affinity(data, affinity, true);
|
||||
else if (!(warned++))
|
||||
set_affinity = 0;
|
||||
|
||||
if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_unmask)
|
||||
data->chip->irq_unmask(data);
|
||||
if (!irqd_can_move_in_process_context(data) && chip->irq_unmask)
|
||||
chip->irq_unmask(data);
|
||||
|
||||
raw_spin_unlock(&desc->lock);
|
||||
|
||||
@@ -368,10 +317,11 @@ void fixup_irqs(void)
|
||||
irq = __this_cpu_read(vector_irq[vector]);
|
||||
|
||||
desc = irq_to_desc(irq);
|
||||
data = &desc->irq_data;
|
||||
data = irq_desc_get_irq_data(desc);
|
||||
chip = irq_data_get_irq_chip(data);
|
||||
raw_spin_lock(&desc->lock);
|
||||
if (data->chip->irq_retrigger)
|
||||
data->chip->irq_retrigger(data);
|
||||
if (chip->irq_retrigger)
|
||||
chip->irq_retrigger(data);
|
||||
raw_spin_unlock(&desc->lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ static irqreturn_t math_error_irq(int cpl, void *dev_id)
|
||||
static struct irqaction fpu_irq = {
|
||||
.handler = math_error_irq,
|
||||
.name = "fpu",
|
||||
.flags = IRQF_NO_THREAD,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -80,6 +81,7 @@ static struct irqaction fpu_irq = {
|
||||
static struct irqaction irq2 = {
|
||||
.handler = no_action,
|
||||
.name = "cascade",
|
||||
.flags = IRQF_NO_THREAD,
|
||||
};
|
||||
|
||||
DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
|
||||
@@ -110,7 +112,7 @@ void __init init_ISA_irqs(void)
|
||||
legacy_pic->init(0);
|
||||
|
||||
for (i = 0; i < legacy_pic->nr_legacy_irqs; i++)
|
||||
set_irq_chip_and_handler_name(i, chip, handle_level_irq, name);
|
||||
irq_set_chip_and_handler_name(i, chip, handle_level_irq, name);
|
||||
}
|
||||
|
||||
void __init init_IRQ(void)
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include <asm/mtrr.h>
|
||||
#include <asm/mwait.h>
|
||||
#include <asm/apic.h>
|
||||
#include <asm/io_apic.h>
|
||||
#include <asm/setup.h>
|
||||
#include <asm/uv/uv.h>
|
||||
#include <linux/mc146818rtc.h>
|
||||
@@ -927,6 +928,14 @@ int __cpuinit native_cpu_up(unsigned int cpu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* arch_disable_smp_support() - disables SMP support for x86 at runtime
|
||||
*/
|
||||
void arch_disable_smp_support(void)
|
||||
{
|
||||
disable_ioapic_support();
|
||||
}
|
||||
|
||||
/*
|
||||
* Fall back to non SMP mode after errors.
|
||||
*
|
||||
@@ -1027,7 +1036,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
|
||||
"(tell your hw vendor)\n");
|
||||
}
|
||||
smpboot_clear_io_apic();
|
||||
arch_disable_smp_support();
|
||||
disable_ioapic_support();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -847,7 +847,7 @@ static void __init lguest_init_IRQ(void)
|
||||
void lguest_setup_irq(unsigned int irq)
|
||||
{
|
||||
irq_alloc_desc_at(irq, 0);
|
||||
set_irq_chip_and_handler_name(irq, &lguest_irq_controller,
|
||||
irq_set_chip_and_handler_name(irq, &lguest_irq_controller,
|
||||
handle_level_irq, "level");
|
||||
}
|
||||
|
||||
@@ -995,7 +995,7 @@ static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
|
||||
static void lguest_time_init(void)
|
||||
{
|
||||
/* Set up the timer interrupt (0) to go to our simple timer routine */
|
||||
set_irq_handler(0, lguest_time_irq);
|
||||
irq_set_handler(0, lguest_time_irq);
|
||||
|
||||
clocksource_register(&lguest_clock);
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
|
||||
unsigned long mmr_offset, int limit)
|
||||
{
|
||||
const struct cpumask *eligible_cpu = cpumask_of(cpu);
|
||||
struct irq_cfg *cfg = get_irq_chip_data(irq);
|
||||
struct irq_cfg *cfg = irq_get_chip_data(irq);
|
||||
unsigned long mmr_value;
|
||||
struct uv_IO_APIC_route_entry *entry;
|
||||
int mmr_pnode, err;
|
||||
@@ -148,7 +148,7 @@ arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
|
||||
else
|
||||
irq_set_status_flags(irq, IRQ_MOVE_PCNTXT);
|
||||
|
||||
set_irq_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
|
||||
irq_set_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
|
||||
irq_name);
|
||||
|
||||
mmr_value = 0;
|
||||
|
||||
@@ -569,11 +569,13 @@ out_unlock:
|
||||
static struct irqaction master_action = {
|
||||
.handler = piix4_master_intr,
|
||||
.name = "PIIX4-8259",
|
||||
.flags = IRQF_NO_THREAD,
|
||||
};
|
||||
|
||||
static struct irqaction cascade_action = {
|
||||
.handler = no_action,
|
||||
.name = "cascade",
|
||||
.flags = IRQF_NO_THREAD,
|
||||
};
|
||||
|
||||
static inline void set_piix4_virtual_irq_type(void)
|
||||
@@ -606,7 +608,7 @@ static void __init visws_pre_intr_init(void)
|
||||
chip = &cobalt_irq_type;
|
||||
|
||||
if (chip)
|
||||
set_irq_chip(i, chip);
|
||||
irq_set_chip(i, chip);
|
||||
}
|
||||
|
||||
setup_irq(CO_IRQ_8259, &master_action);
|
||||
|
||||
@@ -674,7 +674,7 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
|
||||
|
||||
irq_info[irq] = mk_pirq_info(0, pirq, 0, vector);
|
||||
pirq_to_irq[pirq] = irq;
|
||||
ret = set_irq_msi(irq, msidesc);
|
||||
ret = irq_set_msi_desc(irq, msidesc);
|
||||
if (ret < 0)
|
||||
goto error_irq;
|
||||
out:
|
||||
|
||||
+56
-19
@@ -14,6 +14,8 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hrtimer.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
@@ -56,6 +58,7 @@
|
||||
* irq line disabled until the threaded handler has been run.
|
||||
* IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
|
||||
* IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
|
||||
* IRQF_NO_THREAD - Interrupt cannot be threaded
|
||||
*/
|
||||
#define IRQF_DISABLED 0x00000020
|
||||
#define IRQF_SAMPLE_RANDOM 0x00000040
|
||||
@@ -68,22 +71,9 @@
|
||||
#define IRQF_ONESHOT 0x00002000
|
||||
#define IRQF_NO_SUSPEND 0x00004000
|
||||
#define IRQF_FORCE_RESUME 0x00008000
|
||||
#define IRQF_NO_THREAD 0x00010000
|
||||
|
||||
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)
|
||||
|
||||
/*
|
||||
* Bits used by threaded handlers:
|
||||
* IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
|
||||
* IRQTF_DIED - handler thread died
|
||||
* IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
|
||||
* IRQTF_AFFINITY - irq thread is requested to adjust affinity
|
||||
*/
|
||||
enum {
|
||||
IRQTF_RUNTHREAD,
|
||||
IRQTF_DIED,
|
||||
IRQTF_WARNED,
|
||||
IRQTF_AFFINITY,
|
||||
};
|
||||
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
|
||||
|
||||
/*
|
||||
* These values can be returned by request_any_context_irq() and
|
||||
@@ -111,6 +101,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
|
||||
* @thread_fn: interupt handler function for threaded interrupts
|
||||
* @thread: thread pointer for threaded interrupts
|
||||
* @thread_flags: flags related to @thread
|
||||
* @thread_mask: bitmask for keeping track of @thread activity
|
||||
*/
|
||||
struct irqaction {
|
||||
irq_handler_t handler;
|
||||
@@ -121,6 +112,7 @@ struct irqaction {
|
||||
irq_handler_t thread_fn;
|
||||
struct task_struct *thread;
|
||||
unsigned long thread_flags;
|
||||
unsigned long thread_mask;
|
||||
const char *name;
|
||||
struct proc_dir_entry *dir;
|
||||
} ____cacheline_internodealigned_in_smp;
|
||||
@@ -241,6 +233,35 @@ extern int irq_can_set_affinity(unsigned int irq);
|
||||
extern int irq_select_affinity(unsigned int irq);
|
||||
|
||||
extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
|
||||
|
||||
/**
|
||||
* struct irq_affinity_notify - context for notification of IRQ affinity changes
|
||||
* @irq: Interrupt to which notification applies
|
||||
* @kref: Reference count, for internal use
|
||||
* @work: Work item, for internal use
|
||||
* @notify: Function to be called on change. This will be
|
||||
* called in process context.
|
||||
* @release: Function to be called on release. This will be
|
||||
* called in process context. Once registered, the
|
||||
* structure must only be freed when this function is
|
||||
* called or later.
|
||||
*/
|
||||
struct irq_affinity_notify {
|
||||
unsigned int irq;
|
||||
struct kref kref;
|
||||
struct work_struct work;
|
||||
void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
|
||||
void (*release)(struct kref *ref);
|
||||
};
|
||||
|
||||
extern int
|
||||
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
|
||||
|
||||
static inline void irq_run_affinity_notifiers(void)
|
||||
{
|
||||
flush_scheduled_work();
|
||||
}
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
|
||||
static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
|
||||
@@ -256,7 +277,7 @@ static inline int irq_can_set_affinity(unsigned int irq)
|
||||
static inline int irq_select_affinity(unsigned int irq) { return 0; }
|
||||
|
||||
static inline int irq_set_affinity_hint(unsigned int irq,
|
||||
const struct cpumask *m)
|
||||
const struct cpumask *m)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -315,16 +336,24 @@ static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long
|
||||
}
|
||||
|
||||
/* IRQ wakeup (PM) control: */
|
||||
extern int set_irq_wake(unsigned int irq, unsigned int on);
|
||||
extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
/* Please do not use: Use the replacement functions instead */
|
||||
static inline int set_irq_wake(unsigned int irq, unsigned int on)
|
||||
{
|
||||
return irq_set_irq_wake(irq, on);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int enable_irq_wake(unsigned int irq)
|
||||
{
|
||||
return set_irq_wake(irq, 1);
|
||||
return irq_set_irq_wake(irq, 1);
|
||||
}
|
||||
|
||||
static inline int disable_irq_wake(unsigned int irq)
|
||||
{
|
||||
return set_irq_wake(irq, 0);
|
||||
return irq_set_irq_wake(irq, 0);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_GENERIC_HARDIRQS */
|
||||
@@ -354,6 +383,13 @@ static inline int disable_irq_wake(unsigned int irq)
|
||||
}
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
|
||||
#ifdef CONFIG_IRQ_FORCED_THREADING
|
||||
extern bool force_irqthreads;
|
||||
#else
|
||||
#define force_irqthreads (0)
|
||||
#endif
|
||||
|
||||
#ifndef __ARCH_SET_SOFTIRQ_PENDING
|
||||
#define set_softirq_pending(x) (local_softirq_pending() = (x))
|
||||
#define or_softirq_pending(x) (local_softirq_pending() |= (x))
|
||||
@@ -653,6 +689,7 @@ static inline void init_irq_proc(void)
|
||||
|
||||
struct seq_file;
|
||||
int show_interrupts(struct seq_file *p, void *v);
|
||||
int arch_show_interrupts(struct seq_file *p, int prec);
|
||||
|
||||
extern int early_irq_init(void);
|
||||
extern int arch_probe_nr_irqs(void);
|
||||
|
||||
+297
-69
File diff suppressed because it is too large
Load Diff
+73
-5
@@ -8,6 +8,7 @@
|
||||
* For now it's included from <linux/irq.h>
|
||||
*/
|
||||
|
||||
struct irq_affinity_notify;
|
||||
struct proc_dir_entry;
|
||||
struct timer_rand_state;
|
||||
/**
|
||||
@@ -18,13 +19,16 @@ struct timer_rand_state;
|
||||
* @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
|
||||
* @action: the irq action chain
|
||||
* @status: status information
|
||||
* @core_internal_state__do_not_mess_with_it: core internal status information
|
||||
* @depth: disable-depth, for nested irq_disable() calls
|
||||
* @wake_depth: enable depth, for multiple set_irq_wake() callers
|
||||
* @irq_count: stats field to detect stalled irqs
|
||||
* @last_unhandled: aging timer for unhandled count
|
||||
* @irqs_unhandled: stats field for spurious unhandled interrupts
|
||||
* @lock: locking for SMP
|
||||
* @affinity_notify: context for notification of affinity changes
|
||||
* @pending_mask: pending rebalanced interrupts
|
||||
* @threads_oneshot: bitfield to handle shared oneshot threads
|
||||
* @threads_active: number of irqaction threads currently running
|
||||
* @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
|
||||
* @dir: /proc/irq/ procfs entry
|
||||
@@ -45,6 +49,7 @@ struct irq_desc {
|
||||
struct {
|
||||
unsigned int irq;
|
||||
unsigned int node;
|
||||
unsigned int pad_do_not_even_think_about_it;
|
||||
struct irq_chip *chip;
|
||||
void *handler_data;
|
||||
void *chip_data;
|
||||
@@ -59,9 +64,16 @@ struct irq_desc {
|
||||
struct timer_rand_state *timer_rand_state;
|
||||
unsigned int __percpu *kstat_irqs;
|
||||
irq_flow_handler_t handle_irq;
|
||||
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
|
||||
irq_preflow_handler_t preflow_handler;
|
||||
#endif
|
||||
struct irqaction *action; /* IRQ action list */
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
unsigned int status_use_accessors;
|
||||
#else
|
||||
unsigned int status; /* IRQ status */
|
||||
|
||||
#endif
|
||||
unsigned int core_internal_state__do_not_mess_with_it;
|
||||
unsigned int depth; /* nested irq disables */
|
||||
unsigned int wake_depth; /* nested wake enables */
|
||||
unsigned int irq_count; /* For detecting broken IRQs */
|
||||
@@ -70,10 +82,12 @@ struct irq_desc {
|
||||
raw_spinlock_t lock;
|
||||
#ifdef CONFIG_SMP
|
||||
const struct cpumask *affinity_hint;
|
||||
struct irq_affinity_notify *affinity_notify;
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_var_t pending_mask;
|
||||
#endif
|
||||
#endif
|
||||
unsigned long threads_oneshot;
|
||||
atomic_t threads_active;
|
||||
wait_queue_head_t wait_for_threads;
|
||||
#ifdef CONFIG_PROC_FS
|
||||
@@ -95,10 +109,51 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
|
||||
#define get_irq_desc_chip(desc) ((desc)->irq_data.chip)
|
||||
#define get_irq_desc_chip_data(desc) ((desc)->irq_data.chip_data)
|
||||
#define get_irq_desc_data(desc) ((desc)->irq_data.handler_data)
|
||||
#define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc)
|
||||
static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
|
||||
{
|
||||
return &desc->irq_data;
|
||||
}
|
||||
|
||||
static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.chip;
|
||||
}
|
||||
|
||||
static inline void *irq_desc_get_chip_data(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.chip_data;
|
||||
}
|
||||
|
||||
static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.handler_data;
|
||||
}
|
||||
|
||||
static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
|
||||
{
|
||||
return desc->irq_data.msi_desc;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
static inline struct irq_chip *get_irq_desc_chip(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_chip(desc);
|
||||
}
|
||||
static inline void *get_irq_desc_data(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_handler_data(desc);
|
||||
}
|
||||
|
||||
static inline void *get_irq_desc_chip_data(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_chip_data(desc);
|
||||
}
|
||||
|
||||
static inline struct msi_desc *get_irq_desc_msi(struct irq_desc *desc)
|
||||
{
|
||||
return irq_desc_get_msi_desc(desc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Architectures call this to let the generic IRQ layer
|
||||
@@ -123,6 +178,7 @@ static inline int irq_has_action(unsigned int irq)
|
||||
return desc->action != NULL;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT
|
||||
static inline int irq_balancing_disabled(unsigned int irq)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
@@ -130,6 +186,7 @@ static inline int irq_balancing_disabled(unsigned int irq)
|
||||
desc = irq_to_desc(irq);
|
||||
return desc->status & IRQ_NO_BALANCING_MASK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* caller has locked the irq_desc and both params are valid */
|
||||
static inline void __set_irq_handler_unlocked(int irq,
|
||||
@@ -140,6 +197,17 @@ static inline void __set_irq_handler_unlocked(int irq,
|
||||
desc = irq_to_desc(irq);
|
||||
desc->handle_irq = handler;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
|
||||
static inline void
|
||||
__irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
|
||||
desc = irq_to_desc(irq);
|
||||
desc->preflow_handler = handler;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+29
-10
@@ -1,5 +1,6 @@
|
||||
# Select this to activate the generic irq options below
|
||||
config HAVE_GENERIC_HARDIRQS
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
if HAVE_GENERIC_HARDIRQS
|
||||
menu "IRQ subsystem"
|
||||
@@ -11,26 +12,44 @@ config GENERIC_HARDIRQS
|
||||
|
||||
# Select this to disable the deprecated stuff
|
||||
config GENERIC_HARDIRQS_NO_DEPRECATED
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
config GENERIC_HARDIRQS_NO_COMPAT
|
||||
bool
|
||||
|
||||
# Options selectable by the architecture code
|
||||
|
||||
# Make sparse irq Kconfig switch below available
|
||||
config HAVE_SPARSE_IRQ
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
# Enable the generic irq autoprobe mechanism
|
||||
config GENERIC_IRQ_PROBE
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
# Use the generic /proc/interrupts implementation
|
||||
config GENERIC_IRQ_SHOW
|
||||
bool
|
||||
|
||||
# Support for delayed migration from interrupt context
|
||||
config GENERIC_PENDING_IRQ
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
# Alpha specific irq affinity mechanism
|
||||
config AUTO_IRQ_AFFINITY
|
||||
def_bool n
|
||||
|
||||
config IRQ_PER_CPU
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
# Tasklet based software resend for pending interrupts on enable_irq()
|
||||
config HARDIRQS_SW_RESEND
|
||||
def_bool n
|
||||
bool
|
||||
|
||||
# Preflow handler support for fasteoi (sparc64)
|
||||
config IRQ_PREFLOW_FASTEOI
|
||||
bool
|
||||
|
||||
# Support forced irq threading
|
||||
config IRQ_FORCED_THREADING
|
||||
bool
|
||||
|
||||
config SPARSE_IRQ
|
||||
bool "Support sparse irq numbering"
|
||||
|
||||
+22
-32
@@ -17,7 +17,7 @@
|
||||
/*
|
||||
* Autodetection depends on the fact that any interrupt that
|
||||
* comes in on to an unassigned handler will get stuck with
|
||||
* "IRQ_WAITING" cleared and the interrupt disabled.
|
||||
* "IRQS_WAITING" cleared and the interrupt disabled.
|
||||
*/
|
||||
static DEFINE_MUTEX(probing_active);
|
||||
|
||||
@@ -32,7 +32,6 @@ unsigned long probe_irq_on(void)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
unsigned long mask = 0;
|
||||
unsigned int status;
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -46,13 +45,7 @@ unsigned long probe_irq_on(void)
|
||||
*/
|
||||
for_each_irq_desc_reverse(i, desc) {
|
||||
raw_spin_lock_irq(&desc->lock);
|
||||
if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
|
||||
/*
|
||||
* An old-style architecture might still have
|
||||
* the handle_bad_irq handler there:
|
||||
*/
|
||||
compat_irq_chip_set_default_handler(desc);
|
||||
|
||||
if (!desc->action && irq_settings_can_probe(desc)) {
|
||||
/*
|
||||
* Some chips need to know about probing in
|
||||
* progress:
|
||||
@@ -60,7 +53,7 @@ unsigned long probe_irq_on(void)
|
||||
if (desc->irq_data.chip->irq_set_type)
|
||||
desc->irq_data.chip->irq_set_type(&desc->irq_data,
|
||||
IRQ_TYPE_PROBE);
|
||||
desc->irq_data.chip->irq_startup(&desc->irq_data);
|
||||
irq_startup(desc);
|
||||
}
|
||||
raw_spin_unlock_irq(&desc->lock);
|
||||
}
|
||||
@@ -75,10 +68,12 @@ unsigned long probe_irq_on(void)
|
||||
*/
|
||||
for_each_irq_desc_reverse(i, desc) {
|
||||
raw_spin_lock_irq(&desc->lock);
|
||||
if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
|
||||
desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
|
||||
if (desc->irq_data.chip->irq_startup(&desc->irq_data))
|
||||
desc->status |= IRQ_PENDING;
|
||||
if (!desc->action && irq_settings_can_probe(desc)) {
|
||||
desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
|
||||
if (irq_startup(desc)) {
|
||||
irq_compat_set_pending(desc);
|
||||
desc->istate |= IRQS_PENDING;
|
||||
}
|
||||
}
|
||||
raw_spin_unlock_irq(&desc->lock);
|
||||
}
|
||||
@@ -93,13 +88,12 @@ unsigned long probe_irq_on(void)
|
||||
*/
|
||||
for_each_irq_desc(i, desc) {
|
||||
raw_spin_lock_irq(&desc->lock);
|
||||
status = desc->status;
|
||||
|
||||
if (status & IRQ_AUTODETECT) {
|
||||
if (desc->istate & IRQS_AUTODETECT) {
|
||||
/* It triggered already - consider it spurious. */
|
||||
if (!(status & IRQ_WAITING)) {
|
||||
desc->status = status & ~IRQ_AUTODETECT;
|
||||
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
|
||||
if (!(desc->istate & IRQS_WAITING)) {
|
||||
desc->istate &= ~IRQS_AUTODETECT;
|
||||
irq_shutdown(desc);
|
||||
} else
|
||||
if (i < 32)
|
||||
mask |= 1 << i;
|
||||
@@ -125,20 +119,18 @@ EXPORT_SYMBOL(probe_irq_on);
|
||||
*/
|
||||
unsigned int probe_irq_mask(unsigned long val)
|
||||
{
|
||||
unsigned int status, mask = 0;
|
||||
unsigned int mask = 0;
|
||||
struct irq_desc *desc;
|
||||
int i;
|
||||
|
||||
for_each_irq_desc(i, desc) {
|
||||
raw_spin_lock_irq(&desc->lock);
|
||||
status = desc->status;
|
||||
|
||||
if (status & IRQ_AUTODETECT) {
|
||||
if (i < 16 && !(status & IRQ_WAITING))
|
||||
if (desc->istate & IRQS_AUTODETECT) {
|
||||
if (i < 16 && !(desc->istate & IRQS_WAITING))
|
||||
mask |= 1 << i;
|
||||
|
||||
desc->status = status & ~IRQ_AUTODETECT;
|
||||
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
|
||||
desc->istate &= ~IRQS_AUTODETECT;
|
||||
irq_shutdown(desc);
|
||||
}
|
||||
raw_spin_unlock_irq(&desc->lock);
|
||||
}
|
||||
@@ -169,20 +161,18 @@ int probe_irq_off(unsigned long val)
|
||||
{
|
||||
int i, irq_found = 0, nr_of_irqs = 0;
|
||||
struct irq_desc *desc;
|
||||
unsigned int status;
|
||||
|
||||
for_each_irq_desc(i, desc) {
|
||||
raw_spin_lock_irq(&desc->lock);
|
||||
status = desc->status;
|
||||
|
||||
if (status & IRQ_AUTODETECT) {
|
||||
if (!(status & IRQ_WAITING)) {
|
||||
if (desc->istate & IRQS_AUTODETECT) {
|
||||
if (!(desc->istate & IRQS_WAITING)) {
|
||||
if (!nr_of_irqs)
|
||||
irq_found = i;
|
||||
nr_of_irqs++;
|
||||
}
|
||||
desc->status = status & ~IRQ_AUTODETECT;
|
||||
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
|
||||
desc->istate &= ~IRQS_AUTODETECT;
|
||||
irq_shutdown(desc);
|
||||
}
|
||||
raw_spin_unlock_irq(&desc->lock);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user