* [Linux-ia64] [patch] 2.4.21-rc1 SAL MCA timeout
@ 2003-05-06 5:02 Keith Owens
2003-05-13 22:48 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Keith Owens @ 2003-05-06 5:02 UTC (permalink / raw)
To: linux-ia64
SAL can reject an MCA rendezvous timeout value and require a different
value. The new value is part of the SAL return value structure so the
full structure must be returned by ia64_sal_mc_set_params.
diff -ur 2.4.21-rc1-ia64.orig/include/asm-ia64/sal.h 2.4.21-rc1-ia64/include/asm-ia64/sal.h
--- 2.4.21-rc1-ia64.orig/include/asm-ia64/sal.h Tue May 6 12:18:43 2003
+++ 2.4.21-rc1-ia64/include/asm-ia64/sal.h Tue May 6 14:56:37 2003
@@ -711,14 +711,15 @@
* Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during
* the machine check rendezvous sequence as well as the mechanism to wake up the
* non-monarch processor at the end of machine check processing.
+ * Returns the complete ia64_sal_retval, some calls return more than just a status value.
*/
-static inline s64
+static inline struct ia64_sal_retval
ia64_sal_mc_set_params (u64 param_type, u64 i_or_m, u64 i_or_m_val, u64 timeout, u64 rz_always)
{
struct ia64_sal_retval isrv;
SAL_CALL(isrv, SAL_MC_SET_PARAMS, param_type, i_or_m, i_or_m_val,
timeout, rz_always, 0, 0);
- return isrv.status;
+ return isrv;
}
/* Read from PCI configuration space */
diff -ur 2.4.21-rc1-ia64.orig/arch/ia64/kernel/mca.c 2.4.21-rc1-ia64/arch/ia64/kernel/mca.c
--- 2.4.21-rc1-ia64.orig/arch/ia64/kernel/mca.c Tue May 6 12:18:41 2003
+++ 2.4.21-rc1-ia64/arch/ia64/kernel/mca.c Tue May 6 14:57:39 2003
@@ -404,8 +404,10 @@
ia64_mca_register_cpev (int cpev)
{
/* Register the CPE interrupt vector with SAL */
- if (ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0)) {
- printk(KERN_ERR "ia64_mca_platform_init: failed to register Corrected "
+ struct ia64_sal_retval isrv;
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0);
+ if (isrv.status) {
+ printk("ia64_mca_platform_init: failed to register Corrected "
"Platform Error interrupt vector with SAL.\n");
return;
}
@@ -602,6 +604,12 @@
ia64_fptr_t *mca_hldlr_ptr = (ia64_fptr_t *)ia64_os_mca_dispatch;
int i;
s64 rc;
+ struct ia64_sal_retval isrv;
+ u64 timeout = IA64_MCA_RENDEZ_TIMEOUT; /* platform specific */
+ u64 mca_flags = SAL_MC_PARAM_RZ_ALWAYS; /* platform specific */
+#ifdef CONFIG_IA64_SGI_SN
+ mca_flags |= 0x8; /* SGI prom specific */
+#endif
IA64_MCA_DEBUG("ia64_mca_init: begin\n");
@@ -617,23 +625,34 @@
*/
/* Register the rendezvous interrupt vector with SAL */
- if ((rc = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_INT,
- SAL_MC_PARAM_MECHANISM_INT,
- IA64_MCA_RENDEZ_VECTOR,
- IA64_MCA_RENDEZ_TIMEOUT,
- SAL_MC_PARAM_RZ_ALWAYS)))
- {
+ while (1) {
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_INT,
+ SAL_MC_PARAM_MECHANISM_INT,
+ IA64_MCA_RENDEZ_VECTOR,
+ timeout,
+ mca_flags);
+ rc = isrv.status;
+ if (rc = 0)
+ break;
+ if (rc = -2) {
+ printk(KERN_INFO
+ "ia64_mca_init: increasing mca rendezvous timeout from %ld to %ld\n",
+ timeout, isrv.v0);
+ timeout = isrv.v0;
+ continue;
+ }
printk(KERN_ERR "ia64_mca_init: Failed to register rendezvous interrupt "
"with SAL. rc = %ld\n", rc);
return;
}
/* Register the wakeup interrupt vector with SAL */
- if ((rc = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_WAKEUP,
- SAL_MC_PARAM_MECHANISM_INT,
- IA64_MCA_WAKEUP_VECTOR,
- 0, 0)))
- {
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_WAKEUP,
+ SAL_MC_PARAM_MECHANISM_INT,
+ IA64_MCA_WAKEUP_VECTOR,
+ 0, 0);
+ rc = isrv.status;
+ if (rc) {
printk(KERN_ERR "ia64_mca_init: Failed to register wakeup interrupt with SAL. "
"rc = %ld\n", rc);
return;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Linux-ia64] [patch] 2.4.21-rc1 SAL MCA timeout
2003-05-06 5:02 [Linux-ia64] [patch] 2.4.21-rc1 SAL MCA timeout Keith Owens
@ 2003-05-13 22:48 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2003-05-13 22:48 UTC (permalink / raw)
To: linux-ia64
On Monday 05 May 2003 11:02 pm, Keith Owens wrote:
> SAL can reject an MCA rendezvous timeout value and require a different
> value. The new value is part of the SAL return value structure so the
> full structure must be returned by ia64_sal_mc_set_params.
I applied this for 2.4, except that I made a couple whitespace changes
and left out the SGI-specific flags value. I hesitate to add more
platform-specific #ifdefs, and I think the SN kernel still requires
extra patches anyway, so I figured that change could go in there.
Here's the actual patch I applied:
#### AUTHOR kaos@sgi.com
#### COMMENT START
### Comments for ChangeSet
ia64: Handle SAL rejection of MCA rendezvous timeout value.
### Comments for arch/ia64/kernel/mca.c
(ia64_mca_init): Handle SAL rejection of MCA rendezvous timeout value.
### Comments for include/asm-ia64/sal.h
(ia64_sal_mc_set_params): Return struct ia64_sal_retval because sometimes
more than just status value is returned.
#### COMMENT END
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1144 -> 1.1145
# arch/ia64/kernel/mca.c 1.24 -> 1.25
# include/asm-ia64/sal.h 1.12 -> 1.13
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/13 bjorn_helgaas@hp.com 1.1145
# ia64: Handle SAL rejection of MCA rendezvous timeout value.
# --------------------------------------------
#
diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
--- a/arch/ia64/kernel/mca.c Tue May 13 16:18:17 2003
+++ b/arch/ia64/kernel/mca.c Tue May 13 16:18:17 2003
@@ -404,7 +404,10 @@
ia64_mca_register_cpev (int cpev)
{
/* Register the CPE interrupt vector with SAL */
- if (ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0)) {
+ struct ia64_sal_retval isrv;
+
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0);
+ if (isrv.status) {
printk(KERN_ERR "ia64_mca_platform_init: failed to register Corrected "
"Platform Error interrupt vector with SAL.\n");
return;
@@ -602,6 +605,8 @@
ia64_fptr_t *mca_hldlr_ptr = (ia64_fptr_t *)ia64_os_mca_dispatch;
int i;
s64 rc;
+ struct ia64_sal_retval isrv;
+ u64 timeout = IA64_MCA_RENDEZ_TIMEOUT; /* platform specific */
IA64_MCA_DEBUG("ia64_mca_init: begin\n");
@@ -617,23 +622,33 @@
*/
/* Register the rendezvous interrupt vector with SAL */
- if ((rc = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_INT,
- SAL_MC_PARAM_MECHANISM_INT,
- IA64_MCA_RENDEZ_VECTOR,
- IA64_MCA_RENDEZ_TIMEOUT,
- SAL_MC_PARAM_RZ_ALWAYS)))
- {
+ while (1) {
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_INT,
+ SAL_MC_PARAM_MECHANISM_INT,
+ IA64_MCA_RENDEZ_VECTOR,
+ timeout,
+ SAL_MC_PARAM_RZ_ALWAYS);
+ rc = isrv.status;
+ if (rc = 0)
+ break;
+ if (rc = -2) {
+ printk(KERN_INFO "ia64_mca_init: increasing MCA rendezvous timeout from "
+ "%ld to %ld\n", timeout, isrv.v0);
+ timeout = isrv.v0;
+ continue;
+ }
printk(KERN_ERR "ia64_mca_init: Failed to register rendezvous interrupt "
"with SAL. rc = %ld\n", rc);
return;
}
/* Register the wakeup interrupt vector with SAL */
- if ((rc = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_WAKEUP,
- SAL_MC_PARAM_MECHANISM_INT,
- IA64_MCA_WAKEUP_VECTOR,
- 0, 0)))
- {
+ isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_RENDEZ_WAKEUP,
+ SAL_MC_PARAM_MECHANISM_INT,
+ IA64_MCA_WAKEUP_VECTOR,
+ 0, 0);
+ rc = isrv.status;
+ if (rc) {
printk(KERN_ERR "ia64_mca_init: Failed to register wakeup interrupt with SAL. "
"rc = %ld\n", rc);
return;
diff -Nru a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
--- a/include/asm-ia64/sal.h Tue May 13 16:18:17 2003
+++ b/include/asm-ia64/sal.h Tue May 13 16:18:17 2003
@@ -711,14 +711,16 @@
* Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during
* the machine check rendezvous sequence as well as the mechanism to wake up the
* non-monarch processor at the end of machine check processing.
+ * Returns the complete ia64_sal_retval because some calls return more than just a status
+ * value.
*/
-static inline s64
+static inline struct ia64_sal_retval
ia64_sal_mc_set_params (u64 param_type, u64 i_or_m, u64 i_or_m_val, u64 timeout, u64 rz_always)
{
struct ia64_sal_retval isrv;
SAL_CALL(isrv, SAL_MC_SET_PARAMS, param_type, i_or_m, i_or_m_val,
timeout, rz_always, 0, 0);
- return isrv.status;
+ return isrv;
}
/* Read from PCI configuration space */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-13 22:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 5:02 [Linux-ia64] [patch] 2.4.21-rc1 SAL MCA timeout Keith Owens
2003-05-13 22:48 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox