14 Sep, 2016

1 commit

  • Information about interrupts is exposed via /proc/interrupts, but the
    format of that file has changed over kernel versions and differs across
    architectures. It also has varying column numbers depending on hardware.

    That all makes it hard for tools to parse.

    To solve this, expose the information through sysfs so each irq attribute
    is in a separate file in a consistent, machine parsable way.

    This feature is only available when both CONFIG_SPARSE_IRQ and
    CONFIG_SYSFS are enabled.

    Examples:
    /sys/kernel/irq/18/actions: i801_smbus,ehci_hcd:usb1,uhci_hcd:usb7
    /sys/kernel/irq/18/chip_name: IR-IO-APIC
    /sys/kernel/irq/18/hwirq: 18
    /sys/kernel/irq/18/name: fasteoi
    /sys/kernel/irq/18/per_cpu_count: 0,0
    /sys/kernel/irq/18/type: level

    /sys/kernel/irq/25/actions: ahci0
    /sys/kernel/irq/25/chip_name: IR-PCI-MSI
    /sys/kernel/irq/25/hwirq: 512000
    /sys/kernel/irq/25/name: edge
    /sys/kernel/irq/25/per_cpu_count: 29036,0
    /sys/kernel/irq/25/type: edge

    [ tglx: Moved kobject_del() under sparse_irq_lock, massaged code comments
    and changelog ]

    Signed-off-by: Craig Gallek
    Cc: David Decotigny
    Link: http://lkml.kernel.org/r/1473783291-122873-1-git-send-email-kraigatgoog@gmail.com
    Signed-off-by: Thomas Gleixner

    Craig Gallek
     

02 May, 2016

1 commit

  • In order to prepare the genirq layer for the concept of partitionned
    percpu interrupts, let's allow an affinity to be associated with
    such an interrupt. We introduce:

    - irq_set_percpu_devid_partition: flag an interrupt as a percpu-devid
    interrupt, and associate it with an affinity
    - irq_get_percpu_devid_partition: allow the affinity of that interrupt
    to be retrieved.

    This will allow a driver to discover which CPUs the per-cpu interrupt
    can actually fire on.

    Signed-off-by: Marc Zyngier
    Cc: Mark Rutland
    Cc: devicetree@vger.kernel.org
    Cc: Jason Cooper
    Cc: Will Deacon
    Cc: Rob Herring
    Link: http://lkml.kernel.org/r/1460365075-7316-3-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

14 Dec, 2015

1 commit

  • The new VMD device driver needs to iterate over a list of
    "demultiplexing" interrupts. Protecting that list with a lock is not
    possible because the list is also required in code pathes which hold
    irq descriptor lock. Therefor the demultiplexing interrupt handler
    would create a lock inversion scenario if it calls a demux handler
    with the list protection lock held.

    A solution for this is to free the irq descriptor via RCU, so the
    list can be walked with rcu read lock held.

    Signed-off-by: Thomas Gleixner
    Cc: Keith Busch

    Thomas Gleixner
     

16 Sep, 2015

6 commits


15 Sep, 2015

1 commit

  • __do_IRQ() was removed by commit 1c77ff2 "genirq: Remove __do_IRQ",
    but the comment referring to __do_IRQ() was left.

    Update the comment for generic_handle_irq_desc().

    Signed-off-by: Huang Shijie
    Cc: jiang.liu@linux.intel.com
    Cc: peterz@infradead.org
    Cc: rafael.j.wysocki@intel.com
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Link: http://lkml.kernel.org/r/1441074950-3893-1-git-send-email-shijie.huang@arm.com
    Signed-off-by: Thomas Gleixner

    Huang Shijie
     

06 Aug, 2015

1 commit

  • If we have a reference to irq_desc already, there is no point to do
    another lookup.

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Peter Zijlstra
    Cc: Rusty Russell
    Cc: Bjorn Helgaas
    Link: http://lkml.kernel.org/r/20150802203609.638130301@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

08 Jul, 2015

1 commit

  • When a cpu goes up some architectures (e.g. x86) have to walk the irq
    space to set up the vector space for the cpu. While this needs extra
    protection at the architecture level we can avoid a few race
    conditions by preventing the concurrent allocation/free of irq
    descriptors and the associated data.

    When a cpu goes down it moves the interrupts which are targeted to
    this cpu away by reassigning the affinities. While this happens
    interrupts can be allocated and freed, which opens a can of race
    conditions in the code which reassignes the affinities because
    interrupt descriptors might be freed underneath.

    Example:

    CPU1 CPU2
    cpu_up/down
    irq_desc = irq_to_desc(irq);
    remove_from_radix_tree(desc);
    raw_spin_lock(&desc->lock);
    free(desc);

    We could protect the irq descriptors with RCU, but that would require
    a full tree change of all accesses to interrupt descriptors. But
    fortunately these kind of race conditions are rather limited to a few
    things like cpu hotplug. The normal setup/teardown is very well
    serialized. So the simpler and obvious solution is:

    Prevent allocation and freeing of interrupt descriptors accross cpu
    hotplug.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Cc: xiao jin
    Cc: Joerg Roedel
    Cc: Borislav Petkov
    Cc: Yanmin Zhang
    Link: http://lkml.kernel.org/r/20150705171102.063519515@linutronix.de

    Thomas Gleixner
     

27 Jun, 2015

2 commits

  • The main use case for the exisiting __irq_set_*_locked() inlines is to
    replace the handler [,chip and name] of an interrupt from a region
    which has the irq descriptor lock held, e.g. from the irq_set_type()
    callback. The first argument is the irq number, so the functions need
    so perform a pointless lookup of the interrupt descriptor for those
    cases which have the irq_data pointer handy.

    Provide new functions which take an irq_data pointer instead of the
    interrupt number, so the lookup of the interrupt descriptor can be
    avoided.

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu

    Conflicts:
    include/linux/irqdesc.h

    Thomas Gleixner
     
  • Introduce helper irq_desc_get_irq() to retrieve the irq number from
    the irq descriptor.

    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: Marc Zyngier
    Link: http://lkml.kernel.org/r/1433391238-19471-17-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

25 Jun, 2015

1 commit

  • Seems we have little chance to move irqdesc.h from include/linux/ into
    kernel/irq/, so remove the outdated comments.

    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: Jason Cooper
    Cc: Kevin Cernekee
    Cc: Arnd Bergmann
    Cc: Marc Zyngier
    Link: http://lkml.kernel.org/r/1433391238-19471-2-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

12 Jun, 2015

2 commits

  • With the introduction of hierarchy irqdomain, struct irq_data becomes
    per-chip instead of per-irq and there may be multiple irq_datas
    associated with the same irq. Some per-irq data stored in struct
    irq_data now may get duplicated into multiple irq_datas, and causes
    inconsistent view.

    So introduce struct irq_common_data to host per-irq common data and to
    achieve consistent view among irq_chips.

    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: Jason Cooper
    Cc: Kevin Cernekee
    Cc: Arnd Bergmann
    Cc: Marc Zyngier
    Link: http://lkml.kernel.org/r/1433145945-789-4-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • For irq associated with hierarchy irqdomains, there will be multiple
    irq_datas for one irq_desc. So enhance irq_data_to_desc() to support
    hierarchy irqdomain. Also export irq_data_to_desc() as an inline
    function for later reuse.

    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: Marc Zyngier
    Link: http://lkml.kernel.org/r/1433145945-789-2-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

05 Mar, 2015

