Skip to contentSkip to conversation

enable platform dependent MCA handling

PATCH In review Hidetoshi Seto 3 participants 5 messages Nov 11, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enable platform dependent MCA handling

Hi.

This is a patch that makes #ifdef mechanism in /arch/ia64/kernel/mca.c to work properly, and enable switching platform dependent error handling. For example, this supports OS to have an OEM call-back function for MCAs. Since this is a roughly scratched prototype, please give me your comments.

------

H.Seto <[email protected]>

diff -Nur linux-2.6.0-test9.org/arch/ia64/Kconfig
linux-2.6.0-test9/arch/ia64/Kconfig

arch/ia64/Kconfig 2003-11-10 16:52:37.257689953 +0900 renamed from arch/ia64/Kconfig 2003-10-26 03:44:46.000000000 +0900 +5 -0
@@ -250,6 +250,11 @@
    Say Y here to enable machine check support for IA-64.  If you're
    unsure, answer Y.
 
+config PLATFORM_MCA_HANDLERS
+ bool "Enable platform dependent error handling"
+ depends on IA64_MCA
+ default n
+
 config PM
  bool "Power Management support"
  depends on IA64_GENERIC || IA64_DIG || IA64_HP_ZX1

diff -Nur linux-2.6.0-test9.org/arch/ia64/kernel/Makefile linux-2.6.0-test9/arch/ia64/kernel/Makefile
--- linux-2.6.0-test9.org/arch/ia64/kernel/Makefile 2003-10-26 03:44:55.000000000 +0900
+++ linux-2.6.0-test9/arch/ia64/kernel/Makefile 2003-11-10 14:30:51.884747269 +0900
@@ -13,6 +13,7 @@
obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
obj-$(CONFIG_IA64_HP_ZX1) += acpi-ext.o
obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o
+obj-$(CONFIG_PLATFORM_MCA_HANDLERS) += plat_mca.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o
obj-$(CONFIG_IA64_SALINFO) += salinfo.o
obj-$(CONFIG_IOSAPIC) += iosapic.o
diff -Nur linux-2.6.0-test9.org/arch/ia64/kernel/mca.c linux-2.6.0-test9/arch/ia64/kernel/mca.c
--- linux-2.6.0-test9.org/arch/ia64/kernel/mca.c 2003-10-26 03:43:35.000000000 +0900
+++ linux-2.6.0-test9/arch/ia64/kernel/mca.c 2003-11-10 16:51:07.314331680 +0900 @@ -186,7 +186,18 @@
/*
* platform dependent error handling
*/
-#ifndef PLATFORM_MCA_HANDLERS
+#ifdef CONFIG_PLATFORM_MCA_HANDLERS
+extern void mca_handler_platform(void);
+extern irqreturn_t ia64_mca_cpe_int_handler(int cpe_t,
+ void *arg, struct pt_regs *ptregs);
+extern void init_handler_platform(pal_min_state_area_t *ms,
+ struct pt_regs *pt, struct switch_stack *sw);
+extern void ia64_mca_init_platform(void);
+extern int ia64_mca_check_errors(void);
+#ifdef CONFIG_ACPI
+extern void ia64_mca_register_cpev(int cpev);
+#endif /* CONFIG_ACPI */
+#else
void
mca_handler_platform (void)
{
@@ -461,7 +472,7 @@
}
#endif /* CONFIG_ACPI */

-#endif /* PLATFORM_MCA_HANDLERS */
+#endif /* CONFIG_PLATFORM_MCA_HANDLERS */

/*
* ia64_mca_cmc_vector_setup
diff -Nur linux-2.6.0-test9.org/arch/ia64/kernel/plat_mca.c linux-2.6.0-test9/arch/ia64/kernel/plat_mca.c
--- linux-2.6.0-test9.org/arch/ia64/kernel/plat_mca.c 1970-01-01 09:00:00.000000000 +0900
+++ linux-2.6.0-test9/arch/ia64/kernel/plat_mca.c 2003-11-10 16:51:35.258667275 +0900
@@ -0,0 +1,47 @@
+/*
+ * File: plat_mca.c
+ * Purpose: platform dependent error handling
+ *
+ */
+#include <linux/irq.h>
+#include <asm/ptrace.h>
+#include <asm/sal.h>
+
+void
+mca_handler_platform (void)
+{
+
+}
+
+irqreturn_t
+ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) +{
+
+}
+
+void
+init_handler_platform (pal_min_state_area_t *ms,
+ struct pt_regs *pt, struct switch_stack *sw)
+{
+
+}
+
+void
+ia64_mca_init_platform (void)
+{
+
+}
+
+int
+ia64_mca_check_errors (void)
+{
+
+}
+
+#ifdef CONFIG_ACPI
+void
+ia64_mca_register_cpev (int cpev)
+{
+
+}
+#endif /* CONFIG_ACPI */

#1 lore raw
Quoted 4 lines · Hidetoshi Seto

This is a patch that makes #ifdef mechanism in /arch/ia64/kernel/mca.c to work properly, and enable switching platform dependent error handling. For example, this supports OS to have an OEM call-back function for MCAs. Since this is a roughly scratched prototype, please give me your comments.

Defining any platform specific handlers at compile time is a problem for generic kernels. If you want a generic ia64 kernel (CONFIG_IA64_GENERIC=y) to run on any hardware then all the platform specific code should be chosen at run time, not at compile time. That is, use ia64_platform_is() to select platform specific code at run time.

#2 lore raw
In reply to Hidetoshi Seto
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Hidetoshi Seto

Hidetoshi> Hi. This is a patch that makes #ifdef mechanism in Hidetoshi> /arch/ia64/kernel/mca.c to work properly, and enable Hidetoshi> switching platform dependent error handling. For Hidetoshi> example, this supports OS to have an OEM call-back Hidetoshi> function for MCAs. Since this is a roughly scratched Hidetoshi> prototype, please give me your comments.

I think you ought to be machvecs for this purpose.

	--david
#3 lore raw
In reply to Hidetoshi Seto

I think it is more flexible that the plan that generic kernel have all the platform specific code and have choices at run time, Keith said. BTW, as doubt still I have, how I use this #ifdef in mca.c? Is it obsolete?

For the present, I'll try to use machvecs for this switching. I have read through machvec.h briefly, and I could find following three definitions:
platform_mca_init (maybe, for INIT)
platform_mca_handler (for MCA)
platform_cmci_handler (for CMCI)

...Are there any plans to implement "platform_cpei_handler (for CPEI)"? David?

Thanks.

------

H.Seto <[email protected]>

#4 lore raw
In reply to Hidetoshi Seto
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Hidetoshi Seto

Hidetoshi> I think it is more flexible that the plan that generic Hidetoshi> kernel have all the platform specific code and have Hidetoshi> choices at run time, Keith said.

That's what machvec gives you. The only question is whether some vendors will have to split up DIG into something more finer-grained.

Hidetoshi> ...Are there any plans to implement Hidetoshi> "platform_cpei_handler (for CPEI)"? David?

I'm not, but adding new (well-defined) machvec entries is fine (within reason).

	--david