08 Sep, 2015

1 commit

  • 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

    Helge Deller
     

01 Aug, 2015

1 commit

  • Use access helper irq_data_get_affinity_mask() to hide implementation
    details of struct irq_desc.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Bjorn Helgaas
    Cc: Benjamin Herrenschmidt
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Link: http://lkml.kernel.org/r/1433145945-789-24-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

05 Mar, 2015

1 commit


12 Mar, 2014

1 commit

  • 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
    Cc: Peter Zijlstra
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Cc: linux-parisc@vger.kernel.org
    Link: http://lkml.kernel.org/r/20140304203100.859489993@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

12 Nov, 2013

1 commit

  • 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

    Linus Torvalds
     

08 Nov, 2013

1 commit

  • 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

    Helge Deller
     

01 Oct, 2013

1 commit

  • 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
    Signed-off-by: Frederic Weisbecker
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Paul Mackerras
    Cc: James Hogan
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: David S. Miller
    Cc: Andrew Morton

    Frederic Weisbecker
     

25 May, 2013

2 commits

  • 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

    Helge Deller
     
  • Show number of floating point assistant and unaligned access fixup
    handler in /proc/interrupts file.

    Signed-off-by: Helge Deller

    Helge Deller
     

12 May, 2013

1 commit

  • 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

    Helge Deller
     

08 May, 2013

4 commits

  • Fix up build error on UP and show correctly number of function call
    (ipi) irqs.

    Signed-off-by: Helge Deller

    Helge Deller
     
  • Add framework and initial values for more fine grained statistics in
    /proc/interrupts.

    Signed-off-by: Helge Deller

    Helge Deller
     
  • 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
    Signed-off-by: Helge Deller

    Helge Deller
     
  • 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

    Helge Deller
     

21 Feb, 2013

1 commit

  • 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
    Acked-by: Ingo Molnar
    Signed-off-by: Helge Deller

    Peter Zijlstra
     

08 Jan, 2013

1 commit


29 Mar, 2011

3 commits


11 Feb, 2011

1 commit

  • 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
    Signed-off-by: James Bottomley

    Thomas Gleixner
     

10 Feb, 2011

1 commit


05 Dec, 2010

2 commits

  • 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
    Tested-by: Helge Deller
    Signed-off-by: Kyle McMartin

    James Bottomley
     
  • 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
    Signed-off-by: Kyle McMartin

    James Bottomley
     

14 Oct, 2010

4 commits


16 Dec, 2009

1 commit


15 Dec, 2009

1 commit


28 Sep, 2009

1 commit


03 Jul, 2009

2 commits

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Kyle McMartin

    Thomas Gleixner
     
  • 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
    Signed-off-by: Kyle McMartin

    Helge Deller
     

28 Apr, 2009

1 commit

  • 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
    Cc: Andrew Morton
    Cc: Suresh Siddha
    Cc: "Eric W. Biederman"
    Cc: Rusty Russell
    Cc: linux-arch@vger.kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     

02 Apr, 2009

1 commit


28 Mar, 2009

1 commit


16 Mar, 2009

2 commits


13 Mar, 2009

3 commits