1 commit

  • It currently is required that all users of NO_SUSPEND interrupt
    lines pass the IRQF_NO_SUSPEND flag when requesting the IRQ or the
    WARN_ON_ONCE() in irq_pm_install_action() will trigger. That is
    done to warn about situations in which unprepared interrupt handlers
    may be run unnecessarily for suspended devices and may attempt to
    access those devices by mistake. However, it may cause drivers
    that have no technical reasons for using IRQF_NO_SUSPEND to set
    that flag just because they happen to share the interrupt line
    with something like a timer.

    Moreover, the generic handling of wakeup interrupts introduced by
    commit 9ce7a25849e8 (genirq: Simplify wakeup mechanism) only works
    for IRQs without any NO_SUSPEND users, so the drivers of wakeup
    devices needing to use shared NO_SUSPEND interrupt lines for
    signaling system wakeup generally have to detect wakeup in their
    interrupt handlers. Thus if they happen to share an interrupt line
    with a NO_SUSPEND user, they also need to request that their
    interrupt handlers be run after suspend_device_irqs().

    In both cases the reason for using IRQF_NO_SUSPEND is not because
    the driver in question has a genuine need to run its interrupt
    handler after suspend_device_irqs(), but because it happens to
    share the line with some other NO_SUSPEND user. Otherwise, the
    driver would do without IRQF_NO_SUSPEND just fine.

    To make it possible to specify that condition explicitly, introduce
    a new IRQ action handler flag for shared IRQs, IRQF_COND_SUSPEND,
    that, when set, will indicate to the IRQ core that the interrupt
    user is generally fine with suspending the IRQ, but it also can
    tolerate handler invocations after suspend_device_irqs() and, in
    particular, it is capable of detecting system wakeup and triggering
    it as appropriate from its interrupt handler.

    That will allow us to work around a problem with a shared timer
    interrupt line on at91 platforms.

    Link: http://marc.info/?l=linux-kernel&m=142252777602084&w=2
    Link: http://marc.info/?t=142252775300011&r=1&w=2
    Link: https://lkml.org/lkml/2014/12/15/552
    Reported-by: Boris Brezillon
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Mark Rutland

    Rafael J. Wysocki
     

