Skip to contentSkip to conversation

watchdog: booke_wdt: clean up status messages

PATCH Applied Timur Tabi 3 participants 4 messages Feb 8, 2011 – Mar 15, 2011 Watchdog device drivers

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v2 1/1 watchdog: booke_wdt: clean up status messages

Improve the status messages that are displayed during some operations of the PowerPC watchdog timer driver. When the watchdog is enabled, the timeout is displayed as a number of seconds, instead of an obscure "period". The "period" is the position of a bit in a 64-bit timer register. The higher the value, the quicker the watchdog timeout occurs. Some people chose a high "period" value for the timer and get confused as to why the board resets within a few seconds.

Messages displayed during open and close are now debug messages, so that they don't clutter the console by default. Finally, printk() is replaced with the pr_xxx() equivalent.

---
 drivers/watchdog/booke_wdt.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)
drivers/watchdog/booke_wdt.c +9 -10
index 7e7ec9c..337265b 100644
@@ -4,7 +4,7 @@
  * Author: Matthew McClintock
  * Maintainer: Kumar Gala <[email protected]>
  *
- * Copyright 2005, 2008, 2010 Freescale Semiconductor Inc.
+ * Copyright 2005, 2008, 2010-2011 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -221,9 +221,8 @@ static int booke_wdt_open(struct inode *inode, struct file *file)
 	if (booke_wdt_enabled == 0) {
 		booke_wdt_enabled = 1;
 		on_each_cpu(__booke_wdt_enable, NULL, 0);
-		printk(KERN_INFO
-		      "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-				booke_wdt_period);
+		pr_debug("booke_wdt: watchdog enabled (timeout = %llu sec)\n",
+			period_to_sec(booke_wdt_period));
 	}
 	spin_unlock(&booke_wdt_lock);
 
@@ -240,6 +239,7 @@ static int booke_wdt_release(struct inode *inode, struct file *file)
 	 */
 	on_each_cpu(__booke_wdt_disable, NULL, 0);
 	booke_wdt_enabled = 0;
+	pr_debug("booke_wdt: watchdog disabled\n");
 #endif
 
 	clear_bit(0, &wdt_is_active);
@@ -271,21 +271,20 @@ static int __init booke_wdt_init(void)
 {
 	int ret = 0;
 
-	printk(KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
+	pr_info("booke_wdt: powerpc book-e watchdog driver loaded\n");
 	ident.firmware_version = cur_cpu_spec->pvr_value;
 
 	ret = misc_register(&booke_wdt_miscdev);
 	if (ret) {
-		printk(KERN_CRIT "Cannot register miscdev on minor=%d: %d\n",
-				WATCHDOG_MINOR, ret);
+		pr_err("booke_wdt: cannot register device (minor=%u, ret=%i)\n",
+		       WATCHDOG_MINOR, ret);
 		return ret;
 	}
 
 	spin_lock(&booke_wdt_lock);
 	if (booke_wdt_enabled == 1) {
-		printk(KERN_INFO
-		      "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-				booke_wdt_period);
+		pr_info("booke_wdt: watchdog enabled (timeout = %llu sec)\n",
+			period_to_sec(booke_wdt_period));
 		on_each_cpu(__booke_wdt_enable, NULL, 0);
 	}
 	spin_unlock(&booke_wdt_lock);
Signature · 1 line
1.7.3.4
Applied
#1 lore raw
Quoted 1 line · Timur Tabi

Improve the status messages that are displayed during some operations =

of the

Quoted 1 line

PowerPC watchdog timer driver. When the watchdog is enabled, the =

timeout is

Quoted 1 line

displayed as a number of seconds, instead of an obscure "period". The =

"period"

Quoted 1 line

is the position of a bit in a 64-bit timer register. The higher the =

value,

Quoted 1 line

the quicker the watchdog timeout occurs. Some people chose a high =

"period"

Quoted 1 line

value for the timer and get confused as to why the board resets within =

a

Quoted 3 lines

few seconds.
=20
Messages displayed during open and close are now debug messages, so =

that they

Quoted 1 line

don't clutter the console by default. Finally, printk() is replaced =

with the

Quoted 6 lines

pr_xxx() equivalent.
=20

---
drivers/watchdog/booke_wdt.c | 19 +++++++++----------

1 files changed, 9 insertions(+), 10 deletions(-)

applied

- k=

#2 lore raw

Hi Kumar,

I allready had it in the watchdog tree for a couple of weeks (and thus also in linux-next). Are you going to sent it of to Linus or will I sent it over via the watchdog tree?

Thanks in advance,
Wim.

Quoted 23 lines · Timur Tabi
Quoted 9 lines

Improve the status messages that are displayed during some operations of the PowerPC watchdog timer driver. When the watchdog is enabled, the timeout is displayed as a number of seconds, instead of an obscure "period". The "period" is the position of a bit in a 64-bit timer register. The higher the value, the quicker the watchdog timeout occurs. Some people chose a high "period" value for the timer and get confused as to why the board resets within a few seconds.

Quoted 8 lines

Messages displayed during open and close are now debug messages, so that they don't clutter the console by default. Finally, printk() is replaced with the pr_xxx() equivalent.

---
drivers/watchdog/booke_wdt.c | 19 +++++++++----------

1 files changed, 9 insertions(+), 10 deletions(-)

applied

- k

#3 lore raw
Quoted 3 lines · Wim Van Sebroeck

Hi Kumar,
=20
I allready had it in the watchdog tree for a couple of weeks (and thus =

also in linux-next).

Quoted 1 line

Are you going to sent it of to Linus or will I sent it over via the =

watchdog tree?

Quoted 3 lines

=20
Thanks in advance,
Wim.

I'll drop it from my tree.

- k=