summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* genirq: Move IRQ_MASKED to coreThomas Gleixner2011-02-197-13/+41
| | | | | | 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-1911-17/+40
| | | | | | 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-199-25/+57
| | | | | | 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-197-21/+31
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_ONESHOT to coreThomas Gleixner2011-02-194-6/+7
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add IRQ_INPROGRESS to coreThomas Gleixner2011-02-199-22/+57
| | | | | | | | | | | | | 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-194-5/+6
| | | | | | No users outside of core. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use modify_status for set_irq_nested_threadThomas Gleixner2011-02-192-31/+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-194-10/+11
| | | | | | No users outside. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Move IRQ_AUTODETECT to internal stateThomas Gleixner2011-02-194-21/+27
| | | | | | No users outside of core Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Protect tglx from tripping over his own feetThomas Gleixner2011-02-193-2/+11
| | | | | | | | | | | The irq_desc.status field will either go away or renamed to settings. Anyway we need to maintain compatibility to avoid breaking the world and some more. While moving bits into the core, I need to avoid that I use any of the still existing IRQ_ bits in the core code by typos. So that file will hold the inline wrappers and some nasty CPP tricks to break the build when typoed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add internal state field to irq_descThomas Gleixner2011-02-192-1/+8
| | | | | | | | | | | | That field will contain internal state information which is not going to be exposed to anything outside the core code - except via accessor functions. I'm tired of everyone fiddling in irq_desc.status. core_internal_state__do_not_mess_with_it is clear enough, annoying to type and easy to grep for. Offenders will be tracked down and slapped with stinking trouts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Fixup core code namespace falloutThomas Gleixner2011-02-192-4/+4
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Implement generic irq_show_interrupts()Thomas Gleixner2011-02-193-0/+67
| | | | | | | | | | All archs implement show_interrupts() in more or less the same way. That's tons of duplicated code with different bugs with no value. Implement a generic version and deprecate show_interrupts() Unfortunately we need some ifdeffery for !GENERIC_HARDIRQ archs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Simplify handle_irq_event()Thomas Gleixner2011-02-191-13/+6
| | | | | | Now that all core users are converted one layer can go. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_irq_event() in the spurious poll codeThomas Gleixner2011-02-191-12/+9
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_perpcu_event() in handle_percpu_irq()Thomas Gleixner2011-02-191-8/+6
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_irq_event() in handle_edge_irq()Thomas Gleixner2011-02-191-14/+2
| | | | | | | It's safe to drop the IRQ_INPROGRESS flag between action chain walks as we are protected by desc->lock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_irq_event() in handle_fasteoi_irq()Thomas Gleixner2011-02-191-17/+2
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_irq_event() in handle_level_irq()Thomas Gleixner2011-02-191-14/+2
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Use handle_irq_event() in handle_simple_irq()Thomas Gleixner2011-02-191-13/+2
| | | | Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Implement handle_irq_event()Thomas Gleixner2011-02-192-8/+42
| | | | | | | | | | | | | | | Core code replacement for the ugly camel case. It contains all the code which is shared in all handlers. clear status flags set INPROGRESS flag unlock call action chain note_interrupt lock clr INPROGRESS flag Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Do not fiddle with IRQ_MASKED in handle_edge_irq()Thomas Gleixner2011-02-191-1/+1
| | | | | | | | | IRQ_MASKED is set in mask_ack_irq() anyway. Remove it from handle_edge_irq() to allow simpler ab^HHreuse of that function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110202212551.918484270@linutronix.de>
* genirq: Consolidate IRQ_DISABLEDThomas Gleixner2011-02-194-16/+14
| | | | | | Handle IRQ_DISABLED consistent. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove default magicThomas Gleixner2011-02-192-60/+17
| | | | | | | | | Now that everything uses the wrappers, we can remove the default functions. None of those functions is performance critical. That makes the IRQ_MASKED flag tracking fully consistent. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Consolidate disable/enableThomas Gleixner2011-02-195-8/+20
| | | | | | Create irq_disable/enable and use them to keep the flags consistent. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Consolidate startup/shutdown of interruptsThomas Gleixner2011-02-194-31/+33
| | | | | | | | | | Aside of duplicated code some of the startup/shutdown sites do not handle the MASKED/DISABLED flags and the depth field at all. Move that to a helper function and take care of it there. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110202212551.787481468@linutronix.de>
* genirq: Remove bogus conditionalThomas Gleixner2011-02-191-4/+1
| | | | | | | | | | The if (chip->irq_shutdown) check will always evaluate to true, as we fill in chip->irq_shutdown with default_shutdown in irq_chip_set_defaults() if the chip does not provide its own function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110202212551.667607458@linutronix.de>
* genirq: Move irq thread flags to coreThomas Gleixner2011-02-192-14/+14
| | | | | | Soleley used in core code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Mark polled irqs and defer the real handlerThomas Gleixner2011-02-194-28/+61
| | | | | | | | | | | | | | 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: spurious: Run only one poller at a timeThomas Gleixner2011-02-191-1/+15
| | | | | | | No point in running concurrent pollers which confuse each other by setting PENDING. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Do not poll disabled, percpu and timer interruptsThomas Gleixner2011-02-191-14/+26
| | | | | | | | | | | | | There is no point in polling disabled lines. percpu does not make sense at all because we only poll on the cpu we're currently running on. Also polling per_cpu interrupts is racy as hell. The handler runs without locking so we might get a huge surprise. If the timer interrupt needs polling, then we wont get there anyway. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Fixup poll handlingThomas Gleixner2011-02-191-31/+19
| | | | | | | | | try_one_irq() contains redundant code and lots of useless checks for shared interrupts. Check for shared before setting IRQ_INPROGRESS and then call handle_IRQ_event() while pending. Shorter version with the same functionality. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Warn when handler enables interruptsThomas Gleixner2011-02-191-1/+3
| | | | | | | We run all handlers with interrupts disabled and expect them not to enable them. Warn when we catch one who does. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Plug race in report_bad_irq()Thomas Gleixner2011-02-191-3/+9
| | | | | | | | | | We cannot walk the action chain unlocked. Even if IRQ_INPROGRESS is set an action can be removed and we follow a null pointer. It's safe to take the lock there, because the code which removes the action will call synchronize_irq() which waits unlocked for IRQ_INPROGRESS going away. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Remove redundant thread affinity settingThomas Gleixner2011-02-191-2/+0
| | | | | | Thread affinity is already set by setup_affinity(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Do not copy affinity before setThomas Gleixner2011-02-194-15/+47
| | | | | | | | | | | | | | | | 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>
* genirq: Always apply cpu online maskThomas Gleixner2011-02-191-6/+6
| | | | | | | | If the affinity had been set by the user, then a later request_irq() will honour that setting. But online cpus can have changed. So apply the online mask and for this case as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Rremove redundant checkThomas Gleixner2011-02-191-1/+2
| | | | | | | IRQ_NO_BALANCING is already checked in irq_can_set_affinity() above, no need to check it again. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Simplify affinity related codeThomas Gleixner2011-02-191-23/+41
| | | | | | | | There is lot of #ifdef CONFIG_GENERIC_PENDING_IRQ along with duplicated code in the irq core. Move the #ifdeffery into one place and cleanup the code so it's readable. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Namespace cleanupThomas Gleixner2011-02-195-38/+133
| | | | | | | | | | | | | | | | The irq namespace has become quite convoluted. My bad. Clean it up and deprecate the old functions. All new functions follow the scheme: irq number based: irq_set/get/xxx/_xxx(unsigned int irq, ...) irq_data based: irq_data_set/get/xxx/_xxx(struct irq_data *d, ....) irq_desc based: irq_desc_get_xxx(struct irq_desc *desc) Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Add missing buslock to set_irq_type(), set_irq_wake()Thomas Gleixner2011-02-192-0/+4
| | | | | | | | chips behind a slow bus cannot update the chip under desc->lock, but we miss the chip_buslock/chip_bus_sync_unlock() calls around the set type and set wake functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* genirq: Make nr_irqs runtime expandableThomas Gleixner2011-02-191-3/+19
| | | | | | | | | | | | | | We face more and more the requirement to expand nr_irqs at runtime. The reason are irq expanders which can not be detected in the early boot stage. So we speculate nr_irqs to have enough room. Further Xen needs extra irq numbers and we really want to avoid adding more "detection" code into the early boot. There is no real good reason why we need to limit nr_irqs at early boot. Allow the allocation code to expand nr_irqs. We have already 8k extra number space in the allocation bitmap, so lets use it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* Merge branch 'irq/urgent' into irq/coreThomas Gleixner2011-02-19473-3743/+4245
|\ | | | | | | | | | | Reason: Further patches are conflicting with mainline fixes Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| * genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for nowThomas Gleixner2011-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler in request_threaded_irq(). The original implementation (commit a304e1b8) called the handler _BEFORE_ it was installed, but that caused problems with handlers calling disable_irq_nosync(). See commit 377bf1e4. It's braindead in the first place to call disable_irq_nosync in shared handlers, but .... Moving this call after we installed the handler looks innocent, but it is very subtle broken on SMP. Interrupt handlers rely on the fact, that the irq core prevents reentrancy. Now this debug call violates that promise because we run the handler w/o the IRQ_INPROGRESS protection - which we cannot apply here because that would result in a possibly forever masked interrupt line. A concurrent real hardware interrupt on a different CPU results in handler reentrancy and can lead to complete wreckage, which was unfortunately observed in reality and took a fricking long time to debug. Leave the code here for now. We want this debug feature, but that's not easy to fix. We really should get rid of those disable_irq_nosync() abusers and remove that function completely. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Arjan van de Ven <arjan@infradead.org> Cc: stable@kernel.org # .28 -> .37
| * genirq: Prevent access beyond allocated_irqs bitmapThomas Gleixner2011-02-193-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lars-Peter Clausen pointed out: I stumbled upon this while looking through the existing archs using SPARSE_IRQ. Even with SPARSE_IRQ the NR_IRQS is still the upper limit for the number of IRQs. Both PXA and MMP set NR_IRQS to IRQ_BOARD_START, with IRQ_BOARD_START being the number of IRQs used by the core. In various machine files the nr_irqs field of the ARM machine defintion struct is then set to "IRQ_BOARD_START + NR_BOARD_IRQS". As a result "nr_irqs" will greater then NR_IRQS which then again causes the "allocated_irqs" bitmap in the core irq code to be accessed beyond its size overwriting unrelated data. The core code really misses a sanity check there. This went unnoticed so far as by chance the compiler/linker places data behind that bitmap which gets initialized later on those affected platforms. So the obvious fix would be to add a sanity check in early_irq_init() and break all affected platforms. Though that check wants to be backported to stable as well, which will require to fix all known problematic platforms and probably some more yet not known ones as well. Lots of churn. A way simpler solution is to allocate a slightly larger bitmap and avoid the whole churn w/o breaking anything. Add a few warnings when an arch returns utter crap. Reported-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@kernel.org # .37 Cc: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org>
| * Merge branch 'rtc-for-linus' of ↵Linus Torvalds2011-02-184-4/+150
| |\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: RTC: Re-enable UIE timer/polling emulation RTC: Revert UIE emulation removal RTC: Release mutex in error path of rtc_alarm_irq_enable
| | * RTC: Re-enable UIE timer/polling emulationJohn Stultz2011-02-173-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch re-enables UIE timer/polling emulation for rtc devices that do not support alarm irqs. CC: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> CC: Thomas Gleixner <tglx@linutronix.de> Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
| | * RTC: Revert UIE emulation removalJohn Stultz2011-02-173-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uwe pointed out that my alarm based UIE emulation is not sufficient to replace the older timer/polling based UIE emulation on devices where there is no alarm irq. This causes rtc devices without alarms to return -EINVAL to UIE ioctls. The fix is to re-instate the old timer/polling method for devices without alarm irqs. This patch reverts the following commits: 042620a018afcfba1d678062b62e46 - Remove UIE emulation 1daeddd5962acad1bea55e524fc0fa - Cleanup removed UIE emulation declaration b5cc8ca1c9c3a37eaddf709b2fd3e1 - Remove Kconfig symbol for UIE emulation The emulation mode will still need to be wired-in with a following patch before it will work. CC: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> CC: Thomas Gleixner <tglx@linutronix.de> Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
| | * RTC: Release mutex in error path of rtc_alarm_irq_enableUwe Kleine-König2011-02-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On hardware that doesn't support alarm interrupts, rtc_alarm_irq_enable could return without releasing the ops_lock mutex. This was introduced in aa0be0f (RTC: Propagate error handling via rtc_timer_enqueue properly) This patch corrects the issue by only returning once the mutex is released. [john.stultz: Reworded the commit log] Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
OpenPOWER on IntegriCloud