20 Sep, 2011

1 commit

  • The sanity check in irq_domain_add() tests desc->irq_data != NULL or
    irq_data->domain != NULL. This prevents adding an irq_domain to a irq
    descriptor when irq_data exists, which true when the irq descriptor
    exists.

    This went unnoticed so far as the simple domain code did not enter
    this code path because domain->nr_irqs is always 0 for the simple domains.

    Split the check for irq_data == NULL out and have a separate warning
    for it.

    [ tglx: Made the check for irq_data == NULL separate ]

    Signed-off-by: Rob Herring
    Cc: Grant Likely
    Cc: marc.zyngier@arm.com
    Cc: thomas.abraham@linaro.org
    Cc: jamie@jamieiles.com
    Cc: b-cousson@ti.com
    Cc: shawn.guo@linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: devicetree-discuss@lists.ozlabs.org
    Link: http://lkml.kernel.org/r/1316017900-19918-3-git-send-email-robherring2@gmail.com
    Signed-off-by: Thomas Gleixner

    Rob Herring
     

12 Sep, 2011

1 commit

  • If an irq_chip provides .irq_shutdown(), but neither of .irq_disable() or
    .irq_mask(), free_irq() crashes when jumping to NULL.
    Fix this by only trying .irq_disable() and .irq_mask() if there's no
    .irq_shutdown() provided.

    This revives the symmetry with irq_startup(), which tries .irq_startup(),
    .irq_enable(), and irq_unmask(), and makes it consistent with the comment for
    irq_chip.irq_shutdown() in , which says:

    * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL)

    This is also how __free_irq() behaved before the big overhaul, cfr. e.g.
    3b56f0585fd4c02d047dc406668cb40159b2d340 ("genirq: Remove bogus conditional"),
    where the core interrupt code always overrode .irq_shutdown() to
    .irq_disable() if .irq_shutdown() was NULL.

    Signed-off-by: Geert Uytterhoeven
    Cc: linux-m68k@lists.linux-m68k.org
    Link: http://lkml.kernel.org/r/1315742394-16036-2-git-send-email-geert@linux-m68k.org
    Cc: stable@kernel.org
    Signed-off-by: Thomas Gleixner

    Geert Uytterhoeven
     

24 Aug, 2011

1 commit

  • This reverts commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464.

    It turns out that this breaks several drivers, one example being OMAP
    boards which use the on-board OMAP UARTs and the omap-serial driver that
    will not boot to userspace after the commit.

    Paul Walmsley reports that enabling CONFIG_DEBUG_SHIRQ reveals 'IRQ
    handler type mismatch' errors:

    IRQ handler type mismatch for IRQ 74
    current handler: serial idle
    ...

    and the reason is that setting IRQF_ONESHOT will now result in those
    interrupt handlers having different IRQF flags, and thus being
    unsharable. So the commit log in the reverted commit:

    "Since it is required for those users and
    there is no difference for others it makes sense to add this flag
    unconditionally."

    is simply not true: there may not be any difference from a "actions at
    irq time", but there is a *big* difference wrt this flag testing irq
    management (see __setup_irq() in kernel/irq/manage.c).

    One solution may be to stop verifying IRQF_ONESHOT in __setup_irq(), but
    right now the safe course of action is to revert the change. Let's
    revisit this in a later merge window.

    Reported-by: Paul Walmsley
    Cc: Sebastian Andrzej Siewior
    Requested-by: Alan Cox
    Acked-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

19 Aug, 2011

1 commit


18 Aug, 2011

1 commit


28 Jul, 2011

