aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-06-21 20:16:19 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:32 -0400
commitdbce706e2550253c5ab6043f4f5dfde0cd02470f (patch)
tree5d96bab350d86e43e32faa80b64e05e7dc514ae8 /kernel/irq/manage.c
parent5757b284a300e0e5d2173750906625b6470bd9f0 (diff)
[PATCH] uml: add and use generic hw_controller_type->release
With Chris Wedgwood <cw@f00f.org> Currently UML must explicitly call the UML-specific free_irq_by_irq_and_dev() for each free_irq call it's done. This is needed because ->shutdown and/or ->disable are only called when the last "action" for that irq is removed. Instead, for UML shared IRQs (UML IRQs are very often, if not always, shared), for each dev_id some setup is done, which must be cleared on the release of that fd. For instance, for each open console a new instance (i.e. new dev_id) of the same IRQ is requested(). Exactly, a fd is stored in an array (pollfds), which is after read by a host thread and passed to poll(). Each event registered by poll() triggers an interrupt. So, for each free_irq() we must remove the corresponding host fd from the table, which we do via this -release() method. In this patch we add an appropriate hook for this, and remove all uses of it by pointing the hook to the said procedure; this is safe to do since the said procedure. Also some cosmetic improvements are included. This is heavily based on some work by Chris Wedgwood, which however didn't get the patch merged for something I'd call a "misunderstanding" (the need for this patch wasn't cleanly explained, thus adding the generic hook was felt as undesirable). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> CC: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 5202e4c4a5b6..5fde8177eedf 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -255,6 +255,10 @@ void free_irq(unsigned int irq, void *dev_id)
255 255
256 /* Found it - now remove it from the list of entries */ 256 /* Found it - now remove it from the list of entries */
257 *pp = action->next; 257 *pp = action->next;
258
259 if (desc->handler->release)
260 desc->handler->release(irq, dev_id);
261
258 if (!desc->action) { 262 if (!desc->action) {
259 desc->status |= IRQ_DISABLED; 263 desc->status |= IRQ_DISABLED;
260 if (desc->handler->shutdown) 264 if (desc->handler->shutdown)