diff mbox

[BUG] ARM: socfpga: L2 cache init

Message ID 20150225092657.GU8656@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux Feb. 25, 2015, 9:26 a.m. UTC
On Tue, Feb 24, 2015 at 05:55:05PM -0600, Dinh Nguyen wrote:
> Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Dinh Nguyen Feb. 25, 2015, 4:30 p.m. UTC | #1
On Wed, Feb 25, 2015 at 3:26 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Feb 24, 2015 at 05:55:05PM -0600, Dinh Nguyen wrote:
>> Do you have a recommendation on what should be done?
>
> Please try this:
>
>  arch/arm/mach-socfpga/socfpga.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
> index 383d61e138af..f5e597c207b9 100644
> --- a/arch/arm/mach-socfpga/socfpga.c
> +++ b/arch/arm/mach-socfpga/socfpga.c
> @@ -23,6 +23,7 @@
>  #include <asm/hardware/cache-l2x0.h>
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
> +#include <asm/cacheflush.h>
>
>  #include "core.h"
>
> @@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
>                         (u32 *) &socfpga_cpu1start_addr))
>                 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
>
> +       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
> +       smp_wmb();
> +       sync_cache_w(&socfpga_cpu1start_addr);
> +
>         sys_manager_base_addr = of_iomap(np, 0);
>
>         np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
>
> --


Thanks Russell! I have been able to run the test for > 30 minutes now
with both cores coming up just fine.

Do you mind taking this patch for 4.0-rc? If so,

Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>

Steffen, if you don't mind, do you want to test on your setup as well?

Thanks,
Dinh
Steffen Trumtrar Feb. 26, 2015, 8:30 a.m. UTC | #2
On Wed, Feb 25, 2015 at 10:30:32AM -0600, Dinh Nguyen wrote:
> On Wed, Feb 25, 2015 at 3:26 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Feb 24, 2015 at 05:55:05PM -0600, Dinh Nguyen wrote:
> >> Do you have a recommendation on what should be done?
> >
> > Please try this:
> >
> >  arch/arm/mach-socfpga/socfpga.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
> > index 383d61e138af..f5e597c207b9 100644
> > --- a/arch/arm/mach-socfpga/socfpga.c
> > +++ b/arch/arm/mach-socfpga/socfpga.c
> > @@ -23,6 +23,7 @@
> >  #include <asm/hardware/cache-l2x0.h>
> >  #include <asm/mach/arch.h>
> >  #include <asm/mach/map.h>
> > +#include <asm/cacheflush.h>
> >
> >  #include "core.h"
> >
> > @@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
> >                         (u32 *) &socfpga_cpu1start_addr))
> >                 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
> >
> > +       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
> > +       smp_wmb();
> > +       sync_cache_w(&socfpga_cpu1start_addr);
> > +
> >         sys_manager_base_addr = of_iomap(np, 0);
> >
> >         np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
> >
> > --
> 
> 
> Thanks Russell! I have been able to run the test for > 30 minutes now
> with both cores coming up just fine.
> 

\o/ That sounds very good.

> Do you mind taking this patch for 4.0-rc? If so,
> 
> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Steffen, if you don't mind, do you want to test on your setup as well?
> 

Yes, of course. Let's see how fast I can get my test running again,
my Sockit is at the Embedded World ATM :-(

Thanks,
Steffen
Steffen Trumtrar March 4, 2015, 10:23 a.m. UTC | #3
On Wed, Feb 25, 2015 at 10:30:32AM -0600, Dinh Nguyen wrote:
> On Wed, Feb 25, 2015 at 3:26 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Feb 24, 2015 at 05:55:05PM -0600, Dinh Nguyen wrote:
> >> Do you have a recommendation on what should be done?
> >
> > Please try this:
> >
> >  arch/arm/mach-socfpga/socfpga.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
> > index 383d61e138af..f5e597c207b9 100644
> > --- a/arch/arm/mach-socfpga/socfpga.c
> > +++ b/arch/arm/mach-socfpga/socfpga.c
> > @@ -23,6 +23,7 @@
> >  #include <asm/hardware/cache-l2x0.h>
> >  #include <asm/mach/arch.h>
> >  #include <asm/mach/map.h>
> > +#include <asm/cacheflush.h>
> >
> >  #include "core.h"
> >
> > @@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
> >                         (u32 *) &socfpga_cpu1start_addr))
> >                 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
> >
> > +       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
> > +       smp_wmb();
> > +       sync_cache_w(&socfpga_cpu1start_addr);
> > +
> >         sys_manager_base_addr = of_iomap(np, 0);
> >
> >         np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
> >
> > --
> 
> 
> Thanks Russell! I have been able to run the test for > 30 minutes now
> with both cores coming up just fine.
> 
> Do you mind taking this patch for 4.0-rc? If so,
> 
> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Steffen, if you don't mind, do you want to test on your setup as well?

Looks good for me, too:

Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>

Thanks,
Steffen
dinguyen@opensource.altera.com March 4, 2015, 6:37 p.m. UTC | #4
On 03/04/2015 04:23 AM, Steffen Trumtrar wrote:
> On Wed, Feb 25, 2015 at 10:30:32AM -0600, Dinh Nguyen wrote:
>> On Wed, Feb 25, 2015 at 3:26 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>>> On Tue, Feb 24, 2015 at 05:55:05PM -0600, Dinh Nguyen wrote:
>>>> Do you have a recommendation on what should be done?
>>>
>>> Please try this:
>>>
>>>  arch/arm/mach-socfpga/socfpga.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
>>> index 383d61e138af..f5e597c207b9 100644
>>> --- a/arch/arm/mach-socfpga/socfpga.c
>>> +++ b/arch/arm/mach-socfpga/socfpga.c
>>> @@ -23,6 +23,7 @@
>>>  #include <asm/hardware/cache-l2x0.h>
>>>  #include <asm/mach/arch.h>
>>>  #include <asm/mach/map.h>
>>> +#include <asm/cacheflush.h>
>>>
>>>  #include "core.h"
>>>
>>> @@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
>>>                         (u32 *) &socfpga_cpu1start_addr))
>>>                 pr_err("SMP: Need cpu1-start-addr in device tree.\n");
>>>
>>> +       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
>>> +       smp_wmb();
>>> +       sync_cache_w(&socfpga_cpu1start_addr);
>>> +
>>>         sys_manager_base_addr = of_iomap(np, 0);
>>>
>>>         np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
>>>
>>> --
>>
>>
>> Thanks Russell! I have been able to run the test for > 30 minutes now
>> with both cores coming up just fine.
>>
>> Do you mind taking this patch for 4.0-rc? If so,
>>
>> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Steffen, if you don't mind, do you want to test on your setup as well?
> 
> Looks good for me, too:
> 
> Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> 

Steffen, thanks for testing.

Russell, if you don't mind, I'll take this patch through my tree as I
have a couple of other fixes for 4.0-rc as well.

Thanks,
Dinh
Russell King - ARM Linux March 9, 2015, 5:15 p.m. UTC | #5
On Wed, Mar 04, 2015 at 12:37:26PM -0600, Dinh Nguyen wrote:
> On 03/04/2015 04:23 AM, Steffen Trumtrar wrote:
> > Looks good for me, too:
> > 
> > Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > 
> 
> Steffen, thanks for testing.
> 
> Russell, if you don't mind, I'll take this patch through my tree as I
> have a couple of other fixes for 4.0-rc as well.

That's fine, especially as I've been recovering post-op.
diff mbox

Patch

diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index 383d61e138af..f5e597c207b9 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -23,6 +23,7 @@ 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@  void __init socfpga_sysmgr_init(void)
 			(u32 *) &socfpga_cpu1start_addr))
 		pr_err("SMP: Need cpu1-start-addr in device tree.\n");
 
+	/* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+	smp_wmb();
+	sync_cache_w(&socfpga_cpu1start_addr);
+
 	sys_manager_base_addr = of_iomap(np, 0);
 
 	np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");