<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/parisc/kernel/irq.c, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-09-30T09:13:08Z</updated>
<entry>
<title>parisc: Filter out spurious interrupts in PA-RISC irq handler</title>
<updated>2015-09-30T09:13:08Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2015-09-03T20:45:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=768cb8d9028cc71a8b3ecc6d2de9f02db09b044f'/>
<id>urn:sha1:768cb8d9028cc71a8b3ecc6d2de9f02db09b044f</id>
<content type='text'>
commit b1b4e435e4ef7de77f07bf2a42c8380b960c2d44 upstream.

When detecting a serial port on newer PA-RISC machines (with iosapic) we have a
long way to go to find the right IRQ line, registering it, then registering the
serial port and the irq handler for the serial port. During this phase spurious
interrupts for the serial port may happen which then crashes the kernel because
the action handler might not have been set up yet.

So, basically it's a race condition between the serial port hardware and the
CPU which sets up the necessary fields in the irq sructs. The main reason for
this race is, that we unmask the serial port irqs too early without having set
up everything properly before (which isn't easily possible because we need the
IRQ number to register the serial ports).

This patch is a work-around for this problem. It adds checks to the CPU irq
handler to verify if the IRQ action field has been initialized already. If not,
we just skip this interrupt (which isn't critical for a serial port at bootup).
The real fix would probably involve rewriting all PA-RISC specific IRQ code
(for CPU, IOSAPIC, GSC and EISA) to use IRQ domains with proper parenting of
the irq chips and proper irq enabling along this line.

This bug has been in the PA-RISC port since the beginning, but the crashes
happened very rarely with currently used hardware.  But on the latest machine
which I bought (a C8000 workstation), which uses the fastest CPUs (4 x PA8900,
1GHz) and which has the largest possible L1 cache size (64MB each), the kernel
crashed at every boot because of this race. So, without this patch the machine
would currently be unuseable.

For the record, here is the flow logic:
1. serial_init_chip() in 8250_gsc.c calls iosapic_serial_irq().
2. iosapic_serial_irq() calls txn_alloc_irq() to find the irq.
3. iosapic_serial_irq() calls cpu_claim_irq() to register the CPU irq
4. cpu_claim_irq() unmasks the CPU irq (which it shouldn't!)
5. serial_init_chip() then registers the 8250 port.
Problems:
- In step 4 the CPU irq shouldn't have been registered yet, but after step 5
- If serial irq happens between 4 and 5 have finished, the kernel will crash

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>parisc: fix irq stack on UP and SMP</title>
<updated>2013-05-24T21:29:01Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-24T21:27:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d96b51ec14650b490ab98e738bcc02309396e5bc'/>
<id>urn:sha1:d96b51ec14650b490ab98e738bcc02309396e5bc</id>
<content type='text'>
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 &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: show number of FPE and unaligned access handler calls in /proc/interrupts</title>
<updated>2013-05-24T20:35:26Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-18T19:35:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0c3be806a3fe7f4abdb0f7e7287addb55e73f35'/>
<id>urn:sha1:d0c3be806a3fe7f4abdb0f7e7287addb55e73f35</id>
<content type='text'>
Show number of floating point assistant and unaligned access fixup
handler in /proc/interrupts file.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: implement irq stacks - part 2 (v2)</title>
<updated>2013-05-11T19:10:15Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-10T21:24:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=416821d3d68164909b2cbcf398e4ba0797f5f8a2'/>
<id>urn:sha1:416821d3d68164909b2cbcf398e4ba0797f5f8a2</id>
<content type='text'>
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 &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: tlb flush counting fix for SMP and UP</title>
<updated>2013-05-07T21:44:04Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-07T21:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0fc537d1d655cdae69b489dbba46ad617cfc1373'/>
<id>urn:sha1:0fc537d1d655cdae69b489dbba46ad617cfc1373</id>
<content type='text'>
Fix up build error on UP and show correctly number of function call
(ipi) irqs.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: more irq statistics in /proc/interrupts</title>
<updated>2013-05-07T20:39:22Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-06T19:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd85d5514d5c4d7e78abac923fc032457d0c5091'/>
<id>urn:sha1:cd85d5514d5c4d7e78abac923fc032457d0c5091</id>
<content type='text'>
Add framework and initial values for more fine grained statistics in
/proc/interrupts.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: implement irq stacks</title>
<updated>2013-05-07T20:30:35Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-07T20:25:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=200c880420a2c02a0899120ce52d801fad705b90'/>
<id>urn:sha1:200c880420a2c02a0899120ce52d801fad705b90</id>
<content type='text'>
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 &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: add kernel stack overflow check</title>
<updated>2013-05-07T19:34:07Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2013-05-07T19:28:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9372450cc22d185f708e5cc3557cf991be4b7dc5'/>
<id>urn:sha1:9372450cc22d185f708e5cc3557cf991be4b7dc5</id>
<content type='text'>
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 &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: remove IRQF_DISABLED</title>
<updated>2013-02-20T21:50:26Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2009-03-02T09:45:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b54cb2332e387f29c65f19f3620e5c812c89a328'/>
<id>urn:sha1:b54cb2332e387f29c65f19f3620e5c812c89a328</id>
<content type='text'>
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 &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: don't claim cpu irqs more than once</title>
<updated>2013-01-07T22:06:23Z</updated>
<author>
<name>John David Anglin</name>
</author>
<published>2011-06-12T01:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cac1f12b9f7409510a5abcf3eaecc2c56b75242a'/>
<id>urn:sha1:cac1f12b9f7409510a5abcf3eaecc2c56b75242a</id>
<content type='text'>
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 &lt;dave.anglin@nrc-cnrc.gc.ca&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
</feed>
