aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/irq.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-03-12parisc: Validate online cpus in irq_set_affinity() callbacksThomas Gleixner1-1/+1
The [user space] interface does not filter out offline cpus. It merily guarantees that the mask contains at least one online cpu. So the selector in the irq chip implementation needs to make sure to pick only an online cpu because otherwise: Offline Core 1 Set affinity to 0xe (is valid due to online mask 0xd) cpumask_first will pick core 1, which is offline Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-parisc@vger.kernel.org Link: http://lkml.kernel.org/r/20140304203100.859489993@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2013-11-12Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds1-15/+2
Pull IRQ changes from Ingo Molnar: "The biggest change this cycle are the softirq/hardirq stack interaction and nesting fixes, cleanups and reorganizations from Frederic. This is the longer followup story to the softirq nesting fix that is already upstream (commit ded797547548: "irq: Force hardirq exit's softirq processing on its own stack")" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip: bcm2835: Convert to use IRQCHIP_DECLARE macro powerpc: Tell about irq stack coverage x86: Tell about irq stack coverage irq: Optimize softirq stack selection in irq exit irq: Justify the various softirq stack choices irq: Improve a bit softirq debugging irq: Optimize call to softirq on hardirq exit irq: Consolidate do_softirq() arch overriden implementations x86/irq: Correct comment about i8259 initialization
2013-11-07parisc: do not count IPI calls twiceHelge Deller1-4/+0
The number of IPI calls is already visible as per-cpu IPI irq counters in/proc/cpuinfo, so let's drop this additional counting. This partly reverts: cd85d55 parisc: more irq statistics in /proc/interrupts Signed-off-by: Helge Deller <deller@gmx.de>
2013-10-01irq: Consolidate do_softirq() arch overriden implementationsFrederic Weisbecker1-15/+2
All arch overriden implementations of do_softirq() share the following common code: disable irqs (to avoid races with the pending check), check if there are softirqs pending, then execute __do_softirq() on a specific stack. Consolidate the common parts such that archs only worry about the stack switch. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@au1.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Mackerras <paulus@au1.ibm.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: David S. Miller <davem@davemloft.net> Cc: Andrew Morton <akpm@linux-foundation.org>
2013-05-24parisc: fix irq stack on UP and SMPHelge Deller1-15/+26
The logic to detect if the irq stack was already in use with raw_spin_trylock() is wrong, because it will generate a "trylock failure on UP" error message with CONFIG_SMP=n and CONFIG_DEBUG_SPINLOCK=y. arch_spin_trylock() can't be used either since in the CONFIG_SMP=n case no atomic protection is given and we are reentrant here. A mutex didn't worked either and brings more overhead by turning off interrupts. So, let's use the fastest path for parisc which is the ldcw instruction. Counting how often the irq stack was used is pretty useless, so just drop this piece of code. Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-24parisc: show number of FPE and unaligned access handler calls in /proc/interruptsHelge Deller1-0/+8
Show number of floating point assistant and unaligned access fixup handler in /proc/interrupts file. Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-11parisc: implement irq stacks - part 2 (v2)Helge Deller1-14/+87
This patch fixes few build issues which were introduced with the last irq stack patch, e.g. the combination of stack overflow check and irq stack. Furthermore we now do proper locking and change the irq bh handler to use the irq stack as well. In /proc/interrupts one now can monitor how huge the irq stack has grown and how often it was preferred over the kernel stack. IRQ stacks are now enabled by default just to make sure that we not overflow the kernel stack by accident. Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-07parisc: tlb flush counting fix for SMP and UPHelge Deller1-3/+2
Fix up build error on UP and show correctly number of function call (ipi) irqs. Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-07parisc: more irq statistics in /proc/interruptsHelge Deller1-1/+47
Add framework and initial values for more fine grained statistics in /proc/interrupts. Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-07parisc: implement irq stacksHelge Deller1-0/+28
Default kernel stack size on parisc is 16k. During tests we found that the kernel stack can easily grow beyond 13k, which leaves 3k left for irq processing. This patch adds the possibility to activate an additional stack of 16k per CPU which is being used during irq processing. This implementation does not yet uses this irq stack for the irq bh handler. The assembler code for call_on_stack was heavily cleaned up by John David Anglin. CC: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
2013-05-07parisc: add kernel stack overflow checkHelge Deller1-2/+29
Add the CONFIG_DEBUG_STACKOVERFLOW config option to enable checks to detect kernel stack overflows. Stack overflows can not be detected reliable since we do not want to introduce too much overhead. Instead, during irq processing in do_cpu_irq_mask() we check kernel stack usage of the interrupted kernel process. Kernel threads can be easily detected by checking the value of space register 7 (sr7) which is zero when running inside the kernel. Since THREAD_SIZE is 16k and PAGE_SIZE is 4k, reduce the alignment of the init thread to the lower value (PAGE_SIZE) in the kernel vmlinux.ld.S linker script. Signed-off-by: Helge Deller <deller@gmx.de>
2013-02-20parisc: remove IRQF_DISABLEDPeter Zijlstra1-2/+2
People are playing odd games with IRQF_DISABLED, remove it. Its not reliable, since shared interrupt lines could disable it for you, and its possible and allowed for archs to disable IRQs to limit IRQ nesting. Therefore, simply mandate that _ALL_ IRQ handlers are run with IRQs disabled. [ This _should_ not break anything, since we've mandated that IRQ handlers _must_ be able to deal with this for a _long_ time ] IRQ handlers should be fast, no if buts and any other exceptions. We also have plenty instrumentation to find any offending IRQ latency sources. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Helge Deller <deller@gmx.de>
2013-01-07parisc: don't claim cpu irqs more than onceJohn David Anglin1-2/+4
The CPU irqs (timer and IPI) are not shared and only need to be claimed once. A mismatch error occurs if they are claimed more than once. Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Helge Deller <deller@gmx.de> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Signed-off-by: Helge Deller <deller@gmx.de>
2011-03-29parisc: Use irq_to_desc() in show_interrupts()Thomas Gleixner1-5/+6
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-29parisc: Convert irq namespaceThomas Gleixner1-6/+6
Convert to the new function names. Scripted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: linux-parisc@vger.kernel.org
2011-03-29parisc: Convert the final irq bitsThomas Gleixner1-7/+2
1) As promised in the comment, the core does not copy cpumask anymore when the arch code returns -EINVAL 2) Get the per cpu information from irq_data Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: linux-parisc@vger.kernel.org
2011-02-10[PARISC] Convert to new irq_chip functionsThomas Gleixner1-27/+37
Convert all the parisc driver interrupt handlers (dino, eisa, gsc, iosapic and superio) as well as the cpu interrupts. Prepare show_interrupts for GENERIC_HARDIRQS_NO_DEPRECATED and finally selects that Kconfig option [jejb: compile and testing fixes] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-09[PARISC] fix per-cpu flag problem in the cpu affinity checkersThomas Gleixner1-1/+1
The CHECK_IRQ_PER_CPU is wrong, it should be checking irq_to_desc(irq)->status not just irq. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@kernel.org Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-04parisc: convert the rest of the irq handlers to simple/percpuJames Bottomley1-4/+1
The generic conversion eliminates the spurious no_ack and no_end routines, converts all the cascaded handlers to handle_simple_irq() and makes iosapic use a modified handle_percpu_irq() to become the same as the CPU irq's. This isn't an essential change, but it eliminates the mask/unmask overhead of handle_level_irq(). Signed-off-by: James Bottomley <James.Bottomley@suse.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2010-12-04parisc: fix dino/gsc interruptsJames Bottomley1-1/+1
The essential problem we're currently having is that dino (and gsc) is a cascaded CPU interrupt. Under the old __do_IRQ() handler, our CPU interrupts basically did an ack followed by an end. In the new scheme, we replaced them with level handlers which do a mask, an ack and then an unmask (but no end). Instead, with the renaming of end to eoi, we actually want to call the percpu flow handlers, because they actually have all the characteristics we want. This patch does the conversion and gets my C360 booting again. Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2010-10-14parisc: kill __do_IRQKyle McMartin1-4/+0
Signed-off-by: Kyle McMartin <kyle@redhat.com>
2010-10-14parisc: convert iosapic interrupts to proper flow handlersKyle McMartin1-1/+1
Shift the ->end call (cpu eoi) from __do_IRQ into our unmask handler. Also nuke some redundant code. Signed-off-by: Kyle McMartin <kyle@redhat.com>
2010-10-14parisc: convert cpu interrupts to proper flow handlersKyle McMartin1-16/+9
Only major change is renaming functions to match the conventions expected by the generic irq code. Signed-off-by: Kyle McMartin <kyle@redhat.com>
2010-10-14parisc: lay groundwork for killing __do_IRQKyle McMartin1-10/+16
Use proper accessors and handlers for generic irq cleanups. We just call back into __do_IRQ through desc->handler now, and remove the explicit calls. Signed-off-by: Kyle McMartin <kyle@redhat.com>
2009-12-16parisc: Fixup last users of irq_chip->typenameThomas Gleixner1-2/+2
The typename member of struct irq_chip was kept for migration purposes and is obsolete since more than 2 years. Fix up the leftovers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-12-14genirq: Convert irq_desc.lock to raw_spinlockThomas Gleixner1-2/+2
Convert locks which cannot be sleeping locks in preempt-rt to raw_spinlocks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Ingo Molnar <mingo@elte.hu>
2009-09-28parisc: convert to asm-generic/hardirq.hChristoph Hellwig1-5/+0
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-07-03parisc: remove obsolete hw_interrupt_typeThomas Gleixner1-1/+1
The defines and typedefs (hw_interrupt_type, no_irq_type, irq_desc_t) have been kept around for migration reasons. After more than two years it's time to remove them finally. This patch cleans up one of the remaining users. When all such patches hit mainline we can remove the defines and typedefs finally. Impact: cleanup Convert the last remaining users to struct irq_chip and remove the define. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-07-03parisc: fix irq compile bugs in arch/parisc/kernel/irq.cHelge Deller1-4/+4
Fix miscompilation in arch/parisc/kernel/irq.c: 123: warning: passing arg 1 of `cpumask_setall' from incompatible pointer type 141: warning: passing arg 1 of `cpumask_copy' from incompatible pointer type 300: warning: passing arg 1 of `cpumask_copy' from incompatible pointer type 357: warning: passing arg 2 of `cpumask_copy' from incompatible pointer type Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-04-28irq: change ->set_affinity() to return statusYinghai Lu1-2/+4
according to Ingo, change set_affinity() in irq_chip should return int, because that way we can handle failure cases in a much cleaner way, in the genirq layer. v2: fix two typos [ Impact: extend API ] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: linux-arch@vger.kernel.org LKML-Reference: <49F654E9.4070809@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-02Merge branch 'rusty-cpumask-parisc' into pariscKyle McMartin1-2/+2
2009-03-27Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2Ingo Molnar1-1/+1
Conflicts: arch/parisc/kernel/irq.c arch/x86/include/asm/fixmap_64.h arch/x86/include/asm/setup.h kernel/irq/handle.c Semantic merge: arch/x86/include/asm/fixmap.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-03-16Merge branches 'irq/genirq' and 'linus' into irq/coreIngo Molnar1-8/+10
2009-03-16cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.: pariscRusty Russell1-2/+2
Impact: cleanup, futureproof In fact, all cpumask ops will only be valid (in general) for bit numbers < nr_cpu_ids. So use that instead of NR_CPUS in various places. This is always safe: no cpu number can be >= nr_cpu_ids, and nr_cpu_ids is initialized to NR_CPUS at boot. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Ingo Molnar <mingo@elte.hu>
2009-03-13parisc: convert cpu_check_affinity to new cpumask apiKyle McMartin1-5/+7
cpumask arg to the affinity function is now const, sort that out through the irq_desc implementations. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-03-13parisc: fix use of new cpumask api in irq.cKyle McMartin1-4/+4
cpumask api needs to take a pointer to irq_desc[cpu].affinity Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-03-13parisc: update parisc for new irq_descMike Travis1-4/+4
Impact: cleanup, update to new cpumask API Irq_desc.affinity and irq_desc.pending_mask are now cpumask_var_t's so access to them should be using the new cpumask API. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-01-12irq: update all arches for new irq_descMike Travis1-4/+4
Impact: cleanup, update to new cpumask API Irq_desc.affinity and irq_desc.pending_mask are now cpumask_var_t's so access to them should be using the new cpumask API. Signed-off-by: Mike Travis <travis@sgi.com>
2009-01-11sparseirq: use kstat_irqs_cpu insteadYinghai Lu1-1/+1
Impact: build fix Ingo Molnar wrote: > tip/arch/blackfin/kernel/irqchip.c: In function 'show_interrupts': > tip/arch/blackfin/kernel/irqchip.c:85: error: 'struct kernel_stat' has no member named 'irqs' > make[2]: *** [arch/blackfin/kernel/irqchip.o] Error 1 > make[2]: *** Waiting for unfinished jobs.... > So could move kstat_irqs array to irq_desc struct. (s390, m68k, sparc) are not touched yet, because they don't support genirq Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-01-05parisc: Replace NR_CPUS in parisc codeHelge Deller1-4/+5
parisc: Replace most arrays sized by NR_CPUS with percpu variables. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-01-05parisc: trivial fixesHelge Deller1-1/+1
trivial fixes: - use KERN_WARNING for printk() - use BUG_ON() instead of "if (xx) BUG();" Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca> -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2008-12-13cpumask: make irq_set_affinity() take a const struct cpumaskRusty Russell1-3/+3
Impact: change existing irq_chip API Not much point with gentle transition here: the struct irq_chip's setaffinity method signature needs to change. Fortunately, not widely used code, but hits a few architectures. Note: In irq_select_affinity() I save a temporary in by mangling irq_desc[irq].affinity directly. Ingo, does this break anything? (Folded in fix from KOSAKI Motohiro) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Grant Grundler <grundler@parisc-linux.org> Acked-by: Ingo Molnar <mingo@redhat.com> Cc: ralf@linux-mips.org Cc: grundler@parisc-linux.org Cc: jeremy@xensource.com Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
2007-12-06[PARISC] timer interrupt should not be IRQ_DISABLEDKyle McMartin1-1/+1
The timer interrupt had accidentally been marked IRQ_DISABLED since IRQ_PER_CPU had been OR-ed in, instead of set. This had been working by accident for quite a while. Commit c642b8391cf8efc3622cc97329a0f46e7cbb70b8 changed the behaviour of IRQ_PER_CPU interrupts, which previously weren't checked for IRQ_DISABLED. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2007-06-12[PARISC] remove global_ack_eiemGrant Grundler1-18/+8
Kudos to Thibaut Varene for spotting the (mis)use of appropriately named global_ack_eiem. This took a long time to figure out and both insight from myself, Kyle McMartin, and James Bottomley were required to narrow down which bit of code could have this race condition. The symptom was interrupts stopped getting delivered while some workload was generating IO interrupts on two different CPUs. One of the interrupt sources would get masked off and stay unmasked. Problem was global_ack_eiem was accessed with read/modified/write sequence and not protected by a spinlock. PA-RISC doesn't need a global ack flag though. External Interrupts are _always_ delivered to a single CPU (except for "global broadcast interrupt" which AFAIK currently is not used.) So we don't have to worry about any given IRQ vector getting delivered to more than one CPU. Tested on a500 and rp34xx boxen. rsync to/from gsyprf11 (a500) would lock up the box since NIC (tg3) interrupt and SCSI (sym2) were on "opposite" CPUs (2 CPU system). Put them on the same CPU or apply this patch and 10GB of data would rsync completely. Please apply the following critical patch. thanks, grant Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Acked-by: Thibaut VARENE <T-Bone@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
2007-05-08Add IRQF_IRQPOLL flag on pariscBernhard Walle1-1/+1
Add IRQF_IRQPOLL to the timer interrupt on parisc. Signed-off-by: Bernhard Walle <bwalle@suse.de> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Matthew Wilcox <willy@debian.org> Cc: Grant Grundler <grundler@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-17[PARISC] use fls_long in irq.cKyle McMartin1-5/+1
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
2006-10-07[PARISC] Use set_irq_regsMatthew Wilcox1-0/+3
Actually set the irq_regs pointer. Signed-off-by: Matthew Wilcox <matthew@wil.cx>
2006-10-06Build fixes for struct pt_regs removalMatthew Wilcox1-3/+3
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
2006-10-04[PARISC] Allow nested interruptsJames Bottomley1-63/+86
Our prior mode of operation didn't allow nested interrupts because it makes the interrupt code much simpler. However, nested interrupts are better for latency. This code uses the EIEM register to simulate level interrupts and thus achieve nesting. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
2006-10-04[PARISC] Fix up parisc irq handling for genirq changesKyle McMartin1-1/+1
Clean up enough to get things compiling again in the interim. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>