提交 017e3c53 编写于 作者: B Benjamin Herrenschmidt 提交者: Paul Mackerras

[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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 6a32d085
...@@ -322,6 +322,8 @@ EXPORT_SYMBOL(__ioremap); ...@@ -322,6 +322,8 @@ EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(__iounmap); EXPORT_SYMBOL(__iounmap);
static DEFINE_SPINLOCK(phb_io_lock);
void __iomem * reserve_phb_iospace(unsigned long size) void __iomem * reserve_phb_iospace(unsigned long size)
{ {
void __iomem *virt_addr; void __iomem *virt_addr;
...@@ -329,8 +331,10 @@ void __iomem * reserve_phb_iospace(unsigned long size) ...@@ -329,8 +331,10 @@ void __iomem * reserve_phb_iospace(unsigned long size)
if (phbs_io_bot >= IMALLOC_BASE) if (phbs_io_bot >= IMALLOC_BASE)
panic("reserve_phb_iospace(): phb io space overflow\n"); panic("reserve_phb_iospace(): phb io space overflow\n");
spin_lock(&phb_io_lock);
virt_addr = (void __iomem *) phbs_io_bot; virt_addr = (void __iomem *) phbs_io_bot;
phbs_io_bot += size; phbs_io_bot += size;
spin_unlock(&phb_io_lock);
return virt_addr; return virt_addr;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册