Commit ae2057b6 authored by Keith Owens's avatar Keith Owens Committed by David Mosberger

[PATCH] ia64: mca.c cleanup - Bjorn's printk cleanup

parent 283acab4
...@@ -76,6 +76,12 @@ ...@@ -76,6 +76,12 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#if defined(IA64_MCA_DEBUG_INFO)
# define IA64_MCA_DEBUG(fmt...) printk(fmt)
#else
# define IA64_MCA_DEBUG(fmt...)
#endif
typedef struct ia64_fptr { typedef struct ia64_fptr {
unsigned long fp; unsigned long fp;
unsigned long gp; unsigned long gp;
...@@ -215,8 +221,8 @@ ia64_log_get(int sal_info_type, u8 **buffer) ...@@ -215,8 +221,8 @@ ia64_log_get(int sal_info_type, u8 **buffer)
IA64_LOG_INDEX_INC(sal_info_type); IA64_LOG_INDEX_INC(sal_info_type);
IA64_LOG_UNLOCK(sal_info_type); IA64_LOG_UNLOCK(sal_info_type);
if (irq_safe) { if (irq_safe) {
IA64_MCA_DEBUG("ia64_log_get: SAL error record type %d retrieved. " IA64_MCA_DEBUG("%s: SAL error record type %d retrieved. "
"Record length = %ld\n", sal_info_type, total_len); "Record length = %ld\n", __FUNCTION__, sal_info_type, total_len);
} }
*buffer = (u8 *) log_buffer; *buffer = (u8 *) log_buffer;
return total_len; return total_len;
...@@ -267,8 +273,8 @@ ia64_mca_log_sal_error_record(int sal_info_type, int called_from_init) ...@@ -267,8 +273,8 @@ ia64_mca_log_sal_error_record(int sal_info_type, int called_from_init)
static irqreturn_t static irqreturn_t
ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
{ {
IA64_MCA_DEBUG("ia64_mca_cpe_int_handler: received interrupt. CPU:%d vector = %#x\n", IA64_MCA_DEBUG("%s: received interrupt. CPU:%d vector = %#x\n",
smp_processor_id(), cpe_irq); __FUNCTION__, smp_processor_id(), cpe_irq);
/* SAL spec states this should run w/ interrupts enabled */ /* SAL spec states this should run w/ interrupts enabled */
local_irq_enable(); local_irq_enable();
...@@ -509,13 +515,13 @@ ia64_mca_register_cpev (int cpev) ...@@ -509,13 +515,13 @@ ia64_mca_register_cpev (int cpev)
isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0); isrv = ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0);
if (isrv.status) { if (isrv.status) {
printk(KERN_ERR "ia64_mca_platform_init: failed to register Corrected " printk(KERN_ERR "Failed to register Corrected Platform "
"Platform Error interrupt vector with SAL.\n"); "Error interrupt vector with SAL (status %ld)\n", isrv.status);
return; return;
} }
IA64_MCA_DEBUG("ia64_mca_platform_init: corrected platform error " IA64_MCA_DEBUG("%s: corrected platform error "
"vector %#x setup and enabled\n", cpev); "vector %#x setup and enabled\n", __FUNCTION__, cpev);
} }
#endif /* CONFIG_ACPI */ #endif /* CONFIG_ACPI */
...@@ -543,12 +549,12 @@ ia64_mca_cmc_vector_setup (void) ...@@ -543,12 +549,12 @@ ia64_mca_cmc_vector_setup (void)
cmcv.cmcv_vector = IA64_CMC_VECTOR; cmcv.cmcv_vector = IA64_CMC_VECTOR;
ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
IA64_MCA_DEBUG("ia64_mca_platform_init: CPU %d corrected " IA64_MCA_DEBUG("%s: CPU %d corrected "
"machine check vector %#x setup and enabled.\n", "machine check vector %#x setup and enabled.\n",
smp_processor_id(), IA64_CMC_VECTOR); __FUNCTION__, smp_processor_id(), IA64_CMC_VECTOR);
IA64_MCA_DEBUG("ia64_mca_platform_init: CPU %d CMCV = %#016lx\n", IA64_MCA_DEBUG("%s: CPU %d CMCV = %#016lx\n",
smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV)); __FUNCTION__, smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV));
} }
/* /*
...@@ -573,9 +579,9 @@ ia64_mca_cmc_vector_disable (void *dummy) ...@@ -573,9 +579,9 @@ ia64_mca_cmc_vector_disable (void *dummy)
cmcv.cmcv_mask = 1; /* Mask/disable interrupt */ cmcv.cmcv_mask = 1; /* Mask/disable interrupt */
ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval) ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval)
IA64_MCA_DEBUG("ia64_mca_cmc_vector_disable: CPU %d corrected " IA64_MCA_DEBUG("%s: CPU %d corrected "
"machine check vector %#x disabled.\n", "machine check vector %#x disabled.\n",
smp_processor_id(), cmcv.cmcv_vector); __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector);
} }
/* /*
...@@ -600,9 +606,9 @@ ia64_mca_cmc_vector_enable (void *dummy) ...@@ -600,9 +606,9 @@ ia64_mca_cmc_vector_enable (void *dummy)
cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */
ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval) ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval)
IA64_MCA_DEBUG("ia64_mca_cmc_vector_enable: CPU %d corrected " IA64_MCA_DEBUG("%s: CPU %d corrected "
"machine check vector %#x enabled.\n", "machine check vector %#x enabled.\n",
smp_processor_id(), cmcv.cmcv_vector); __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector);
} }
/* /*
...@@ -865,8 +871,8 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs) ...@@ -865,8 +871,8 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs)
static int index; static int index;
static spinlock_t cmc_history_lock = SPIN_LOCK_UNLOCKED; static spinlock_t cmc_history_lock = SPIN_LOCK_UNLOCKED;
IA64_MCA_DEBUG("ia64_mca_cmc_int_handler: received interrupt vector = %#x on CPU %d\n", IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n",
cmc_irq, smp_processor_id()); __FUNCTION__, cmc_irq, smp_processor_id());
/* SAL spec states this should run w/ interrupts enabled */ /* SAL spec states this should run w/ interrupts enabled */
local_irq_enable(); local_irq_enable();
...@@ -896,7 +902,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs) ...@@ -896,7 +902,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs)
* make sure there's a log somewhere that indicates * make sure there's a log somewhere that indicates
* something is generating more than we can handle. * something is generating more than we can handle.
*/ */
printk(KERN_WARNING "%s: WARNING: Switching to polling CMC handler, error records may be lost\n", __FUNCTION__); printk(KERN_WARNING "WARNING: Switching to polling CMC handler; error records may be lost\n");
mod_timer(&cmc_poll_timer, jiffies + CMC_POLL_INTERVAL); mod_timer(&cmc_poll_timer, jiffies + CMC_POLL_INTERVAL);
...@@ -948,7 +954,7 @@ ia64_mca_cmc_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs) ...@@ -948,7 +954,7 @@ ia64_mca_cmc_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
/* If no log record, switch out of polling mode */ /* If no log record, switch out of polling mode */
if (start_count == IA64_LOG_COUNT(SAL_INFO_TYPE_CMC)) { if (start_count == IA64_LOG_COUNT(SAL_INFO_TYPE_CMC)) {
printk(KERN_WARNING "%s: Returning to interrupt driven CMC handler\n", __FUNCTION__); printk(KERN_WARNING "Returning to interrupt driven CMC handler\n");
schedule_work(&cmc_enable_work); schedule_work(&cmc_enable_work);
cmc_polling_enabled = 0; cmc_polling_enabled = 0;
...@@ -1156,7 +1162,7 @@ ia64_mca_init(void) ...@@ -1156,7 +1162,7 @@ ia64_mca_init(void)
struct ia64_sal_retval isrv; struct ia64_sal_retval isrv;
u64 timeout = IA64_MCA_RENDEZ_TIMEOUT; /* platform specific */ u64 timeout = IA64_MCA_RENDEZ_TIMEOUT; /* platform specific */
IA64_MCA_DEBUG("ia64_mca_init: begin\n"); IA64_MCA_DEBUG("%s: begin\n", __FUNCTION__);
/* Clear the Rendez checkin flag for all cpus */ /* Clear the Rendez checkin flag for all cpus */
for(i = 0 ; i < NR_CPUS; i++) for(i = 0 ; i < NR_CPUS; i++)
...@@ -1177,13 +1183,13 @@ ia64_mca_init(void) ...@@ -1177,13 +1183,13 @@ ia64_mca_init(void)
if (rc == 0) if (rc == 0)
break; break;
if (rc == -2) { if (rc == -2) {
printk(KERN_INFO "ia64_mca_init: increasing MCA rendezvous timeout from " printk(KERN_INFO "Increasing MCA rendezvous timeout from "
"%ld to %ld\n", timeout, isrv.v0); "%ld to %ld milliseconds\n", timeout, isrv.v0);
timeout = isrv.v0; timeout = isrv.v0;
continue; continue;
} }
printk(KERN_ERR "ia64_mca_init: Failed to register rendezvous interrupt " printk(KERN_ERR "Failed to register rendezvous interrupt "
"with SAL. rc = %ld\n", rc); "with SAL (status %ld)\n", rc);
return; return;
} }
...@@ -1194,12 +1200,12 @@ ia64_mca_init(void) ...@@ -1194,12 +1200,12 @@ ia64_mca_init(void)
0, 0); 0, 0);
rc = isrv.status; rc = isrv.status;
if (rc) { if (rc) {
printk(KERN_ERR "ia64_mca_init: Failed to register wakeup interrupt with SAL. " printk(KERN_ERR "Failed to register wakeup interrupt with SAL "
"rc = %ld\n", rc); "(status %ld)\n", rc);
return; return;
} }
IA64_MCA_DEBUG("ia64_mca_init: registered mca rendezvous spinloop and wakeup mech.\n"); IA64_MCA_DEBUG("%s: registered MCA rendezvous spinloop and wakeup mech.\n", __FUNCTION__);
ia64_mc_info.imi_mca_handler = ia64_tpa(mca_hldlr_ptr->fp); ia64_mc_info.imi_mca_handler = ia64_tpa(mca_hldlr_ptr->fp);
/* /*
...@@ -1215,12 +1221,12 @@ ia64_mca_init(void) ...@@ -1215,12 +1221,12 @@ ia64_mca_init(void)
ia64_mc_info.imi_mca_handler_size, ia64_mc_info.imi_mca_handler_size,
0, 0, 0))) 0, 0, 0)))
{ {
printk(KERN_ERR "ia64_mca_init: Failed to register os mca handler with SAL. " printk(KERN_ERR "Failed to register OS MCA handler with SAL "
"rc = %ld\n", rc); "(status %ld)\n", rc);
return; return;
} }
IA64_MCA_DEBUG("ia64_mca_init: registered os mca handler with SAL at 0x%lx, gp = 0x%lx\n", IA64_MCA_DEBUG("%s: registered OS MCA handler with SAL at 0x%lx, gp = 0x%lx\n", __FUNCTION__,
ia64_mc_info.imi_mca_handler, ia64_tpa(mca_hldlr_ptr->gp)); ia64_mc_info.imi_mca_handler, ia64_tpa(mca_hldlr_ptr->gp));
/* /*
...@@ -1232,7 +1238,7 @@ ia64_mca_init(void) ...@@ -1232,7 +1238,7 @@ ia64_mca_init(void)
ia64_mc_info.imi_slave_init_handler = ia64_tpa(slave_init_ptr->fp); ia64_mc_info.imi_slave_init_handler = ia64_tpa(slave_init_ptr->fp);
ia64_mc_info.imi_slave_init_handler_size = 0; ia64_mc_info.imi_slave_init_handler_size = 0;
IA64_MCA_DEBUG("ia64_mca_init: os init handler at %lx\n", IA64_MCA_DEBUG("%s: OS INIT handler at %lx\n", __FUNCTION__,
ia64_mc_info.imi_monarch_init_handler); ia64_mc_info.imi_monarch_init_handler);
/* Register the os init handler with SAL */ /* Register the os init handler with SAL */
...@@ -1244,12 +1250,12 @@ ia64_mca_init(void) ...@@ -1244,12 +1250,12 @@ ia64_mca_init(void)
ia64_tpa(ia64_getreg(_IA64_REG_GP)), ia64_tpa(ia64_getreg(_IA64_REG_GP)),
ia64_mc_info.imi_slave_init_handler_size))) ia64_mc_info.imi_slave_init_handler_size)))
{ {
printk(KERN_ERR "ia64_mca_init: Failed to register m/s init handlers with SAL. " printk(KERN_ERR "Failed to register m/s INIT handlers with SAL "
"rc = %ld\n", rc); "(status %ld)\n", rc);
return; return;
} }
IA64_MCA_DEBUG("ia64_mca_init: registered os init handler with SAL\n"); IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __FUNCTION__);
/* /*
* Configure the CMCI/P vector and handler. Interrupts for CMC are * Configure the CMCI/P vector and handler. Interrupts for CMC are
...@@ -1294,7 +1300,7 @@ ia64_mca_init(void) ...@@ -1294,7 +1300,7 @@ ia64_mca_init(void)
ia64_log_init(SAL_INFO_TYPE_CMC); ia64_log_init(SAL_INFO_TYPE_CMC);
ia64_log_init(SAL_INFO_TYPE_CPE); ia64_log_init(SAL_INFO_TYPE_CPE);
printk(KERN_INFO "Mca related initialization done\n"); printk(KERN_INFO "MCA related initialization done\n");
} }
/* /*
......
...@@ -116,10 +116,5 @@ extern void ia64_slave_init_handler(void); ...@@ -116,10 +116,5 @@ extern void ia64_slave_init_handler(void);
extern void ia64_mca_cmc_vector_setup(void); extern void ia64_mca_cmc_vector_setup(void);
extern int ia64_mca_check_errors(void); extern int ia64_mca_check_errors(void);
#if defined(IA64_MCA_DEBUG_INFO)
# define IA64_MCA_DEBUG(fmt...) printk(fmt)
#else
# define IA64_MCA_DEBUG(fmt...)
#endif
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_MCA_H */ #endif /* _ASM_IA64_MCA_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment