* [patch 09/16] powerpc: Replace old style lock initializer
[not found] <20091106223547.784916750@linutronix.de>
@ 2009-11-06 22:41 ` Thomas Gleixner
2009-11-06 22:55 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2009-11-06 22:41 UTC (permalink / raw)
To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, linuxppc-dev
SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
instead.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
---
arch/powerpc/platforms/iseries/htab.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: linux-2.6/arch/powerpc/platforms/iseries/htab.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/htab.c
+++ linux-2.6/arch/powerpc/platforms/iseries/htab.c
@@ -19,8 +19,7 @@
#include "call_hpt.h"
-static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
- { [0 ... 63] = SPIN_LOCK_UNLOCKED};
+static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp;
/*
* Very primitive algorithm for picking up a lock
@@ -245,6 +244,11 @@ static void iSeries_hpte_invalidate(unsi
void __init hpte_init_iSeries(void)
{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(iSeries_hlocks); i++)
+ spin_lock_init(&iSeries_hlocks[i]);
+
ppc_md.hpte_invalidate = iSeries_hpte_invalidate;
ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 09/16] powerpc: Replace old style lock initializer
2009-11-06 22:41 ` [patch 09/16] powerpc: Replace old style lock initializer Thomas Gleixner
@ 2009-11-06 22:55 ` Benjamin Herrenschmidt
2009-11-08 7:55 ` Stephen Rothwell
2009-11-09 5:15 ` Stephen Rothwell
0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2009-11-06 22:55 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Peter Zijlstra, linuxppc-dev, Ingo Molnar, LKML
On Fri, 2009-11-06 at 22:41 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (power-replace-old-style-lock-init.patch)
> SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
> instead.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@ozlabs.org
> ---
Looks reasonable. But iseries can be a bitch, so we do need to test it
on monday.
Cheers,
Ben.
> arch/powerpc/platforms/iseries/htab.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/arch/powerpc/platforms/iseries/htab.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/platforms/iseries/htab.c
> +++ linux-2.6/arch/powerpc/platforms/iseries/htab.c
> @@ -19,8 +19,7 @@
>
> #include "call_hpt.h"
>
> -static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
> - { [0 ... 63] = SPIN_LOCK_UNLOCKED};
> +static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp;
>
> /*
> * Very primitive algorithm for picking up a lock
> @@ -245,6 +244,11 @@ static void iSeries_hpte_invalidate(unsi
>
> void __init hpte_init_iSeries(void)
> {
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(iSeries_hlocks); i++)
> + spin_lock_init(&iSeries_hlocks[i]);
> +
> ppc_md.hpte_invalidate = iSeries_hpte_invalidate;
> ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
> ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 09/16] powerpc: Replace old style lock initializer
2009-11-06 22:55 ` Benjamin Herrenschmidt
@ 2009-11-08 7:55 ` Stephen Rothwell
2009-11-09 5:15 ` Stephen Rothwell
1 sibling, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2009-11-08 7:55 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Peter Zijlstra, linuxppc-dev, Thomas Gleixner, Ingo Molnar, LKML
[-- Attachment #1: Type: text/plain, Size: 929 bytes --]
Hi Ben,
On Sat, 07 Nov 2009 09:55:44 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> Looks reasonable. But iseries can be a bitch, so we do need to test it
> on monday.
It should be safe as the spinlocks cannot be access until after the
following ppc_md pointer initialisations are done (and all this happens
before the secondary CPUs are started).
But, you are right that there is nothing like actually testing with
iSeries. :-)
> > void __init hpte_init_iSeries(void)
> > {
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(iSeries_hlocks); i++)
> > + spin_lock_init(&iSeries_hlocks[i]);
> > +
> > ppc_md.hpte_invalidate = iSeries_hpte_invalidate;
> > ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
> > ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 09/16] powerpc: Replace old style lock initializer
2009-11-06 22:55 ` Benjamin Herrenschmidt
2009-11-08 7:55 ` Stephen Rothwell
@ 2009-11-09 5:15 ` Stephen Rothwell
2009-11-09 8:53 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2009-11-09 5:15 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Peter Zijlstra, Ingo Molnar, LKML, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 755 bytes --]
Hi Thomas,
On Sat, 07 Nov 2009 09:55:44 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> On Fri, 2009-11-06 at 22:41 +0000, Thomas Gleixner wrote:
> > plain text document attachment
> > (power-replace-old-style-lock-init.patch)
> > SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
> > instead.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: linuxppc-dev@ozlabs.org
> > ---
>
> Looks reasonable. But iseries can be a bitch, so we do need to test it
> on monday.
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 09/16] powerpc: Replace old style lock initializer
2009-11-09 5:15 ` Stephen Rothwell
@ 2009-11-09 8:53 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2009-11-09 8:53 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Peter Zijlstra, linuxppc-dev, Thomas Gleixner, Ingo Molnar, LKML
On Mon, 2009-11-09 at 16:15 +1100, Stephen Rothwell wrote:
> Hi Thomas,
>
> On Sat, 07 Nov 2009 09:55:44 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > On Fri, 2009-11-06 at 22:41 +0000, Thomas Gleixner wrote:
> > > plain text document attachment
> > > (power-replace-old-style-lock-init.patch)
> > > SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
> > > instead.
> > >
> > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > Cc: linuxppc-dev@ozlabs.org
> > > ---
> >
> > Looks reasonable. But iseries can be a bitch, so we do need to test it
> > on monday.
>
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Thanks Stephen !
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-09 8:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091106223547.784916750@linutronix.de>
2009-11-06 22:41 ` [patch 09/16] powerpc: Replace old style lock initializer Thomas Gleixner
2009-11-06 22:55 ` Benjamin Herrenschmidt
2009-11-08 7:55 ` Stephen Rothwell
2009-11-09 5:15 ` Stephen Rothwell
2009-11-09 8:53 ` 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).