* [PATCH 1/2] powerpc: Add spinlock to request_phb_iospace()
@ 2007-05-15 4:16 Benjamin Herrenschmidt
2007-05-15 4:26 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2007-05-15 4:16 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
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>
arch/powerpc/mm/pgtable_64.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-cell/arch/powerpc/mm/pgtable_64.c
===================================================================
--- linux-cell.orig/arch/powerpc/mm/pgtable_64.c 2007-05-15 13:17:59.000000000 +1000
+++ linux-cell/arch/powerpc/mm/pgtable_64.c 2007-05-15 13:18:32.000000000 +1000
@@ -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(unsig
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;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] powerpc: Add spinlock to request_phb_iospace()
2007-05-15 4:16 [PATCH 1/2] powerpc: Add spinlock to request_phb_iospace() Benjamin Herrenschmidt
@ 2007-05-15 4:26 ` Stephen Rothwell
2007-05-15 6:02 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2007-05-15 4:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras, Bergmann, Arnd
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
On Tue, 15 May 2007 14:16:26 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> 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)
What problem is this solving?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] powerpc: Add spinlock to request_phb_iospace()
2007-05-15 4:26 ` Stephen Rothwell
@ 2007-05-15 6:02 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2007-05-15 6:02 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, Paul Mackerras, Arnd Bergmann
On Tue, 2007-05-15 at 14:26 +1000, Stephen Rothwell wrote:
> On Tue, 15 May 2007 14:16:26 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > 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)
>
> What problem is this solving?
See the description of the next patch.
Ben.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-15 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15 4:16 [PATCH 1/2] powerpc: Add spinlock to request_phb_iospace() Benjamin Herrenschmidt
2007-05-15 4:26 ` Stephen Rothwell
2007-05-15 6:02 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).