diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-05-15 00:16:26 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-17 07:11:14 -0400 |
commit | 017e3c53f116d6a0741a21624924528dc9f98418 (patch) | |
tree | c9e378349c82d6697c443dfbf62a142a9162d353 /arch/powerpc/mm/pgtable_64.c | |
parent | 6a32d085ae71724edffa30fcd2045520a051cb14 (diff) |
[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 <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | 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 1d443407423c..ad6e135bf212 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -322,6 +322,8 @@ EXPORT_SYMBOL(__ioremap); | |||
322 | EXPORT_SYMBOL(iounmap); | 322 | EXPORT_SYMBOL(iounmap); |
323 | EXPORT_SYMBOL(__iounmap); | 323 | EXPORT_SYMBOL(__iounmap); |
324 | 324 | ||
325 | static DEFINE_SPINLOCK(phb_io_lock); | ||
326 | |||
325 | void __iomem * reserve_phb_iospace(unsigned long size) | 327 | void __iomem * reserve_phb_iospace(unsigned long size) |
326 | { | 328 | { |
327 | void __iomem *virt_addr; | 329 | void __iomem *virt_addr; |
@@ -329,8 +331,10 @@ void __iomem * reserve_phb_iospace(unsigned long size) | |||
329 | if (phbs_io_bot >= IMALLOC_BASE) | 331 | if (phbs_io_bot >= IMALLOC_BASE) |
330 | panic("reserve_phb_iospace(): phb io space overflow\n"); | 332 | panic("reserve_phb_iospace(): phb io space overflow\n"); |
331 | 333 | ||
334 | spin_lock(&phb_io_lock); | ||
332 | virt_addr = (void __iomem *) phbs_io_bot; | 335 | virt_addr = (void __iomem *) phbs_io_bot; |
333 | phbs_io_bot += size; | 336 | phbs_io_bot += size; |
337 | spin_unlock(&phb_io_lock); | ||
334 | 338 | ||
335 | return virt_addr; | 339 | return virt_addr; |
336 | } | 340 | } |