forked from Minki/linux
ipmi:watchdog: Replace printk() with pr_xxx()
And clean broken strings. Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
parent
d1b29b9742
commit
e238491704
@ -530,8 +530,7 @@ static void panic_halt_ipmi_set_timeout(void)
|
|||||||
&send_heartbeat_now);
|
&send_heartbeat_now);
|
||||||
if (rv) {
|
if (rv) {
|
||||||
atomic_sub(1, &panic_done_count);
|
atomic_sub(1, &panic_done_count);
|
||||||
printk(KERN_WARNING PFX
|
pr_warn(PFX "Unable to extend the watchdog timeout.");
|
||||||
"Unable to extend the watchdog timeout.");
|
|
||||||
} else {
|
} else {
|
||||||
if (send_heartbeat_now)
|
if (send_heartbeat_now)
|
||||||
panic_halt_ipmi_heartbeat();
|
panic_halt_ipmi_heartbeat();
|
||||||
@ -877,7 +876,7 @@ static int ipmi_close(struct inode *ino, struct file *filep)
|
|||||||
_ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
|
_ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
|
||||||
mutex_unlock(&ipmi_watchdog_mutex);
|
mutex_unlock(&ipmi_watchdog_mutex);
|
||||||
} else {
|
} else {
|
||||||
printk(KERN_CRIT PFX
|
pr_crit(PFX
|
||||||
"Unexpected close, not stopping watchdog!\n");
|
"Unexpected close, not stopping watchdog!\n");
|
||||||
ipmi_heartbeat();
|
ipmi_heartbeat();
|
||||||
}
|
}
|
||||||
@ -912,11 +911,9 @@ static void ipmi_wdog_msg_handler(struct ipmi_recv_msg *msg,
|
|||||||
{
|
{
|
||||||
if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER &&
|
if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER &&
|
||||||
msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP)
|
msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP)
|
||||||
printk(KERN_INFO PFX "response: The IPMI controller appears"
|
pr_info(PFX "response: The IPMI controller appears to have been reset, will attempt to reinitialize the watchdog timer\n");
|
||||||
" to have been reset, will attempt to reinitialize"
|
|
||||||
" the watchdog timer\n");
|
|
||||||
else if (msg->msg.data[0] != 0)
|
else if (msg->msg.data[0] != 0)
|
||||||
printk(KERN_ERR PFX "response: Error %x on cmd %x\n",
|
pr_err(PFX "response: Error %x on cmd %x\n",
|
||||||
msg->msg.data[0],
|
msg->msg.data[0],
|
||||||
msg->msg.cmd);
|
msg->msg.cmd);
|
||||||
|
|
||||||
@ -966,7 +963,7 @@ static void ipmi_register_watchdog(int ipmi_intf)
|
|||||||
|
|
||||||
rv = ipmi_create_user(ipmi_intf, &ipmi_hndlrs, NULL, &watchdog_user);
|
rv = ipmi_create_user(ipmi_intf, &ipmi_hndlrs, NULL, &watchdog_user);
|
||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
printk(KERN_CRIT PFX "Unable to register with ipmi\n");
|
pr_crit(PFX "Unable to register with ipmi\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -983,7 +980,7 @@ static void ipmi_register_watchdog(int ipmi_intf)
|
|||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
ipmi_destroy_user(watchdog_user);
|
ipmi_destroy_user(watchdog_user);
|
||||||
watchdog_user = NULL;
|
watchdog_user = NULL;
|
||||||
printk(KERN_CRIT PFX "Unable to register misc device\n");
|
pr_crit(PFX "Unable to register misc device\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DIE_NMI
|
#ifdef HAVE_DIE_NMI
|
||||||
@ -1005,9 +1002,8 @@ static void ipmi_register_watchdog(int ipmi_intf)
|
|||||||
|
|
||||||
rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
|
rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
|
||||||
if (rv) {
|
if (rv) {
|
||||||
printk(KERN_WARNING PFX "Error starting timer to"
|
pr_warn(PFX "Error starting timer to test NMI: 0x%x. The NMI pretimeout will likely not work\n",
|
||||||
" test NMI: 0x%x. The NMI pretimeout will"
|
rv);
|
||||||
" likely not work\n", rv);
|
|
||||||
rv = 0;
|
rv = 0;
|
||||||
goto out_restore;
|
goto out_restore;
|
||||||
}
|
}
|
||||||
@ -1015,9 +1011,7 @@ static void ipmi_register_watchdog(int ipmi_intf)
|
|||||||
msleep(1500);
|
msleep(1500);
|
||||||
|
|
||||||
if (testing_nmi != 2) {
|
if (testing_nmi != 2) {
|
||||||
printk(KERN_WARNING PFX "IPMI NMI didn't seem to"
|
pr_warn(PFX "IPMI NMI didn't seem to occur. The NMI pretimeout will likely not work\n");
|
||||||
" occur. The NMI pretimeout will"
|
|
||||||
" likely not work\n");
|
|
||||||
}
|
}
|
||||||
out_restore:
|
out_restore:
|
||||||
testing_nmi = 0;
|
testing_nmi = 0;
|
||||||
@ -1033,7 +1027,7 @@ static void ipmi_register_watchdog(int ipmi_intf)
|
|||||||
start_now = 0; /* Disable this function after first startup. */
|
start_now = 0; /* Disable this function after first startup. */
|
||||||
ipmi_watchdog_state = action_val;
|
ipmi_watchdog_state = action_val;
|
||||||
ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
|
ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
|
||||||
printk(KERN_INFO PFX "Starting now!\n");
|
pr_info(PFX "Starting now!\n");
|
||||||
} else {
|
} else {
|
||||||
/* Stop the timer now. */
|
/* Stop the timer now. */
|
||||||
ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
|
ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
|
||||||
@ -1273,9 +1267,7 @@ static void check_parms(void)
|
|||||||
if (preaction_val == WDOG_PRETIMEOUT_NMI) {
|
if (preaction_val == WDOG_PRETIMEOUT_NMI) {
|
||||||
do_nmi = 1;
|
do_nmi = 1;
|
||||||
if (preop_val == WDOG_PREOP_GIVE_DATA) {
|
if (preop_val == WDOG_PREOP_GIVE_DATA) {
|
||||||
printk(KERN_WARNING PFX "Pretimeout op is to give data"
|
pr_warn(PFX "Pretimeout op is to give data but NMI pretimeout is enabled, setting pretimeout op to none\n");
|
||||||
" but NMI pretimeout is enabled, setting"
|
|
||||||
" pretimeout op to none\n");
|
|
||||||
preop_op("preop_none", NULL);
|
preop_op("preop_none", NULL);
|
||||||
do_nmi = 0;
|
do_nmi = 0;
|
||||||
}
|
}
|
||||||
@ -1284,8 +1276,7 @@ static void check_parms(void)
|
|||||||
rv = register_nmi_handler(NMI_UNKNOWN, ipmi_nmi, 0,
|
rv = register_nmi_handler(NMI_UNKNOWN, ipmi_nmi, 0,
|
||||||
"ipmi");
|
"ipmi");
|
||||||
if (rv) {
|
if (rv) {
|
||||||
printk(KERN_WARNING PFX
|
pr_warn(PFX "Can't register nmi handler\n");
|
||||||
"Can't register nmi handler\n");
|
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
nmi_handler_registered = 1;
|
nmi_handler_registered = 1;
|
||||||
@ -1302,20 +1293,19 @@ static int __init ipmi_wdog_init(void)
|
|||||||
|
|
||||||
if (action_op(action, NULL)) {
|
if (action_op(action, NULL)) {
|
||||||
action_op("reset", NULL);
|
action_op("reset", NULL);
|
||||||
printk(KERN_INFO PFX "Unknown action '%s', defaulting to"
|
pr_info(PFX "Unknown action '%s', defaulting to reset\n",
|
||||||
" reset\n", action);
|
action);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preaction_op(preaction, NULL)) {
|
if (preaction_op(preaction, NULL)) {
|
||||||
preaction_op("pre_none", NULL);
|
preaction_op("pre_none", NULL);
|
||||||
printk(KERN_INFO PFX "Unknown preaction '%s', defaulting to"
|
pr_info(PFX "Unknown preaction '%s', defaulting to none\n",
|
||||||
" none\n", preaction);
|
preaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preop_op(preop, NULL)) {
|
if (preop_op(preop, NULL)) {
|
||||||
preop_op("preop_none", NULL);
|
preop_op("preop_none", NULL);
|
||||||
printk(KERN_INFO PFX "Unknown preop '%s', defaulting to"
|
pr_info(PFX "Unknown preop '%s', defaulting to none\n", preop);
|
||||||
" none\n", preop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_parms();
|
check_parms();
|
||||||
@ -1333,11 +1323,11 @@ static int __init ipmi_wdog_init(void)
|
|||||||
atomic_notifier_chain_unregister(&panic_notifier_list,
|
atomic_notifier_chain_unregister(&panic_notifier_list,
|
||||||
&wdog_panic_notifier);
|
&wdog_panic_notifier);
|
||||||
unregister_reboot_notifier(&wdog_reboot_notifier);
|
unregister_reboot_notifier(&wdog_reboot_notifier);
|
||||||
printk(KERN_WARNING PFX "can't register smi watcher\n");
|
pr_warn(PFX "can't register smi watcher\n");
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(KERN_INFO PFX "driver initialized\n");
|
pr_info(PFX "driver initialized\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user