aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/irq.h
Commit message (Collapse)AuthorAgeFilesLines
* samsung update 1codeworkx2012-06-021-0/+1
|
* genirq: replace irq_gc_ack() with {set,clr}_bit variants (fwd)Simon Guinot2011-07-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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 <joravec@drewtech.com> Signed-off-by: Simon Guinot <sguinot@lacie.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* genirq: Add chip suspend and resume callbacksThomas Gleixner2011-04-231-0/+11
| | | | | | | | | | | 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 <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org
* genirq: Implement a generic interrupt chipThomas Gleixner2011-04-231-0/+135
| | | | | | | | | | | Implement a generic interrupt chip, which is configurable and is able to handle the most common irq chip implementations. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com> Tested-by: Tony Lindgren <tony@atomide.com> Tested-by; Kevin Hilman <khilman@ti.com>
* genirq: Support per-IRQ thread disabling.Paul Mundt2011-04-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <lethal@linux-sh.org> Link: http://lkml.kernel.org/r/%3C20110406210135.GF18426%40linux-sh.org%3E Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Forgotten updates/deletions after removal of compat codeGeert Uytterhoeven2011-04-231-18/+1
| | | | | | | | | | commit 0c6f8a8b917ad361319c8ace3e9f28e69bfdb4c1 ("genirq: Remove compat code") removed the compat code, but forgot to update some references in comments and delete some of its documentation. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: http://lkml.kernel.org/r/%3C1302426113-13808-1-git-send-email-geert%40linux-m68k.org%3E Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove obsolete commentThomas Gleixner2011-03-301-7/+0
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove move_*irq leftoversThomas Gleixner2011-03-291-4/+0
| | | | | | All users converted to new interface. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove compat codeThomas Gleixner2011-03-291-117/+0
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Fix new kernel-doc warningsRandy Dunlap2011-03-281-1/+1
| | | | | | | | | | | | | 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 <randy.dunlap@oracle.com> LKML-Reference: <20110318093356.b939558d.randy.dunlap@oracle.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add setter for AFFINITY_SET in irq_data stateThomas Gleixner2011-03-281-0/+5
| | | | | | | Some archs want to prevent the default affinity being set on their chips in the reqeust_irq() path. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Provide setter inline for IRQD_IRQ_INPROGRESSThomas Gleixner2011-03-281-0/+15
| | | | | | | Special function for demultiplexing handlers which can be disabled via disable_irq(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove handle_IRQ_eventThomas Gleixner2011-03-281-3/+0
| | | | | | Last user gone. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Provide edge_eoi flow handlerThomas Gleixner2011-03-281-0/+1
| | | | | | | This is a replacment for the cell flow handler which is in the way of cleanups. Must be selected to avoid general bloat. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move INPROGRESS, MASKED and DISABLED state flags to irq_dataThomas Gleixner2011-03-281-2/+15
| | | | | | | | We really need these flags for some of the interrupt chips. Move it from internal state to irq_data and provide proper accessors. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Daney <ddaney@caviumnetworks.com>
* genirq: Split irq_set_affinity() so it can be called with lock held.David Daney2011-03-271-0/+1
| | | | | | | | | | | | | | | | 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 <ddaney@caviumnetworks.com> Cc: linux-mips@linux-mips.org Cc: ralf@linux-mips.org LKML-Reference: <1301081931-11240-4-git-send-email-ddaney@caviumnetworks.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add chip flag for restricting cpu_on/offline callsThomas Gleixner2011-03-271-0/+3
| | | | | | | Add a flag which indicates that the on/offline callback should only be called on enabled interrupts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add chip hooks for taking CPUs on/off line.David Daney2011-03-271-0/+8
| | | | | | | | | | | [ tglx: Removed the enabled argument as this is now available in irq_data ] Signed-off-by: David Daney <ddaney@caviumnetworks.com> Cc: linux-mips@linux-mips.org Cc: ralf@linux-mips.org LKML-Reference: <1301081931-11240-3-git-send-email-ddaney@caviumnetworks.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add irq disabled flag to irq_data stateThomas Gleixner2011-03-271-0/+8
| | | | | | | | Some irq_chip implementation require to know the disabled state of the interrupt in certain callbacks. Add a state flag and accessor to irq_data. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Expand generic show_interrupts()Thomas Gleixner2011-03-251-0/+4
| | | | | | | | | | Some archs want to print extra information for certain irq_chips which is per irq and not per chip. Allow them to provide a chip callback to print the chip name and the extra information. PowerPC wants to print the LEVEL/EDGE type information. Make it configurable. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add chip flag to force mask on suspendThomas Gleixner2011-03-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On suspend we disable all interrupts in the core code, but this does not mask the interrupt line in the default implementation as we use a lazy disable approach. That means we mark the interrupt disabled, but leave the hardware unmasked. That's an optimization because we avoid the hardware access for the common case where no interrupt happens after we marked it disabled. If an interrupt happens, then the interrupt flow handler masks the line at the hardware level and marks it pending. Suspend makes use of this delayed disable as it "disables" all interrupts when preparing the suspend transition. Right before the system goes into hardware suspend state it checks whether one of the interrupts which is marked as a wakeup interrupt came in after disabling it. Most interrupt chips have a separate register which selects the interrupts which can wake up the system from suspend, so we don't have to mask any on the non wakeup interrupts. But now we have to deal with brilliant designed hardware which lacks such a wakeup configuration facility. For such hardware it's necessary to mask all non wakeup interrupts before going into suspend in order to avoid the wakeup from random interrupts. Rather than working around this in the affected interrupt chip implementations we can solve this elegant in the core code itself. Add a flag IRQCHIP_MASK_ON_SUSPEND which can be set by the irq chip implementation to indicate, that the interrupts which are not selected as wakeup sources must be masked in the suspend path. Mask them in the loop which checks the wakeup interrupts pending flag. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> LKML-Reference: <alpine.LFD.2.00.1103112112310.2787@localhost6.localdomain6>
* genirq: Implement irq_data based move_*_irq() versionsThomas Gleixner2011-02-191-0/+4
| | | | | | | No need to lookup the irq descriptor when calling from a chip callback function which has irq_data already handy. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq; Add fasteoi irq_chip quirkThomas Gleixner2011-02-191-1/+3
| | | | | | | | | Some chips want irq_eoi() only called when an interrupt is actually handled. So they have checks for INPROGRESS and DISABLED in their irq_eoi callbacks. Add a chip flag, which allows to handle that in the generic code. No impact on the fastpath. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add preflow handler supportThomas Gleixner2011-02-191-1/+2
| | | | | | | | | sparc64 needs to call a preflow handler on certain interrupts befor calling the action chain. Integrate it into handle_fasteoi_irq. Must be enabled via CONFIG_IRQ_FASTEOI_PREFLOW. No impact when disabled. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: David S. Miller <davem@davemloft.net>
* genirq: Consolidate set_chip_handler functionsThomas Gleixner2011-02-191-12/+39
| | | | | | No need to have separate functions if we have one plus inline wrappers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Reflect IRQ_MOVE_PCNTXT in irq_data stateThomas Gleixner2011-02-191-0/+8
| | | | | | Required by x86. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move wakeup state to irq_dataThomas Gleixner2011-02-191-0/+8
| | | | | | | Some irq_chips need to know the state of wakeup mode for setting the trigger type etc. Reflect it in irq_data state. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add IRQCHIP_SET_TYPE_MASKED flagThomas Gleixner2011-02-191-0/+9
| | | | | | | | | | irq_chips, which require to mask the chip before changing the trigger type should set this flag. So the core takes care of it and the requirement for looking into desc->status in the chip goes away. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Walleij <linus.walleij@stericsson.com> Cc: Lars-Peter Clausen <lars@metafoo.de>
* genirq: Add flags to irq_chipThomas Gleixner2011-02-191-0/+3
| | | | | | | | | Looking through irq_chip implementations I noticed that some of them have special requirements, like setting the type masked and therefor fiddle in irq_desc->status. Add a flag field, so the core code can handle it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Cleanup irq.hThomas Gleixner2011-02-191-33/+62
| | | | | | Put the constants into an enum and document them. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Mirror irq trigger type bits in irq_data.stateThomas Gleixner2011-02-191-1/+25
| | | | | | | | | | | | | | | | | That's the data structure chip functions get provided. Also allow them to signal the core code that they updated the flags in irq_data.state by returning IRQ_SET_MASK_OK_NOCOPY. The default is unchanged. The type bits should be accessed via: val = irqd_get_trigger_type(irqdata); and irqd_set_trigger_type(irqdata, val); Coders who access them directly will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_AFFINITY_SET to coreThomas Gleixner2011-02-191-1/+8
| | | | | | Keep status in sync until last abuser is gone. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Mirror IRQ_PER_CPU and IRQ_NO_BALANCING in irq_data.stateThomas Gleixner2011-02-191-1/+15
| | | | | | | | | | | | | | That's the right data structure to look at for arch code. Accessor functions are provided. irqd_is_per_cpu(irqdata); irqd_can_balance(irqdata); Coders who access them directly will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Make CHECK_IRQ_PER_CPU an inline and deprecate itThomas Gleixner2011-02-191-2/+6
| | | | | | | | Its' too ugly and needs to go. The only users are core code and parisc. Core code does not need it and parisc gets a new check once IRQ_PER_CPU is reflected in irq_data.state. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove CONFIG_IRQ_PER_CPUThomas Gleixner2011-02-191-5/+0
| | | | | | | | The saving of this switch is minimal versus the ifdef mess it creates. Simple enable PER_CPU unconditionally and remove the config switch. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add IRQ_MOVE_PENDING to irq_data.stateThomas Gleixner2011-02-191-2/+18
| | | | | | | | | | | | chip implementations need to know about it. Keep status in sync until all users are fixed. Accessor function: irqd_is_setaffinity_pending(irqdata) Coders who access them directly will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add state field to irq_dataThomas Gleixner2011-02-191-0/+3
| | | | | | | | | | | Some chip implementations need to access certain status flags. With sparse irqs that requires a lookup of the irq descriptor. Add a state field which contains such flags. Name it in a way which will make coders happy to access it with the proper accessor functions. And it's easy to grep for. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_SUSPENDED to coreThomas Gleixner2011-02-191-2/+0
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_MASKED to coreThomas Gleixner2011-02-191-1/+1
| | | | | | Keep status in sync until all users are fixed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_PENDING flag to coreThomas Gleixner2011-02-191-1/+1
| | | | | | Keep status in sync until all users are fixed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_DISABLED to coreThomas Gleixner2011-02-191-2/+2
| | | | | | Keep status in sync until all abusers are fixed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_REPLAY and IRQ_WAITING to coreThomas Gleixner2011-02-191-4/+5
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_ONESHOT to coreThomas Gleixner2011-02-191-1/+0
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add IRQ_INPROGRESS to coreThomas Gleixner2011-02-191-1/+5
| | | | | | | | | | | | | We need to maintain the flag for now in both fields status and istate. Add a CONFIG_GENERIC_HARDIRQS_NO_COMPAT switch to allow testing w/o the status one. Wrap the access to status IRQ_INPROGRESS in a inline which can be turned of with CONFIG_GENERIC_HARDIRQS_NO_COMPAT along with the define. There is no reason that anything outside of core looks at this. That needs some modifications, but we'll get there. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_POLL_INPROGRESS to coreThomas Gleixner2011-02-191-1/+0
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use modify_status for set_irq_nested_threadThomas Gleixner2011-02-191-3/+13
| | | | | | No need for a separate function in the core code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_SPURIOUS_DISABLED to core stateThomas Gleixner2011-02-191-1/+0
| | | | | | No users outside. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_AUTODETECT to internal stateThomas Gleixner2011-02-191-1/+0
| | | | | | No users outside of core Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Mark polled irqs and defer the real handlerThomas Gleixner2011-02-191-0/+1
| | | | | | | | | | | | | | With the chip.end() function gone we might run into a situation where a poll call runs and the real interrupt comes in, sees IRQ_INPROGRESS and disables the line. That might be a perfect working one, which will then be masked forever. So mark them polled while the poll runs. When the real handler sees IRQ_INPROGRESS it checks the poll flag and waits for the polling to complete. Add the necessary amount of sanity checks to it to avoid deadlocks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Do not copy affinity before setThomas Gleixner2011-02-191-0/+11
| | | | | | | | | | | | | | | | While rumaging through arch code I found that there are a few workarounds which deal with the fact that the initial affinity setting from request_irq() copies the mask into irq_data->affinity before the chip code is called. In the normal path we unconditionally copy the mask when the chip code returns 0. Copy after the code is called and add a return code IRQ_SET_MASK_OK_NOCOPY for the chip functions, which prevents the copy. That way we see the real mask when the chip function decided to truncate it further as some arches do. IRQ_SET_MASK_OK is 0, which is the current behaviour. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>