Commit:     3076212f8d3d9fe4d7b11c6b560c0f424edfcb4e
Parent:     602ed87ecd93a857dc687afb938d2c0f45552986
Author:     Jeff Dike <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 01:20:30 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Mar 29 08:22:24 2007 -0700

    [PATCH] uml: irq locking fixes
    As the comment immediately preceding this points out, this list is changed 
    irq context, so it needs to be protected with spin_lock_irqsave in process
    context when it is processed.
    Sometimes, gcc should just compile the comments and forget the code.
    The IRQ side of this was better, in the sense that it blocked and unblocked
    interrupts, but it still should have saved and restored them.
    Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
    Cc: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 arch/um/drivers/chan_kern.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 7b8baf1..9fdfad6 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -236,11 +236,11 @@ void free_irqs(void)
        struct chan *chan;
        struct list_head *ele;
+       unsigned long flags;
-       spin_lock_irq(&irqs_to_free_lock);
+       spin_lock_irqsave(&irqs_to_free_lock, flags);
        list_splice_init(&irqs_to_free, &list);
-       INIT_LIST_HEAD(&irqs_to_free);
-       spin_unlock_irq(&irqs_to_free_lock);
+       spin_unlock_irqrestore(&irqs_to_free_lock, flags);
        list_for_each(ele, &list){
                chan = list_entry(ele, struct chan, free_list);
@@ -255,13 +255,15 @@ void free_irqs(void)
 static void close_one_chan(struct chan *chan, int delay_free_irq)
+       unsigned long flags;
-               spin_lock_irq(&irqs_to_free_lock);
+               spin_lock_irqsave(&irqs_to_free_lock, flags);
                list_add(&chan->free_list, &irqs_to_free);
-               spin_unlock_irq(&irqs_to_free_lock);
+               spin_unlock_irqrestore(&irqs_to_free_lock, flags);
        else {
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to