5 commits

  • Arnd Bergmann
     
  • Interrupt descriptors can be allocated from modules. The interrupts
    are used by other modules, but we have no refcount on the module which
    provides the interrupts and there is no way to establish one on the
    device level as the interrupt using module is agnostic to the fact
    that the interrupt is provided by a module rather than by some builtin
    interrupt controller.

    To prevent removal of the interrupt providing module, we can track the
    owner of the interrupt descriptor, which also provides the relevant
    irq chip functions in the irq descriptor.

    request/setup_irq() can now acquire a refcount on the owner module to
    prevent unloading. free_irq() drops the refcount.

    Signed-off-by: Sebastian Andrzej Siewior
    Link: http://lkml.kernel.org/r/20110711101731.GA13804@Chamillionaire.breakpoint.cc
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     
  • If no primary handler is specified then a default one is assigned
    which always returns IRQ_WAKE_THREAD. This handler requires the
    IRQF_ONESHOT flag on LEVEL / EIO typed irqs because the source of
    interrupt is not disabled. Since it is required for those users and
    there is no difference for others it makes sense to add this flag
    unconditionally.

    Signed-off-by: Sebastian Andrzej Siewior
    Link: http://lkml.kernel.org/r/1310070737-18514-1-git-send-email-bigeasy@linutronix.de
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     
  • irq_domain_generate_simple() is an easy way to generate an irq translation
    domain for simple irq controllers. It assumes a flat 1:1 mapping from
    hardware irq number to an offset of the first linux irq number assigned
    to the controller

    Signed-off-by: Grant Likely

    Grant Likely
     
  • This patch adds irq_domain infrastructure for translating from
    hardware irq numbers to linux irqs. This is particularly important
    for architectures adding device tree support because the current
    implementation (excluding PowerPC and SPARC) cannot handle
    translation for more than a single interrupt controller. irq_domain
    supports device tree translation for any number of interrupt
    controllers.

    This patch converts x86, Microblaze, ARM and MIPS to use irq_domain
    for device tree irq translation. x86 is untested beyond compiling it,
    irq_domain is enabled for MIPS and Microblaze, but the old behaviour is
    preserved until the core code is modified to actually register an
    irq_domain yet. On ARM it works and is required for much of the new
    ARM device tree board support.

    PowerPC has /not/ been converted to use this new infrastructure. It
    is still missing some features before it can replace the virq
    infrastructure already in powerpc (see documentation on
    irq_domain_map/unmap for details). Followup patches will add the
    missing pieces and migrate PowerPC to use irq_domain.

    SPARC has its own method of managing interrupts from the device tree
    and is unaffected by this change.

    Acked-by: Ralf Baechle
    Signed-off-by: Grant Likely

    Grant Likely
     

26 Jul, 2011

2 commits

  • (!msk & 0x01) should be !(msk & 0x01)

    Signed-off-by: Jonghwan Choi
    Link: http://lkml.kernel.org/r/1311229754-6003-1-git-send-email-jhbird.choi@samsung.com
    Signed-off-by: Thomas Gleixner
    Cc: stable@kernel.org

    jhbird.choi@samsung.com
     
  • devres uses the pointer value as key after it's freed, which is safe but
    triggers spurious use-after-free warnings on some static analysis tools.
    Rearrange code to avoid such warnings.

    Signed-off-by: Maxin B. John
    Reviewed-by: Rolf Eike Beer
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maxin B John
     

08 Jul, 2011

1 commit

  • This fixes a regression introduced by e59347a "arm: orion:
    Use generic irq chip".

    Depending on the device, interrupts acknowledgement is done by setting
    or by clearing a dedicated register. Replace irq_gc_ack() with some
    {set,clr}_bit variants allows to handle both cases.

    Note that this patch affects the following SoCs: Davinci, Samsung and
    Orion. Except for this last, the change is minor: irq_gc_ack() is just
    renamed into irq_gc_ack_set_bit().

    For the Orion SoCs, the edge GPIO interrupts support is currently
    broken. irq_gc_ack() try to acknowledge a such interrupt by setting
    the corresponding cause register bit. The Orion GPIO device expect the
    opposite. To fix this issue, the irq_gc_ack_clr_bit() variant is used.

    Tested on Network Space v2.

    Reported-by: Joey Oravec
    Signed-off-by: Simon Guinot
    Signed-off-by: Arnd Bergmann

    Simon Guinot
     

10 Jun, 2011

1 commit

  • In kernel/irq/manage.c::irq_set_irq_wake() we call
    irq_get_desc_buslock() which may return NULL, but the code
    dereferences the result unconditionally.

    irq_set_irq_wake() has lots of callers - I checked a few and I couldn't
    find anything that guarantees that they won't call it with some input that
    will cause irq_get_desc_buslock() to return NULL, so I think it's a good
    thing to test and -EINVAL was the most sane error code in this situation
    that I could think of.

    Not all callers test the return value of irq_set_irq_wake(), but those
    that do take != 0 to mean error as far as I can see, so they should be
    fine. I guess those that don't test actually should, but that's a
    different issue.

    Signed-off-by: Jesper Juhl
    Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1106092300360.17868@swampdragon.chaosbits.net
    Signed-off-by: Thomas Gleixner

    Jesper Juhl
     

03 Jun, 2011

