Patchwork sparc64: Fix NMI startup bug which also breaks perf.

login
register
mail settings
Submitter David Miller
Date Feb. 15, 2011, 11:05 p.m.
Message ID <20110215.150500.28828108.davem@davemloft.net>
Download mbox | patch
Permalink /patch/83310/
State Accepted
Delegated to: David Miller
Headers show

Comments

David Miller - Feb. 15, 2011, 11:05 p.m.
Doing NMI startup as an early initcall doesn't work because we need
to have SMP started up by then.

So we'd only NMI startup one cpu, which causes perf PMU grab to
BUG because the nmi_active count isn't what it's supposed to be.

This also points out that we don't have proper CPU up/down notifiers
for the NMI code which will need to be fixed at some point.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/include/asm/pcr.h |    2 ++
 arch/sparc/kernel/pcr.c      |    2 --
 arch/sparc/kernel/smp_64.c   |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
Leif Sawyer - Feb. 15, 2011, 11:38 p.m.
My poor 14yo sparc finally bit the dust -- 
well, actually, the battery in the prom finally gave up and lost
its config during the last power-cycle.

So, now I'm looking for a replacement M48T59Y-70PC1  from some reputible dealer,
and preferably one that one cost an extra 50$ just to ship to Alaska...


I've already migrated my services off of this, so I'm really not sure
why I need to bring it back from the dead, except possibly to make it available
for remote compiling/testing if wanted...

Otherwise, it may just end up on the corporate scrap heap.

--
leif


--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Julian Calaby - Feb. 16, 2011, 12:02 a.m.
On Wed, Feb 16, 2011 at 10:38, Leif Sawyer <lsawyer@gci.com> wrote:
> My poor 14yo sparc finally bit the dust --
> well, actually, the battery in the prom finally gave up and lost
> its config during the last power-cycle.
>
> So, now I'm looking for a replacement M48T59Y-70PC1  from some reputible dealer,
> and preferably one that one cost an extra 50$ just to ship to Alaska...

There is a hack to replace the battery. [1] I've got a SSLX with a
similar issue which needs that, but haven't gotten around to doing it
yet. Also remember that you're going to have to re-program the chip as
it contains some important config information.

> I've already migrated my services off of this, so I'm really not sure
> why I need to bring it back from the dead, except possibly to make it available
> for remote compiling/testing if wanted...
>
> Otherwise, it may just end up on the corporate scrap heap.

If you were in south eastern Australia, I'd offer to take it off your
hands, but I think Alaska is a little far to drive.

Thanks,

[1] http://www.rotteneggsx.com/r3/show/se/321442.html
David Miller - Feb. 16, 2011, 1:31 a.m.
From: Julian Calaby <julian.calaby@gmail.com>
Date: Wed, 16 Feb 2011 11:02:15 +1100

> On Wed, Feb 16, 2011 at 10:38, Leif Sawyer <lsawyer@gci.com> wrote:
>> My poor 14yo sparc finally bit the dust --
>> well, actually, the battery in the prom finally gave up and lost
>> its config during the last power-cycle.
>>
>> So, now I'm looking for a replacement M48T59Y-70PC1  from some reputible dealer,
>> and preferably one that one cost an extra 50$ just to ship to Alaska...
> 
> There is a hack to replace the battery. [1] I've got a SSLX with a
> similar issue which needs that, but haven't gotten around to doing it
> yet. Also remember that you're going to have to re-program the chip as
> it contains some important config information.

Whilst sparc32 chips absolutely need this config information set
properly (it contains the system type value), on sparc64 systems it
only really carries the date and the ethernet address.

And then of course the checksum has to be set correctly after
you've filled it in :-)
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Newport - Feb. 16, 2011, 11:35 p.m.
Do not dispair.
There is a FAQ on the eeprom/nvram including how to fix and reprogram 
them.
http://www.squirrel.com/sun-nvram-hostid.faq.html


On Tue, 15 Feb 2011, David Miller wrote:

> From: Julian Calaby <julian.calaby@gmail.com>
> Date: Wed, 16 Feb 2011 11:02:15 +1100
>
>> On Wed, Feb 16, 2011 at 10:38, Leif Sawyer <lsawyer@gci.com> wrote:
>>> My poor 14yo sparc finally bit the dust --
>>> well, actually, the battery in the prom finally gave up and lost
>>> its config during the last power-cycle.
>>>
>>> So, now I'm looking for a replacement M48T59Y-70PC1  from some reputible dealer,
>>> and preferably one that one cost an extra 50$ just to ship to Alaska...
>>
>> There is a hack to replace the battery. [1] I've got a SSLX with a
>> similar issue which needs that, but haven't gotten around to doing it
>> yet. Also remember that you're going to have to re-program the chip as
>> it contains some important config information.
>
> Whilst sparc32 chips absolutely need this config information set
> properly (it contains the system type value), on sparc64 systems it
> only really carries the date and the ethernet address.
>
> And then of course the checksum has to be set correctly after
> you've filled it in :-)
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Patch

diff --git a/arch/sparc/include/asm/pcr.h b/arch/sparc/include/asm/pcr.h
index a2f5c61..843e4fa 100644
--- a/arch/sparc/include/asm/pcr.h
+++ b/arch/sparc/include/asm/pcr.h
@@ -43,4 +43,6 @@  static inline u64 picl_value(unsigned int nmi_hz)
 
 extern u64 pcr_enable;
 
+extern int pcr_arch_init(void);
+
 #endif /* __PCR_H */
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
index ae96cf5..7c2ced6 100644
--- a/arch/sparc/kernel/pcr.c
+++ b/arch/sparc/kernel/pcr.c
@@ -167,5 +167,3 @@  out_unregister:
 	unregister_perf_hsvc();
 	return err;
 }
-
-early_initcall(pcr_arch_init);
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index b6a2b8f..555a76d 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -49,6 +49,7 @@ 
 #include <asm/mdesc.h>
 #include <asm/ldc.h>
 #include <asm/hypervisor.h>
+#include <asm/pcr.h>
 
 #include "cpumap.h"
 
@@ -1358,6 +1359,7 @@  void __cpu_die(unsigned int cpu)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
+	pcr_arch_init();
 }
 
 void smp_send_reschedule(int cpu)