Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=017e3c53f116d6a0741a21624924528dc9f98418
Commit:     017e3c53f116d6a0741a21624924528dc9f98418
Parent:     6a32d085ae71724edffa30fcd2045520a051cb14
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 14:16:26 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu May 17 21:11:14 2007 +1000

    [POWERPC] Add spinlock to request_phb_iospace()
    
    request_phb_iospace() can be called from different CPUs at init
    time (at least with my next patch) and thus needs a spinlock.
    As for the next patch, this is a temporary workaround for 2.6.22
    issues until my rewrite of IO mappings is ready (for 2.6.23)
    
    Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/mm/pgtable_64.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 1d44340..ad6e135 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -322,6 +322,8 @@ EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(iounmap);
 EXPORT_SYMBOL(__iounmap);
 
+static DEFINE_SPINLOCK(phb_io_lock);
+
 void __iomem * reserve_phb_iospace(unsigned long size)
 {
        void __iomem *virt_addr;
@@ -329,8 +331,10 @@ void __iomem * reserve_phb_iospace(unsigned long size)
        if (phbs_io_bot >= IMALLOC_BASE) 
                panic("reserve_phb_iospace(): phb io space overflow\n");
                        
+       spin_lock(&phb_io_lock);
        virt_addr = (void __iomem *) phbs_io_bot;
        phbs_io_bot += size;
+       spin_unlock(&phb_io_lock);
 
        return virt_addr;
 }
-
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