The patch titled genirq: cleanup: misc code cleanups has been removed from the -mm tree. Its filename is genirq-cleanup-misc-code-cleanups.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: genirq: cleanup: misc code cleanups From: Ingo Molnar <mingo@xxxxxxx> Assorted code cleanups to the generic IRQ code. Signed-off-by: Ingo Molnar <mingo@xxxxxxx> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/irq.h | 54 +++++++++++++++++++++++---------------- kernel/irq/autoprobe.c | 16 +++++------ kernel/irq/handle.c | 4 +- kernel/irq/manage.c | 29 ++++++++------------ kernel/irq/spurious.c | 23 +++++++++------- 5 files changed, 66 insertions(+), 60 deletions(-) diff -puN include/linux/irq.h~genirq-cleanup-misc-code-cleanups include/linux/irq.h --- a/include/linux/irq.h~genirq-cleanup-misc-code-cleanups +++ a/include/linux/irq.h @@ -1,5 +1,5 @@ -#ifndef __irq_h -#define __irq_h +#ifndef _LINUX_IRQ_H +#define _LINUX_IRQ_H /* * Please do not include this file in generic code. There is currently @@ -11,7 +11,7 @@ #include <linux/smp.h> -#if !defined(CONFIG_S390) +#ifndef CONFIG_S390 #include <linux/linkage.h> #include <linux/cache.h> @@ -33,7 +33,7 @@ #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ #define IRQ_LEVEL 64 /* IRQ level triggered */ #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ -#if defined(ARCH_HAS_IRQ_PER_CPU) +#ifdef ARCH_HAS_IRQ_PER_CPU # define IRQ_PER_CPU 256 /* IRQ is per CPU */ # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) #else @@ -45,7 +45,7 @@ * to describe about the low-level hardware. */ struct hw_interrupt_type { - const char * typename; + const char *typename; unsigned int (*startup)(unsigned int irq); void (*shutdown)(unsigned int irq); void (*enable)(unsigned int irq); @@ -80,7 +80,7 @@ typedef struct irq_desc { #ifdef CONFIG_SMP cpumask_t affinity; #endif -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) +#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) unsigned int move_irq; /* Flag need to re-target intr dest*/ #endif } ____cacheline_aligned irq_desc_t; @@ -89,9 +89,10 @@ extern irq_desc_t irq_desc [NR_IRQS]; #include <asm/hw_irq.h> /* the arch dependent stuff */ -extern int setup_irq(unsigned int irq, struct irqaction * new); +extern int setup_irq(unsigned int irq, struct irqaction *new); #ifdef CONFIG_GENERIC_HARDIRQS + #ifdef CONFIG_SMP static inline void set_native_irq_info(int irq, cpumask_t mask) { @@ -105,7 +106,7 @@ static inline void set_native_irq_info(i #ifdef CONFIG_SMP -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) +#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) extern cpumask_t pending_irq_cpumask[NR_IRQS]; void set_pending_irq(unsigned int irq, cpumask_t mask); @@ -127,7 +128,7 @@ static inline void set_irq_info(int irq, { } -#else // CONFIG_PCI_MSI +#else /* CONFIG_PCI_MSI */ static inline void move_irq(int irq) { @@ -138,26 +139,36 @@ static inline void set_irq_info(int irq, { set_native_irq_info(irq, mask); } -#endif // CONFIG_PCI_MSI -#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE +#endif /* CONFIG_PCI_MSI */ + +#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ + +static inline void move_irq(int irq) +{ +} + +static inline void move_native_irq(int irq) +{ +} + +static inline void set_pending_irq(unsigned int irq, cpumask_t mask) +{ +} -#define move_irq(x) -#define move_native_irq(x) -#define set_pending_irq(x,y) static inline void set_irq_info(int irq, cpumask_t mask) { set_native_irq_info(irq, mask); } -#endif // CONFIG_GENERIC_PENDING_IRQ +#endif /* CONFIG_GENERIC_PENDING_IRQ */ -#else // CONFIG_SMP +#else /* CONFIG_SMP */ #define move_irq(x) #define move_native_irq(x) -#endif // CONFIG_SMP +#endif /* CONFIG_SMP */ #ifdef CONFIG_IRQBALANCE extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); @@ -186,17 +197,16 @@ extern void init_irq_proc(void); #ifdef CONFIG_AUTO_IRQ_AFFINITY extern int select_smp_affinity(unsigned int irq); #else -static inline int -select_smp_affinity(unsigned int irq) +static inline int select_smp_affinity(unsigned int irq) { return 1; } #endif -#endif +#endif /* CONFIG_GENERIC_HARDIRQS */ extern hw_irq_controller no_irq_type; /* needed in every arch ? */ -#endif +#endif /* !CONFIG_S390 */ -#endif /* __irq_h */ +#endif /* _LINUX_IRQ_H */ diff -puN kernel/irq/autoprobe.c~genirq-cleanup-misc-code-cleanups kernel/irq/autoprobe.c --- a/kernel/irq/autoprobe.c~genirq-cleanup-misc-code-cleanups +++ a/kernel/irq/autoprobe.c @@ -27,7 +27,7 @@ static DEFINE_MUTEX(probing_active); */ unsigned long probe_irq_on(void) { - unsigned long val; + unsigned long mask; irq_desc_t *desc; unsigned int i; @@ -40,8 +40,8 @@ unsigned long probe_irq_on(void) desc = irq_desc + i; spin_lock_irq(&desc->lock); - if (!irq_desc[i].action) - irq_desc[i].chip->startup(i); + if (!desc->action) + desc->chip->startup(i); spin_unlock_irq(&desc->lock); } @@ -73,11 +73,11 @@ unsigned long probe_irq_on(void) /* * Now filter out any obviously spurious interrupts */ - val = 0; + mask = 0; for (i = 0; i < NR_IRQS; i++) { - irq_desc_t *desc = irq_desc + i; unsigned int status; + desc = irq_desc + i; spin_lock_irq(&desc->lock); status = desc->status; @@ -88,14 +88,13 @@ unsigned long probe_irq_on(void) desc->chip->shutdown(i); } else if (i < 32) - val |= 1 << i; + mask |= 1 << i; } spin_unlock_irq(&desc->lock); } - return val; + return mask; } - EXPORT_SYMBOL(probe_irq_on); /** @@ -184,6 +183,5 @@ int probe_irq_off(unsigned long val) return irq_found; } - EXPORT_SYMBOL(probe_irq_off); diff -puN kernel/irq/handle.c~genirq-cleanup-misc-code-cleanups kernel/irq/handle.c --- a/kernel/irq/handle.c~genirq-cleanup-misc-code-cleanups +++ a/kernel/irq/handle.c @@ -18,7 +18,7 @@ * Linux has a controller-independent interrupt architecture. * Every controller has a 'controller-template', that is used * by the main code to do the right thing. Each driver-visible - * interrupt source is transparently wired to the apropriate + * interrupt source is transparently wired to the appropriate * controller. Thus drivers need not be aware of the * interrupt-controller. * @@ -111,7 +111,7 @@ irqreturn_t handle_IRQ_event(unsigned in fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs) { irq_desc_t *desc = irq_desc + irq; - struct irqaction * action; + struct irqaction *action; unsigned int status; kstat_this_cpu.irqs[irq]++; diff -puN kernel/irq/manage.c~genirq-cleanup-misc-code-cleanups kernel/irq/manage.c --- a/kernel/irq/manage.c~genirq-cleanup-misc-code-cleanups +++ a/kernel/irq/manage.c @@ -40,7 +40,6 @@ void synchronize_irq(unsigned int irq) while (desc->status & IRQ_INPROGRESS) cpu_relax(); } - EXPORT_SYMBOL(synchronize_irq); #endif @@ -71,7 +70,6 @@ void disable_irq_nosync(unsigned int irq } spin_unlock_irqrestore(&desc->lock, flags); } - EXPORT_SYMBOL(disable_irq_nosync); /** @@ -97,7 +95,6 @@ void disable_irq(unsigned int irq) if (desc->action) synchronize_irq(irq); } - EXPORT_SYMBOL(disable_irq); /** @@ -139,7 +136,6 @@ void enable_irq(unsigned int irq) } spin_unlock_irqrestore(&desc->lock, flags); } - EXPORT_SYMBOL(enable_irq); /* @@ -166,7 +162,7 @@ int can_request_irq(unsigned int irq, un * Internal function to register an irqaction - typically used to * allocate special interrupts that are part of the architecture. */ -int setup_irq(unsigned int irq, struct irqaction * new) +int setup_irq(unsigned int irq, struct irqaction *new) { struct irq_desc *desc = irq_desc + irq; struct irqaction *old, **p; @@ -198,9 +194,10 @@ int setup_irq(unsigned int irq, struct i /* * The following block of code has to be executed atomically */ - spin_lock_irqsave(&desc->lock,flags); + spin_lock_irqsave(&desc->lock, flags); p = &desc->action; - if ((old = *p) != NULL) { + old = *p; + if (old) { /* Can't share interrupts unless both agree to */ if (!(old->flags & new->flags & SA_SHIRQ)) goto mismatch; @@ -233,7 +230,7 @@ int setup_irq(unsigned int irq, struct i else desc->chip->enable(irq); } - spin_unlock_irqrestore(&desc->lock,flags); + spin_unlock_irqrestore(&desc->lock, flags); new->irq = irq; register_irq_proc(irq); @@ -276,10 +273,10 @@ void free_irq(unsigned int irq, void *de return; desc = irq_desc + irq; - spin_lock_irqsave(&desc->lock,flags); + spin_lock_irqsave(&desc->lock, flags); p = &desc->action; for (;;) { - struct irqaction * action = *p; + struct irqaction *action = *p; if (action) { struct irqaction **pp = p; @@ -304,7 +301,7 @@ void free_irq(unsigned int irq, void *de else desc->chip->disable(irq); } - spin_unlock_irqrestore(&desc->lock,flags); + spin_unlock_irqrestore(&desc->lock, flags); unregister_handler_proc(irq, action); /* Make sure it's not being used on another CPU */ @@ -312,12 +309,11 @@ void free_irq(unsigned int irq, void *de kfree(action); return; } - printk(KERN_ERR "Trying to free free IRQ%d\n",irq); - spin_unlock_irqrestore(&desc->lock,flags); + printk(KERN_ERR "Trying to free free IRQ%d\n", irq); + spin_unlock_irqrestore(&desc->lock, flags); return; } } - EXPORT_SYMBOL(free_irq); /** @@ -351,9 +347,9 @@ EXPORT_SYMBOL(free_irq); */ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long irqflags, const char * devname, void *dev_id) + unsigned long irqflags, const char *devname, void *dev_id) { - struct irqaction * action; + struct irqaction *action; int retval; /* @@ -388,6 +384,5 @@ int request_irq(unsigned int irq, return retval; } - EXPORT_SYMBOL(request_irq); diff -puN kernel/irq/spurious.c~genirq-cleanup-misc-code-cleanups kernel/irq/spurious.c --- a/kernel/irq/spurious.c~genirq-cleanup-misc-code-cleanups +++ a/kernel/irq/spurious.c @@ -16,22 +16,20 @@ static int irqfixup __read_mostly; /* * Recovery handler for misrouted interrupts. */ - static int misrouted_irq(int irq, struct pt_regs *regs) { int i; - irq_desc_t *desc; int ok = 0; int work = 0; /* Did we do work for a real IRQ */ - for(i = 1; i < NR_IRQS; i++) { + for (i = 1; i < NR_IRQS; i++) { + struct irq_desc *desc = irq_desc + i; struct irqaction *action; if (i == irq) /* Already tried */ continue; - desc = &irq_desc[i]; + spin_lock(&desc->lock); - action = desc->action; /* Already running on another processor */ if (desc->status & IRQ_INPROGRESS) { /* @@ -45,7 +43,9 @@ static int misrouted_irq(int irq, struct } /* Honour the normal IRQ locking */ desc->status |= IRQ_INPROGRESS; + action = desc->action; spin_unlock(&desc->lock); + while (action) { /* Only shared IRQ handlers are safe to call */ if (action->flags & SA_SHIRQ) { @@ -62,9 +62,8 @@ static int misrouted_irq(int irq, struct /* * While we were looking for a fixup someone queued a real - * IRQ clashing with our walk + * IRQ clashing with our walk: */ - while ((desc->status & IRQ_PENDING) && action) { /* * Perform real IRQ processing for the IRQ we deferred @@ -80,7 +79,7 @@ static int misrouted_irq(int irq, struct * If we did actual work for the real IRQ line we must let the * IRQ controller clean up too */ - if(work) + if (work) desc->chip->end(i); spin_unlock(&desc->lock); } @@ -113,6 +112,7 @@ __report_bad_irq(unsigned int irq, irq_d } dump_stack(); printk(KERN_ERR "handlers:\n"); + action = desc->action; while (action) { printk(KERN_ERR "[<%p>]", action->handler); @@ -123,7 +123,8 @@ __report_bad_irq(unsigned int irq, irq_d } } -static void report_bad_irq(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret) +static void +report_bad_irq(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret) { static int count = 100; @@ -134,7 +135,7 @@ static void report_bad_irq(unsigned int } void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret, - struct pt_regs *regs) + struct pt_regs *regs) { if (unlikely(action_ret != IRQ_HANDLED)) { desc->irqs_unhandled++; @@ -177,6 +178,7 @@ int __init noirqdebug_setup(char *str) { noirqdebug = 1; printk(KERN_INFO "IRQ lockup detection disabled\n"); + return 1; } @@ -187,6 +189,7 @@ static int __init irqfixup_setup(char *s irqfixup = 1; printk(KERN_WARNING "Misrouted IRQ fixup support enabled.\n"); printk(KERN_WARNING "This may impact system performance.\n"); + return 1; } _ Patches currently in -mm which might be from mingo@xxxxxxx are origin.patch genirq-add-irq-chip-support-fasteoi-handler-handle-interrupt-disabling.patch disable-debugging-version-of-write_lock.patch cpu_relax-use-in-acpi-lock-fix.patch acpi_srat-needs-acpi.patch genirq-rename-desc-handler-to-desc-chip-ia64-fix-2.patch lock-validator-fix-ns83820c-irq-flags-bug.patch revert-gregkh-pci-pci-test-that-drivers-properly-call-pci_set_master.patch cond_resched-fix.patch sched-clean-up-fallout-of-recent-changes.patch sched-clean-up-fallout-of-recent-changes-fix.patch sched-cleanup-remove-task_t-convert-to-struct-task_struct.patch sched-cleanup-convert-schedc-internal-typedefs-to-struct.patch sched-fix-bug-in-__migrate_task.patch sched-add-above-background-load-function.patch mm-implement-swap-prefetching.patch sched-cleanup-remove-task_t-convert-to-struct-task_struct-prefetch.patch lockdep-floppyc-irq-release-fix.patch lockdep-console_init-after-local_irq_enable.patch lockdep-add-is_module_address.patch lockdep-add-print_ip_sym.patch lockdep-add-per_cpu_offset.patch lockdep-add-disable-enable_irq_lockdep-api.patch lockdep-add-local_irq_enable_in_hardirq-api.patch lockdep-add-declare_completion_onstack-api.patch lockdep-clean-up-rwsems.patch lockdep-remove-rwsem_debug-remnants.patch lockdep-rename-debug_warn_on.patch lockdep-remove-debug_bug_on.patch lockdep-remove-mutex-deadlock-checking-code.patch lockdep-better-lock-debugging.patch lockdep-mutex-section-binutils-workaround.patch lockdep-locking-init-debugging-improvement.patch lockdep-beautify-x86_64-stacktraces.patch lockdep-x86_64-document-stack-frame-internals.patch lockdep-i386-remove-multi-entry-backtraces.patch lockdep-stacktrace-subsystem-core.patch lockdep-s390-config_frame_pointer-support.patch lockdep-stacktrace-subsystem-i386-support.patch lockdep-stacktrace-subsystem-x86_64-support.patch lockdep-stacktrace-subsystem-s390-support.patch lockdep-irqtrace-subsystem-core.patch lockdep-irqtrace-subsystem-docs.patch lockdep-irqtrace-subsystem-i386-support.patch lockdep-irqtrace-cleanup-of-include-asm-i386-irqflagsh.patch lockdep-irqtrace-subsystem-x86_64-support.patch lockdep-irqtrace-cleanup-of-include-asm-x86_64-irqflagsh.patch lockdep-irqtrace-subsystem-s390-support.patch lockdep-locking-api-self-tests.patch lockdep-core.patch lockdep-design-docs.patch lockdep-procfs.patch lockdep-prove-rwsem-locking-correctness.patch lockdep-prove-spinlock-rwlock-locking-correctness.patch lockdep-prove-mutex-locking-correctness.patch lockdep-kconfig.patch lockdep-print-all-lock-classes-on-sysrq-d.patch lockdep-x86_64-early-init.patch lockdep-x86-smp-alternatives-workaround.patch lockdep-do-not-recurse-in-printk.patch lockdep-fix-rt_hash_lock_sz.patch lockdep-s390-turn-validator-off-in-machine-check-handler.patch lockdep-enable-on-i386.patch lockdep-enable-on-x86_64.patch lockdep-enable-on-s390.patch lockdep-annotate-direct-io.patch lockdep-annotate-serial.patch lockdep-annotate-dcache.patch lockdep-annotate-i_mutex.patch lockdep-annotate-futex.patch lockdep-annotate-genirq.patch lockdep-annotate-waitqueues.patch lockdep-annotate-mm.patch lockdep-annotate-serio.patch lockdep-annotate-skb_queue_head_init.patch lockdep-annotate-timer-base-locks.patch lockdep-annotate-scheduler-runqueue-locks.patch lockdep-annotate-hrtimer-base-locks.patch lockdep-annotate-sock_lock_init.patch lockdep-annotate-af_unix-locking.patch lockdep-annotate-bh_lock_sock.patch lockdep-annotate-ieee1394-skb-queue-head-locking.patch lockdep-annotate-mmap_sem.patch lockdep-annotate-sunrpc-code.patch lockdep-annotate-ntfs-locking-rules.patch lockdep-annotate-the-quota-code.patch lockdep-annotate-usbfs.patch lockdep-annotate-sound-core-seq-seq_portsc.patch lockdep-annotate-sound-core-seq-seq_devicec.patch lockdep-annotate-8390c-disable_irq.patch lockdep-annotate-3c59xc-disable_irq.patch lockdep-annotate-forcedethc-disable_irq.patch lockdep-annotate-enable_in_hardirq.patch lockdep-annotate-on-stack-completions.patch lockdep-annotate-qeth-driver.patch lockdep-annotate-s_lock.patch lockdep-annotate-sb-s_umount.patch lockdep-annotate-slab-code.patch lockdep-annotate-blkdev-nesting.patch lockdep-annotate-vlan-net-device-as-being-a-special-class.patch lockdep-annotate-on-stack-completions-mmc.patch lockdep-irqtrace-subsystem-move-account_system_vtime-calls-into-kernel-softirqc.patch lockdep-special-s390-print_symbol-version.patch genirq-convert-the-x86_64-architecture-to-irq-chips.patch genirq-add-chip-eoi-fastack-fasteoi-x86_64.patch genirq-convert-the-i386-architecture-to-irq-chips.patch genirq-convert-the-i386-architecture-to-irq-chips-fix-2.patch genirq-add-chip-eoi-fastack-fasteoi-x86.patch genirq-irq-convert-the-move_irq-flag-from-a-32bit-word-to-a-single-bit.patch genirq-irq-add-moved_masked_irq.patch genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch genirq-msi-simplify-msi-enable-and-disable.patch genirq-msi-simplify-msi-enable-and-disable-fix.patch genirq-msi-make-the-msi-boolean-tests-return-either-0-or-1.patch genirq-msi-implement-helper-functions-read_msi_msg-and-write_msi_msg.patch genirq-msi-refactor-the-msi_ops.patch genirq-msi-simplify-the-msi-irq-limit-policy.patch genirq-irq-add-a-dynamic-irq-creation-api.patch genirq-ia64-irq-dynamic-irq-support.patch genirq-i386-irq-dynamic-irq-support.patch genirq-i386-irq-dynamic-irq-support-fix.patch genirq-x86_64-irq-dynamic-irq-support.patch genirq-msi-make-the-msi-code-irq-based-and-not-vector-based.patch genirq-x86_64-irq-move-msi-message-composition-into-io_apicc.patch genirq-i386-irq-move-msi-message-composition-into-io_apicc.patch genirq-msi-only-build-msi-apicc-on-ia64.patch genirq-x86_64-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector-fix.patch genirq-irq-remove-msi-hacks.patch genirq-irq-generalize-the-check-for-hardirq_bits.patch genirq-x86_64-irq-make-the-external-irq-handlers-report-their-vector-not-the-irq-number.patch genirq-x86_64-irq-make-vector_irq-per-cpu.patch genirq-x86_64-irq-kill-gsi_irq_sharing.patch genirq-x86_64-irq-kill-irq-compression.patch detect-atomic-counter-underflows.patch debug-shared-irqs.patch make-frame_pointer-default=y.patch mutex-subsystem-synchro-test-module.patch vdso-print-fatal-signals.patch vdso-improve-print_fatal_signals-support-by-adding-memory-maps.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html