10 Oct, 2014

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "Features-wise, to me the most important this time is a rework of
    wakeup interrupts handling in the core that makes them work
    consistently across all of the available sleep states, including
    suspend-to-idle. Many thanks to Thomas Gleixner for his help with
    this work.

    Second is an update of the generic PM domains code that has been in
    need of some care for quite a while. Unused code is being removed, DT
    support is being added and domains are now going to be attached to
    devices in bus type code in analogy with the ACPI PM domain. The
    majority of work here was done by Ulf Hansson who also has been the
    most active developer this time.

    Apart from this we have a traditional ACPICA update, this time to
    upstream version 20140828 and a few ACPI wakeup interrupts handling
    patches on top of the general rework mentioned above. There also are
    several cpufreq commits including renaming the cpufreq-cpu0 driver to
    cpufreq-dt, as this is what implements generic DT-based cpufreq
    support, and a new DT-based idle states infrastructure for cpuidle.

    In addition to that, the ACPI LPSS driver is updated, ACPI support for
    Apple machines is improved, a few bugs are fixed and a few cleanups
    are made all over.

    Finally, the Adaptive Voltage Scaling (AVS) subsystem now has a tree
    maintained by Kevin Hilman that will be merged through the PM tree.

    Numbers-wise, the generic PM domains update takes the lead this time
    with 32 non-merge commits, second is cpufreq (15 commits) and the 3rd
    place goes to the wakeup interrupts handling rework (13 commits).

    Specifics:

    - Rework the handling of wakeup IRQs by the IRQ core such that all of
    them will be switched over to "wakeup" mode in suspend_device_irqs()
    and in that mode the first interrupt will abort system suspend in
    progress or wake up the system if already in suspend-to-idle (or
    equivalent) without executing any interrupt handlers. Among other
    things that eliminates the wakeup-related motivation to use the
    IRQF_NO_SUSPEND interrupt flag with interrupts which don't really
    need it and should not use it (Thomas Gleixner and Rafael Wysocki)

    - Switch over ACPI to handling wakeup interrupts with the help of the
    new mechanism introduced by the above IRQ core rework (Rafael Wysocki)

    - Rework the core generic PM domains code to eliminate code that's
    not used, add DT support and add a generic mechanism by which
    devices can be added to PM domains automatically during enumeration
    (Ulf Hansson, Geert Uytterhoeven and Tomasz Figa).

    - Add debugfs-based mechanics for debugging generic PM domains
    (Maciej Matraszek).

    - ACPICA update to upstream version 20140828. Included are updates
    related to the SRAT and GTDT tables and the _PSx methods are in the
    METHOD_NAME list now (Bob Moore and Hanjun Guo).

    - Add _OSI("Darwin") support to the ACPI core (unfortunately, that
    can't really be done in a straightforward way) to prevent
    Thunderbolt from being turned off on Apple systems after boot (or
    after resume from system suspend) and rework the ACPI Smart Battery
    Subsystem (SBS) driver to work correctly with Apple platforms
    (Matthew Garrett and Andreas Noever).

    - ACPI LPSS (Low-Power Subsystem) driver update cleaning up the code,
    adding support for 133MHz I2C source clock on Intel Baytrail to it
    and making it avoid using UART RTS override with Auto Flow Control
    (Heikki Krogerus).

    - ACPI backlight updates removing the video_set_use_native_backlight
    quirk which is not necessary any more, making the code check the
    list of output devices returned by the _DOD method to avoid
    creating acpi_video interfaces that won't work and adding a quirk
    for Lenovo Ideapad Z570 (Hans de Goede, Aaron Lu and Stepan Bujnak)

    - New Win8 ACPI OSI quirks for some Dell laptops (Edward Lin)

    - Assorted ACPI code cleanups (Fabian Frederick, Rasmus Villemoes,
    Sudip Mukherjee, Yijing Wang, and Zhang Rui)

    - cpufreq core updates and cleanups (Viresh Kumar, Preeti U Murthy,
    Rasmus Villemoes)

    - cpufreq driver updates: cpufreq-cpu0/cpufreq-dt (driver name change
    among other things), ppc-corenet, powernv (Viresh Kumar, Preeti U
    Murthy, Shilpasri G Bhat, Lucas Stach)

    - cpuidle support for DT-based idle states infrastructure, new ARM64
    cpuidle driver, cpuidle core cleanups (Lorenzo Pieralisi, Rasmus
    Villemoes)

    - ARM big.LITTLE cpuidle driver updates: support for DT-based
    initialization and Exynos5800 compatible string (Lorenzo Pieralisi,
    Kevin Hilman)

    - Rework of the test_suspend kernel command line argument and a new
    trace event for console resume (Srinivas Pandruvada, Todd E Brandt)

    - Second attempt to optimize swsusp_free() (hibernation core) to make
    it avoid going through all PFNs which may be way too slow on some
    systems (Joerg Roedel)

    - devfreq updates (Paul Bolle, Punit Agrawal, Ãrjan Eide).

    - rockchip-io Adaptive Voltage Scaling (AVS) driver and AVS entry
    update in MAINTAINERS (Heiko Stübner, Kevin Hilman)

    - PM core fix related to clock management (Geert Uytterhoeven)

    - PM core's sysfs code cleanup (Johannes Berg)"

    * tag 'pm+acpi-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (105 commits)
    ACPI / fan: printk replacement
    PM / clk: Fix crash in clocks management code if !CONFIG_PM_RUNTIME
    PM / Domains: Rename cpu_data to cpuidle_data
    cpufreq: cpufreq-dt: fix potential double put of cpu OF node
    cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
    PM / hibernate: Iterate over set bits instead of PFNs in swsusp_free()
    cpufreq: ppc-corenet: remove duplicate update of cpu_data
    ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle
    PM / sleep: Rename platform suspend/resume functions in suspend.c
    PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq()
    ACPICA: Introduce acpi_enable_all_wakeup_gpes()
    ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block()
    ACPI / video: check _DOD list when creating backlight devices
    PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
    cpufreq: Replace strnicmp with strncasecmp
    cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec
    cpufreq: powernv: Set the pstate of the last hotplugged out cpu in policy->cpus to minimum
    cpufreq: Allow stop CPU callback to be used by all cpufreq drivers
    PM / devfreq: exynos: Enable building exynos PPMU as module
    PM / devfreq: Export helper functions for drivers
    ...

    Linus Torvalds
     

03 Sep, 2014

1 commit

  • Calling irq_find_mapping from outside a irq_{enter,exit} section is
    unsafe and produces ugly messages if CONFIG_PROVE_RCU is enabled:
    If coming from the idle state, the rcu_read_lock call in irq_find_mapping
    will generate an unpleasant warning:

    ===============================
    [ INFO: suspicious RCU usage. ]
    3.16.0-rc1+ #135 Not tainted
    -------------------------------
    include/linux/rcupdate.h:871 rcu_read_lock() used illegally while idle!

    other info that might help us debug this:

    RCU used illegally from idle CPU!
    rcu_scheduler_active = 1, debug_locks = 0
    RCU used illegally from extended quiescent state!
    1 lock held by swapper/0/0:
    #0: (rcu_read_lock){......}, at: []
    irq_find_mapping+0x4c/0x198

    As this issue is fairly widespread and involves at least three
    different architectures, a possible solution is to add a new
    handle_domain_irq entry point into the generic IRQ code that
    the interrupt controller code can call.

    This new function takes an irq_domain, and calls into irq_find_domain
    inside the irq_{enter,exit} block. An additional "lookup" parameter is
    used to allow non-domain architecture code to be replaced by this as well.

    Interrupt controllers can then be updated to use the new mechanism.

    This code is sitting behind a new CONFIG_HANDLE_DOMAIN_IRQ, as not all
    architectures implement set_irq_regs (yes, mn10300, I'm looking at you...).

    Reported-by: Vladimir Murzin
    Signed-off-by: Marc Zyngier
    Link: https://lkml.kernel.org/r/1409047421-27649-2-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Jason Cooper

    Marc Zyngier
     

01 Sep, 2014

1 commit


04 May, 2014

1 commit

  • Till reported that the spurious interrupt detection of threaded
    interrupts is broken in two ways:

    - note_interrupt() is called for each action thread of a shared
    interrupt line. That's wrong as we are only interested whether none
    of the device drivers felt responsible for the interrupt, but by
    calling multiple times for a single interrupt line we account
    IRQ_NONE even if one of the drivers felt responsible.

    - note_interrupt() when called from the thread handler is not
    serialized. That leaves the members of irq_desc which are used for
    the spurious detection unprotected.

    To solve this we need to defer the spurious detection of a threaded
    interrupt to the next hardware interrupt context where we have
    implicit serialization.

    If note_interrupt is called with action_ret == IRQ_WAKE_THREAD, we
    check whether the previous interrupt requested a deferred check. If
    not, we request a deferred check for the next hardware interrupt and
    return.

    If set, we check whether one of the interrupt threads signaled
    success. Depending on this information we feed the result into the
    spurious detector.

    If one primary handler of a shared interrupt returns IRQ_HANDLED we
    disable the deferred check of irq threads on the same line, as we have
    found at least one device driver who cared.

    Reported-by: Till Straumann
    Signed-off-by: Thomas Gleixner
    Tested-by: Austin Schuh
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Cc: Pavel Pisa
    Cc: Marc Kleine-Budde
    Cc: linux-can@vger.kernel.org
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1303071450130.22263@ionos

    Thomas Gleixner
     

20 Dec, 2013

1 commit

  • This patch adds an accessor function for IRQ_PER_CPU flag.
    The accessor function is useful to determine whether an IRQ is percpu or not.

    This patch is based on an older patch posted by Chris Smith here [1].
    There is a minor change w.r.t. Chris's original patch: The accessor function
    is renamed as 'irq_is_percpu' instead of 'irq_is_per_cpu'.

    [1]: http://lkml.indiana.edu/hypermail/linux/kernel/1207.3/02955.html

    Signed-off-by: Chris Smith
    Signed-off-by: Vinayak Kale
    Acked-by: Will Deacon
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Vinayak Kale
     

13 Sep, 2013

1 commit


01 Nov, 2012

1 commit

  • Attempts to retrigger nested threaded IRQs currently fail because they
    have no primary handler. In order to support retrigger of nested
    IRQs, the parent IRQ needs to be retriggered.

    To fix, when an IRQ needs to be resent, if the interrupt has a parent
    IRQ and runs in the context of the parent IRQ, then resend the parent.

    Also, handle_nested_irq() needs to clear the replay flag like the
    other handlers, otherwise check_irq_resend() will set it and it will
    never be cleared. Without clearing, it results in the first resend
    working fine, but check_irq_resend() returning early on subsequent
    resends because the replay flag is still set.

    Problem discovered on ARM/OMAP platforms where a nested IRQ that's
    also a wakeup IRQ happens late in suspend and needed to be retriggered
    during the resume process.

    [khilman@ti.com: changelog edits, clear IRQS_REPLAY in handle_nested_irq()]

    Reported-by: Kevin Hilman
    Tested-by: Kevin Hilman
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1350425269-11489-1-git-send-email-khilman@deeprootsystems.com
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

02 Oct, 2012

1 commit

  • Pull the trivial tree from Jiri Kosina:
    "Tiny usual fixes all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    doc: fix old config name of kprobetrace
    fs/fs-writeback.c: cleanup riteback_sb_inodes kerneldoc
    btrfs: fix the commment for the action flags in delayed-ref.h
    btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID
    vfs: fix kerneldoc for generic_fh_to_parent()
    treewide: fix comment/printk/variable typos
    ipr: fix small coding style issues
    doc: fix broken utf8 encoding
    nfs: comment fix
    platform/x86: fix asus_laptop.wled_type module parameter
    mfd: printk/comment fixes
    doc: getdelays.c: remember to close() socket on error in create_nl_socket()
    doc: aliasing-test: close fd on write error
    mmc: fix comment typos
    dma: fix comments
    spi: fix comment/printk typos in spi
    Coccinelle: fix typo in memdup_user.cocci
    tmiofb: missing NULL pointer checks
    tools: perf: Fix typo in tools/perf
    tools/testing: fix comment / output typos
    ...

    Linus Torvalds
     

15 Aug, 2012

1 commit


19 Jul, 2012

1 commit

  • With the new interrupt sampling system, we are no longer using the
    timer_rand_state structure in the irq descriptor, so we can stop
    initializing it now.

    [ Merged in fixes from Sedat to find some last missing references to
    rand_initialize_irq() ]

    Signed-off-by: "Theodore Ts'o"
    Signed-off-by: Sedat Dilek

    Theodore Ts'o
     

01 Nov, 2011

1 commit

  • Recent commit "irq: Track the owner of irq descriptor" in
    commit ID b6873807a7143b7 placed module.h into linux/irq.h
    but we are trying to limit module.h inclusion to just C files
    that really need it, due to its size and number of children
    includes. This targets just reversing that include.

    Add in the basic "struct module" since that is all we really need
    to ensure things compile. In theory, b687380 should have added the
    module.h include to the irqdesc.h header as well, but the implicit
    module.h everywhere presence masked this from showing up. So give
    it the "struct module" as well.

    As for the C files, irqdesc.c is only using THIS_MODULE, so it
    does not need module.h - give it export.h instead. The C file
    irq/manage.c is now (as of b687380) using try_module_get and
    module_put and so it needs module.h (which it already has).

    Also convert the irq_alloc_descs variants to macros, since all
    they really do is is call the __irq_alloc_descs primitive.
    This avoids including export.h and no debug info is lost.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

03 Oct, 2011

1 commit

  • 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
     

28 Jul, 2011

1 commit

  • 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
     

18 May, 2011

1 commit

  • 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
     

23 Apr, 2011

2 commits


29 Mar, 2011

1 commit


24 Mar, 2011

3 commits


11 Mar, 2011

1 commit


26 Feb, 2011

1 commit

  • 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