4 commits

  • When irq_alloc_descs() is called with no base IRQ specified then it will
    search for a range of IRQs starting from a specified base address. In the
    case where an IRQ is specified it still does this search in order to ensure
    that none of the requested range is already allocated and it still uses the
    from parameter to specify the base for the search. This means that in the
    case where a base is specified but from is zero (which is reasonable as
    any IRQ number is in the range specified by a zero from) the function will
    get confused and try to allocate the first suitably sized block of free IRQs
    it finds.

    Instead use a specified IRQ as the base address for the search, and insist
    that any from that is specified can support that IRQ.

    Signed-off-by: Mark Brown
    Link: http://lkml.kernel.org/r/1307037313-15733-1-git-send-email-broonie@opensource.wolfsonmicro.com
    Signed-off-by: Thomas Gleixner

    Mark Brown
     
  • The genirq changes are initializing descriptors for sparse IRQs quite
    differently from how non-sparse (stacked?) IRQs are initialized, with
    the effect that on my platform all IRQs are default-disabled on sparse
    IRQs and default-enabled if non-sparse IRQs are used, crashing some
    GPIO driver.

    Fix this by refactoring the non-sparse IRQs to use the same descriptor
    init function as the sparse IRQs.

    Signed-off: Linus Walleij
    Link: http://lkml.kernel.org/r/1306858479-16622-1-git-send-email-linus.walleij@stericsson.com
    Cc: stable@kernel.org # 2.6.39
    Signed-off-by: Thomas Gleixner

    Linus Walleij
     
  • The detection of spurios interrupts is currently limited to first level
    handler. In force-threaded mode we never notice if the threaded irq does
    not feel responsible.
    This patch catches the return value of the threaded handler and forwards
    it to the spurious detector. If the primary handler returns only
    IRQ_WAKE_THREAD then the spourious detector ignores it because it gets
    called again from the threaded handler.

    [ tglx: Report the erroneous return value early and bail out ]

    Signed-off-by: Sebastian Andrzej Siewior
    Link: http://lkml.kernel.org/r/1306824972-27067-2-git-send-email-sebastian@breakpoint.cc
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     
  • In forced threaded mode (or with an explicit threaded handler) we only
    see the primary handler, but not the threaded handler.

    Signed-off-by: Sebastian Andrzej Siewior
    Link: http://lkml.kernel.org/r/1306824972-27067-1-git-send-email-sebastian@breakpoint.cc
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     

26 May, 2011

1 commit

  • commit 4b06042(bitmap, irq: add smp_affinity_list interface to
    /proc/irq) causes the following warning:

    [ 274.239500] WARNING: at fs/proc/generic.c:850 remove_proc_entry+0x24c/0x27a()
    [ 274.251761] remove_proc_entry: removing non-empty directory 'irq/184',
    leaking at least 'smp_affinity_list'

    Remove the new file in the exit path.

    Signed-off-by: Yinghai Lu
    Cc: Mike Travis
    Link: http://lkml.kernel.org/r/4DDDE094.6050505@kernel.org
    Signed-off-by: Thomas Gleixner

    Yinghai Lu
     

25 May, 2011

1 commit

  • Manually adjusting the smp_affinity for IRQ's becomes unwieldy when the
    cpu count is large.

    Setting smp affinity to cpus 256 to 263 would be:

    echo 000000ff,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > smp_affinity

    instead of:

    echo 256-263 > smp_affinity_list

    Think about what it looks like for cpus around say, 4088 to 4095.

    We already have many alternate "list" interfaces:

    /sys/devices/system/cpu/cpuX/indexY/shared_cpu_list
    /sys/devices/system/cpu/cpuX/topology/thread_siblings_list
    /sys/devices/system/cpu/cpuX/topology/core_siblings_list
    /sys/devices/system/node/nodeX/cpulist
    /sys/devices/pci***/***/local_cpulist

    Add a companion interface, smp_affinity_list to use cpu lists instead of
    cpu maps. This conforms to other companion interfaces where both a map
    and a list interface exists.

    This required adding a bitmap_parselist_user() function in a manner
    similar to the bitmap_parse_user() function.

    [akpm@linux-foundation.org: make __bitmap_parselist() static]
    Signed-off-by: Mike Travis
    Cc: Thomas Gleixner
    Cc: Jack Steiner
    Cc: Lee Schermerhorn
    Cc: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Travis
     

20 May, 2011

