Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=216fcd29af47ab53ffd87e82139fcc4095e34d91
Commit:     216fcd29af47ab53ffd87e82139fcc4095e34d91
Parent:     c4c376f7e16deeba8f0542eabcaca19b712e7be1
Author:     Kenji Kaneshige <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 30 11:56:30 2007 +0900
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Mon Jul 30 16:30:42 2007 -0700

    [IA64] Fix possible race in destroy_and_reserve_irq()
    
    Currently, destroy_and_reserve_irq() sets irq_status[irq] UNUSED using
    clear_irq_vector() and sets irq_status[irq] RSVD using reserve_irq().
    But there is a race window because vector_lock is once released between
    them. This patch fixes this race window.
    
    Signed-off-by: Kenji Kaneshige <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/irq_ia64.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 9386b95..c47c8ac 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -101,15 +101,6 @@ int check_irq_used(int irq)
        return -1;
 }
 
-static void reserve_irq(unsigned int irq)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&vector_lock, flags);
-       irq_status[irq] = IRQ_RSVD;
-       spin_unlock_irqrestore(&vector_lock, flags);
-}
-
 static inline int find_unassigned_irq(void)
 {
        int irq;
@@ -302,10 +293,14 @@ static cpumask_t vector_allocation_domain(int cpu)
 
 void destroy_and_reserve_irq(unsigned int irq)
 {
+       unsigned long flags;
+
        dynamic_irq_cleanup(irq);
 
-       clear_irq_vector(irq);
-       reserve_irq(irq);
+       spin_lock_irqsave(&vector_lock, flags);
+       __clear_irq_vector(irq);
+       irq_status[irq] = IRQ_RSVD;
+       spin_unlock_irqrestore(&vector_lock, flags);
 }
 
 static int __reassign_irq_vector(int irq, int cpu)
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to