aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:51:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:02 -0400
commitd973a77bdb3ade9240173b6ed6e003a319499211 (patch)
tree66be056cdd213a89b85354c32b0f5ad6de703b21
parent1d1497e1f9ffe2f7198c916abd112226a7a503f2 (diff)
uml: irq locking commentary
Locking commentary. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/um/kernel/irq.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index a1e8c460b755..8f2ed3690315 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -78,6 +78,14 @@ skip:
78 return 0; 78 return 0;
79} 79}
80 80
81/*
82 * This list is accessed under irq_lock, except in sigio_handler,
83 * where it is safe from being modified. IRQ handlers won't change it -
84 * if an IRQ source has vanished, it will be freed by free_irqs just
85 * before returning from sigio_handler. That will process a separate
86 * list of irqs to free, with its own locking, coming back here to
87 * remove list elements, taking the irq_lock to do so.
88 */
81static struct irq_fd *active_fds = NULL; 89static struct irq_fd *active_fds = NULL;
82static struct irq_fd **last_irq_ptr = &active_fds; 90static struct irq_fd **last_irq_ptr = &active_fds;
83 91
@@ -243,6 +251,7 @@ void free_irq_by_fd(int fd)
243 free_irq_by_cb(same_fd, &fd); 251 free_irq_by_cb(same_fd, &fd);
244} 252}
245 253
254/* Must be called with irq_lock held */
246static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) 255static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
247{ 256{
248 struct irq_fd *irq; 257 struct irq_fd *irq;
@@ -308,6 +317,12 @@ void deactivate_fd(int fd, int irqnum)
308 ignore_sigio_fd(fd); 317 ignore_sigio_fd(fd);
309} 318}
310 319
320/*
321 * Called just before shutdown in order to provide a clean exec
322 * environment in case the system is rebooting. No locking because
323 * that would cause a pointless shutdown hang if something hadn't
324 * released the lock.
325 */
311int deactivate_all_fds(void) 326int deactivate_all_fds(void)
312{ 327{
313 struct irq_fd *irq; 328 struct irq_fd *irq;