1 commit

  • * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    irq: Export functions to allow modular irq drivers
    genirq: Uninline and sanity check generic_handle_irq()
    genirq: Remove pointless ifdefs
    genirq: Make generic irq chip depend on CONFIG_GENERIC_IRQ_CHIP
    genirq: Add chip suspend and resume callbacks
    genirq: Implement a generic interrupt chip
    genirq: Support per-IRQ thread disabling.
    genirq: irq_desc: Document preflow_handler and affinity_hint
    genirq: Update DocBook comments
    genirq: Forgotten updates/deletions after removal of compat code

    Linus Torvalds
     

18 May, 2011

3 commits

  • Export handle_simple_irq, irq_modify_status, irq_alloc_descs,
    irq_free_descs and generic_handle_irq to allow their usage in
    modules. First user is IIO, which wants to be built modular, but needs
    to be able to create irq chips, allocate and configure interrupt
    descriptors and handle demultiplexing interrupts.

    [ tglx: Moved the uninlinig of generic_handle_irq to a separate patch ]

    Signed-off-by: Jonathan Cameron
    Link: http://lkml.kernel.org/r/%3C1305711544-505-1-git-send-email-jic23%40cam.ac.uk%3E
    Signed-off-by: Thomas Gleixner

    Jonathan Cameron
     
  • generic_handle_irq() is missing a NULL pointer check for the result of
    irq_to_desc. This was a not a big problem, but we want to expose it to
    drivers, so we better have sanity checks in place. Add a return value
    as well, which indicates that the irq number was valid and the handler
    was invoked.

    Based on the pure code move from Jonathan Cameron.

    Signed-off-by: Thomas Gleixner
    Cc: Jonathan Cameron

    Thomas Gleixner
     
  • kernel/irq/ is only built when CONFIG_GENERIC_HARDIRQS=y. So making
    code inside of kernel/irq/ conditional on CONFIG_GENERIC_HARDIRQS is
    pointless.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

03 May, 2011

2 commits


23 Apr, 2011

3 commits

  • These callbacks are only called in the syscore suspend/resume code on
    interrupt chips which have been registered via the generic irq chip
    mechanism. Calling those callbacks per irq would be rather icky, but
    with the generic irq chip mechanism we can call this per registered
    chip.

    Signed-off-by: Thomas Gleixner
    Cc: linux-arm-kernel@lists.infradead.org

    Thomas Gleixner
     
  • Implement a generic interrupt chip, which is configurable and is able
    to handle the most common irq chip implementations.

    Signed-off-by: Thomas Gleixner
    Cc: linux-arm-kernel@lists.infradead.org
    Tested-by: H Hartley Sweeten
    Tested-by: Tony Lindgren
    Tested-by; Kevin Hilman

    Thomas Gleixner
     
  • This adds support for disabling threading on a per-IRQ basis via the IRQ
    status instead of the IRQ flow, which is necessary for interrupts that
    don't follow the natural IRQ flow channels, such as those that are
    virtually created.

    The new APIs added are simply:

    irq_set_thread()
    irq_set_nothread()

    which follow the rest of the IRQ status routines.

    Chained handlers also have IRQ_NOTHREAD set on them automatically, making
    the lack of threading explicit rather than implicit. Subsequently, the
    nothread flag can be viewed through the standard genirq debugging
    facilities.

    [ tglx: Fixed cleanup fallout ]

    Signed-off-by: Paul Mundt
    Link: http://lkml.kernel.org/r/%3C20110406210135.GF18426%40linux-sh.org%3E
    Signed-off-by: Thomas Gleixner

    Paul Mundt
     

08 Apr, 2011

1 commit

  • …-linus', 'irq-fixes-for-linus' and 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86-32, fpu: Fix FPU exception handling on non-SSE systems
    x86, hibernate: Initialize mmu_cr4_features during boot
    x86-32, NUMA: Fix ACPI NUMA init broken by recent x86-64 change
    x86: visws: Fixup irq overhaul fallout

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched: Clean up rebalance_domains() load-balance interval calculation

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86/mrst/vrtc: Fix boot crash in mrst_rtc_init()
    rtc, x86/mrst/vrtc: Fix boot crash in rtc_read_alarm()

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix cpumask leak in __setup_irq()

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf probe: Fix listing incorrect line number with inline function
    perf probe: Fix to find recursively inlined function
    perf probe: Fix multiple --vars options behavior
    perf probe: Fix to remove redundant close
    perf probe: Fix to ensure function declared file

    Linus Torvalds
     

03 Apr, 2011

1 commit


31 Mar, 2011

1 commit


30 Mar, 2011

2 commits


29 Mar, 2011

6 commits