09 Jan, 2012

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     

02 Dec, 2011

1 commit

  • In irq_wait_for_interrupt(), the should_stop member is verified before
    setting the task's state to TASK_INTERRUPTIBLE and calling schedule().
    In case kthread_stop sets should_stop and wakes up the process after
    should_stop is checked by the irq thread but before the task's state
    is changed, the irq thread might never exit:

    kthread_stop irq_wait_for_interrupt
    ------------ ----------------------

    ...
    ... while (!kthread_should_stop()) {
    kthread->should_stop = 1;
    wake_up_process(k);
    wait_for_completion(&kthread->exited);
    ...
    set_current_state(TASK_INTERRUPTIBLE);

    ...

    schedule();
    }

    Fix this by checking if the thread should stop after modifying the
    task's state.

    [ tglx: Simplified it a bit ]

    Signed-off-by: Ido Yariv
    Link: http://lkml.kernel.org/r/1322740508-22640-1-git-send-email-ido@wizery.com
    Signed-off-by: Thomas Gleixner
    Cc: stable@kernel.org

    Ido Yariv
     

18 Nov, 2011

1 commit

  • The power management functions related to interrupts do not know
    (yet) about per-cpu interrupts and end up calling the wrong
    low-level methods to enable/disable interrupts.

    This leads to all kind of interesting issues (action taken on one
    CPU only, updating a refcount which is not used otherwise...).

    The workaround for the time being is simply to flag these interrupts
    with IRQF_NO_SUSPEND. At least on ARM, these interrupts are actually
    dealt with at the architecture level.

    Reported-by: Santosh Shilimkar
    Tested-by: Santosh Shilimkar
    Signed-off-by: Marc Zyngier
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1321446459-31409-1-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

14 Nov, 2011

1 commit


30 Oct, 2011

1 commit


05 Oct, 2011

1 commit


03 Oct, 2011

2 commits

  • As request_percpu_irq() doesn't allow for a percpu interrupt to have
    its type configured (it is generally impossible to configure it on all
    CPUs at once), add a 'type' argument to enable_percpu_irq().

    This allows some low-level, board specific init code to be switched to
    a generic API.

    [ tglx: Added WARN_ON argument ]

    Signed-off-by: Marc Zyngier
    Cc: Abhijeet Dharmapurikar
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     
  • The ARM GIC interrupt controller offers per CPU interrupts (PPIs),
    which are usually used to connect local timers to each core. Each CPU
    has its own private interface to the GIC, and only sees the PPIs that
    are directly connect to it.

    While these timers are separate devices and have a separate interrupt
    line to a core, they all use the same IRQ number.

    For these devices, request_irq() is not the right API as it assumes
    that an IRQ number is visible by a number of CPUs (through the
    affinity setting), but makes it very awkward to express that an IRQ
    number can be handled by all CPUs, and yet be a different interrupt
    line on each CPU, requiring a different dev_id cookie to be passed
    back to the handler.

    The *_percpu_irq() functions is designed to overcome these
    limitations, by providing a per-cpu dev_id vector:

    int request_percpu_irq(unsigned int irq, irq_handler_t handler,
    const char *devname, void __percpu *percpu_dev_id);
    void free_percpu_irq(unsigned int, void __percpu *);
    int setup_percpu_irq(unsigned int irq, struct irqaction *new);
    void remove_percpu_irq(unsigned int irq, struct irqaction *act);
    void enable_percpu_irq(unsigned int irq);
    void disable_percpu_irq(unsigned int irq);

    The API has a number of limitations:
    - no interrupt sharing
    - no threading
    - common handler across all the CPUs

    Once the interrupt is requested using setup_percpu_irq() or
    request_percpu_irq(), it must be enabled by each core that wishes its
    local interrupt to be delivered.

    Based on an initial patch by Thomas Gleixner.

    Signed-off-by: Marc Zyngier
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1316793788-14500-2-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

12 Sep, 2011

1 commit

  • Some irq chips need the irq_set_wake() functionality, but do not
    require a irq_set_wake() callback. Instead of forcing an empty
    callback to be implemented add a flag which notes this fact. Check for
    the flag in set_irq_wake_real() and return success when set.

    Signed-off-by: Santosh Shilimkar
    Cc: Thomas Gleixner

    Santosh Shilimkar
     

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
     

28 Jul, 2011

2 commits

  • 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
     

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

1 commit

  • 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
     

23 Apr, 2011

1 commit

  • 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
     

03 Apr, 2011

1 commit


29 Mar, 2011

4 commits

  • Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • The late night fixup missed to convert the data type from irq_desc to
    irq_data, which results in a harmless but annoying warning.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • I missed the CONFIG_GENERIC_PENDING_IRQ dependency in the affinity
    related functions and the IRQ_LEVEL propagation into irq_data
    state. Did not pop up on my main test platforms. :(

    Signed-off-by: Thomas Gleixner
    Tested-by: David Daney

    Thomas Gleixner
     
  • Fix new irq-related kernel-doc warnings in 2.6.38:

    Warning(kernel/irq/manage.c:149): No description found for parameter 'mask'
    Warning(kernel/irq/manage.c:149): Excess function parameter 'cpumask' description in 'irq_set_affinity'
    Warning(include/linux/irq.h:161): No description found for parameter 'state_use_accessors'
    Warning(include/linux/irq.h:161): Excess struct/union/enum/typedef member 'state_use_accessor' description in 'irq_data'

    Signed-off-by: Randy Dunlap
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Randy Dunlap
     

28 Mar, 2011

1 commit


27 Mar, 2011

1 commit

  • The .irq_cpu_online() and .irq_cpu_offline() functions may need to
    adjust affinity, but they are called with the descriptor lock held.
    Create __irq_set_affinity_locked() which is called with the lock held.
    Make irq_set_affinity() just a wrapper that acquires the lock.

    [ tglx: Changed the argument to irq_data, added a !desc check and
    moved the !irq_set_affinity check where it belongs ]

    Signed-off-by: David Daney
    Cc: linux-mips@linux-mips.org
    Cc: ralf@linux-mips.org
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    David Daney
     

17 Mar, 2011

1 commit

  • goto out_thread is called before we take the lock. It causes a gcc
    warning: "kernel/irq/manage.c:858: warning: ‘flags’ may be used
    uninitialized in this function"

    [ tglx: Moved unlock before free_cpumask_var() ]

    Signed-off-by: Dan Carpenter
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Dan Carpenter
     

26 Feb, 2011

3 commits

  • Add a commandline parameter "threadirqs" which forces all interrupts except
    those marked IRQF_NO_THREAD to run threaded. That's mostly a debug option to
    allow retrieving better debug data from crashing interrupt handlers. If
    "threadirqs" is not enabled on the kernel command line, then there is no
    impact in the interrupt hotpath.

    Architecture code needs to select CONFIG_IRQ_FORCED_THREADING after
    marking the interrupts which cant be threaded IRQF_NO_THREAD. All
    interrupts which have IRQF_TIMER set are implict marked
    IRQF_NO_THREAD. Also all PER_CPU interrupts are excluded.

    Forced threading hard interrupts also forces all soft interrupt
    handling into thread context.

    When enabled it might slow down things a bit, but for debugging problems in
    interrupt code it's a reasonable penalty as it does not immediately
    crash and burn the machine when an interrupt handler is buggy.

    Some test results on a Core2Duo machine:

    Cache cold run of:
    # time git grep irq_desc

    non-threaded threaded
    real 1m18.741s 1m19.061s
    user 0m1.874s 0m1.757s
    sys 0m5.843s 0m5.427s

    # iperf -c server
    non-threaded
    [ 3] 0.0-10.0 sec 1.09 GBytes 933 Mbits/sec
    [ 3] 0.0-10.0 sec 1.09 GBytes 934 Mbits/sec
    [ 3] 0.0-10.0 sec 1.09 GBytes 933 Mbits/sec
    threaded
    [ 3] 0.0-10.0 sec 1.09 GBytes 939 Mbits/sec
    [ 3] 0.0-10.0 sec 1.09 GBytes 934 Mbits/sec
    [ 3] 0.0-10.0 sec 1.09 GBytes 937 Mbits/sec

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    LKML-Reference:

    Thomas Gleixner
     
  • Support ONESHOT on shared interrupts, if all drivers agree on it.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    LKML-Reference:

    Thomas Gleixner
     
  • For level type interrupts we need to track how many threads are on
    flight to avoid useless interrupt storms when not all thread handlers
    have finished yet. Keep track of the woken threads and only unmask
    when there are no more threads in flight.

    Yes, I'm lazy and using a bitfield. But not only because I'm lazy, the
    main reason is that it's way simpler than using a refcount. A refcount
    based solution would need to keep track of various things like
    crashing the irq thread, spurious interrupts coming in,
    disables/enables, free_irq() and some more. The bitfield keeps the
    tracking simple and makes things just work. It's also nicely confined
    to the thread code pathes and does not require additional checks all
    over the place.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    LKML-Reference:

    Thomas Gleixner
     

22 Feb, 2011

1 commit


19 Feb, 2011

13 commits