public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* IPMI watchdog question
@ 2004-07-28  9:08 Holger Kiehl
  2004-07-28  9:29 ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: Holger Kiehl @ 2004-07-28  9:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: minyard

Hello

Using kernel 2.6.7 with ipmi watchdog compiled in, I have noticed that
when the process writting to /dev/watchdog is killed (-9) the system is
not reset. When I query the BMC to list the SEL it does report:

   Watchdog 2 #0x03 | Timer expired

So the BMC does notice that the timer did expire but no action is taken.
What must I do so it resets my system?

Thanks,
Holger

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-07-28  9:08 IPMI watchdog question Holger Kiehl
@ 2004-07-28  9:29 ` Arkadiusz Miskiewicz
  2004-07-28 10:33   ` Holger Kiehl
  0 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-07-28  9:29 UTC (permalink / raw)
  To: Holger Kiehl; +Cc: linux-kernel, minyard

On Wednesday 28 of July 2004 11:08, Holger Kiehl wrote:
> Hello
>
> Using kernel 2.6.7 with ipmi watchdog compiled in, I have noticed that
> when the process writting to /dev/watchdog is killed (-9) the system is
> not reset. When I query the BMC to list the SEL it does report:
>
>    Watchdog 2 #0x03 | Timer expired
>
> So the BMC does notice that the timer did expire but no action is taken.
> What must I do so it resets my system?
Do you have CONFIG_WATCHDOG_NOWAYOUT enabled?

Also driver needs to be converted to honor nowayout module option, too.

> Thanks,
> Holger

-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-07-28  9:29 ` Arkadiusz Miskiewicz
@ 2004-07-28 10:33   ` Holger Kiehl
  2004-07-28 10:46     ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: Holger Kiehl @ 2004-07-28 10:33 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: linux-kernel, minyard

On Wed, 28 Jul 2004, Arkadiusz Miskiewicz wrote:

> On Wednesday 28 of July 2004 11:08, Holger Kiehl wrote:
> > Hello
> >
> > Using kernel 2.6.7 with ipmi watchdog compiled in, I have noticed that
> > when the process writting to /dev/watchdog is killed (-9) the system is
> > not reset. When I query the BMC to list the SEL it does report:
> >
> >    Watchdog 2 #0x03 | Timer expired
> >
> > So the BMC does notice that the timer did expire but no action is taken.
> > What must I do so it resets my system?
> Do you have CONFIG_WATCHDOG_NOWAYOUT enabled?
> 
No this is not set. Must this be set? Actually I want that one can stop the
watchdog gracefully. And this is done by writting a 'V' to /dev/watchdog,
correct? 

I noticed that CONFIG_WATCHDOG is also not set since CONFIG_IPMI_WATCHDOG
is set under IPMI. Must this be set? Is the IPMI watchdog different to
all the other watchdogs or why is it listed seperatly?

Holger

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-07-28 10:33   ` Holger Kiehl
@ 2004-07-28 10:46     ` Arkadiusz Miskiewicz
  2004-08-02 12:02       ` Holger Kiehl
  0 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-07-28 10:46 UTC (permalink / raw)
  To: Holger Kiehl; +Cc: linux-kernel, minyard

On Wednesday 28 of July 2004 12:33, Holger Kiehl wrote:

> > Do you have CONFIG_WATCHDOG_NOWAYOUT enabled?
>
> No this is not set. Must this be set? Actually I want that one can stop the
> watchdog gracefully. And this is done by writting a 'V' to /dev/watchdog,
> correct?
Without CONFIG_WATCHDOG_NOWAYOUT (or nowayout=1 module option added by my 
patch just sent to lkml) when /dev/watchdog is closed then watchdog timer is 
disabled.

> I noticed that CONFIG_WATCHDOG is also not set since CONFIG_IPMI_WATCHDOG
> is set under IPMI. Must this be set?
Currently these two are unrelated in technical terms.

> Is the IPMI watchdog different to 
> all the other watchdogs or why is it listed seperatly?
CONFIG_WATCHDOG only purpose is to disable all watchdogs living in 
drivers/char/watchdog directory, nothing more. Enabling it doesn't add any 
code unless you also add some specific watchdog.

ipmi_watchdog relies on IPMI (IPMI_HANDLER) and probably that's why it's 
listed separatly.

> Holger

-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-07-28 10:46     ` Arkadiusz Miskiewicz
@ 2004-08-02 12:02       ` Holger Kiehl
  2004-08-02 15:35         ` Corey Minyard
  0 siblings, 1 reply; 10+ messages in thread
From: Holger Kiehl @ 2004-08-02 12:02 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: linux-kernel, minyard

On Wed, 28 Jul 2004, Arkadiusz Miskiewicz wrote:

> On Wednesday 28 of July 2004 12:33, Holger Kiehl wrote:
> 
> > > Do you have CONFIG_WATCHDOG_NOWAYOUT enabled?
> >
> > No this is not set. Must this be set? Actually I want that one can stop the
> > watchdog gracefully. And this is done by writting a 'V' to /dev/watchdog,
> > correct?
> Without CONFIG_WATCHDOG_NOWAYOUT (or nowayout=1 module option added by my 
> patch just sent to lkml) when /dev/watchdog is closed then watchdog timer is 
> disabled.
> 
Ok, with CONFIG_WATCHDOG_NOWAYOUT the system gets it reset. However now
there is no save way to stop the watchdog gracefully. It no longer honors
the magic letter 'V', but looking at the code of ipmi_watchtog.c I could
find no place where it looks for the magic character 'V'. So I am still not
sure what to do. The reason why I killed the process writting the heartbeat
was that I just wanted to see if the watchdog does work. Or is there a
simpler way to simulate a system hangup?

Thanks,
Holger

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-08-02 12:02       ` Holger Kiehl
@ 2004-08-02 15:35         ` Corey Minyard
  2004-08-02 16:29           ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: Corey Minyard @ 2004-08-02 15:35 UTC (permalink / raw)
  To: Holger Kiehl; +Cc: Arkadiusz Miskiewicz, linux-kernel

The IPMI watchdog has never supported writing "V" to disable it.  It's a 
mixed bag with the other watchdogs, some do and some don't, but I can 
certainly add that function.  Or even better, I'd be happy to take a 
patch :).

-Corey

Holger Kiehl wrote:

>On Wed, 28 Jul 2004, Arkadiusz Miskiewicz wrote:
>
>  
>
>>On Wednesday 28 of July 2004 12:33, Holger Kiehl wrote:
>>
>>    
>>
>>>>Do you have CONFIG_WATCHDOG_NOWAYOUT enabled?
>>>>        
>>>>
>>>No this is not set. Must this be set? Actually I want that one can stop the
>>>watchdog gracefully. And this is done by writting a 'V' to /dev/watchdog,
>>>correct?
>>>      
>>>
>>Without CONFIG_WATCHDOG_NOWAYOUT (or nowayout=1 module option added by my 
>>patch just sent to lkml) when /dev/watchdog is closed then watchdog timer is 
>>disabled.
>>
>>    
>>
>Ok, with CONFIG_WATCHDOG_NOWAYOUT the system gets it reset. However now
>there is no save way to stop the watchdog gracefully. It no longer honors
>the magic letter 'V', but looking at the code of ipmi_watchtog.c I could
>find no place where it looks for the magic character 'V'. So I am still not
>sure what to do. The reason why I killed the process writting the heartbeat
>was that I just wanted to see if the watchdog does work. Or is there a
>simpler way to simulate a system hangup?
>
>Thanks,
>Holger
>  
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-08-02 15:35         ` Corey Minyard
@ 2004-08-02 16:29           ` Arkadiusz Miskiewicz
  2004-08-02 16:51             ` Corey Minyard
  0 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-08-02 16:29 UTC (permalink / raw)
  To: Corey Minyard; +Cc: Holger Kiehl, linux-kernel

On Monday 02 of August 2004 17:35, Corey Minyard wrote:
> The IPMI watchdog has never supported writing "V" to disable it.  It's a
> mixed bag with the other watchdogs, some do and some don't, but I can
> certainly add that function.  Or even better, I'd be happy to take a
> patch :).

Like this one (untested beside compilation) below?

btw. other watchdog drivers use:

	if(test_and_set_bit(0, &wdt_is_open))
                return -EBUSY;

while ipmi does just:
	ipmi_wdog_open = 0;

should it also use bit operations or setting =0 is just fine?

Patch:

- support disabling watchdog by writting ,,V'' to device.
- unify printk()

Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>

--- linux.org/drivers/char/ipmi/ipmi_watchdog.c.org	2004-08-02 18:03:52.400100664 +0200
+++ linux/drivers/char/ipmi/ipmi_watchdog.c	2004-08-02 18:22:34.980442512 +0200
@@ -51,6 +51,8 @@
 #include <asm/apic.h>
 #endif
 
+#define	PFX "IPMI Watchdog: "
+
 #define IPMI_WATCHDOG_VERSION "v32"
 
 /*
@@ -160,6 +162,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(read_q);
 static struct fasync_struct *fasync_q = NULL;
 static char pretimeout_since_last_heartbeat = 0;
+static char expect_close;
 
 /* If true, the driver will start running as soon as it is configured
    and ready. */
@@ -287,7 +290,7 @@
 				      recv_msg,
 				      1);
 	if (rv) {
-		printk(KERN_WARNING "IPMI Watchdog, set timeout error: %d\n",
+		printk(KERN_WARNING PFX "set timeout error: %d\n",
 		       rv);
 	}
 
@@ -464,7 +467,7 @@
 				      1);
 	if (rv) {
 		up(&heartbeat_lock);
-		printk(KERN_WARNING "IPMI Watchdog, heartbeat failure: %d\n",
+		printk(KERN_WARNING PFX "heartbeat failure: %d\n",
 		       rv);
 		return rv;
 	}
@@ -603,6 +606,21 @@
 		return -ESPIPE;
 
 	if (len) {
+	    	if (!nowayout) {
+		    	size_t i;
+
+			/* In case it was set long ago */
+			expect_close = 0;
+			
+    			for (i = 0; i != len; i++) {
+				char c;
+
+				if (get_user(c, buf + i))
+					return -EFAULT;
+				if (c == 'V')
+					expect_close = 42;
+			}
+		}
 		rv = ipmi_heartbeat();
 		if (rv)
 			return rv;
@@ -712,14 +730,18 @@
 {
 	if (iminor(ino)==WATCHDOG_MINOR)
 	{
-		if (!nowayout) {
+		if (expect_close == 42) {
 			ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
 			ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
+			ipmi_wdog_open = 0;
+		} else {
+			printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+			ipmi_heartbeat();
 		}
-	        ipmi_wdog_open = 0;
 	}
 
 	ipmi_fasync (-1, filep, 0);
+	expect_close = 0;
 
 	return 0;
 }
@@ -747,7 +769,7 @@
 				  void                 *handler_data)
 {
 	if (msg->msg.data[0] != 0) {
-		printk(KERN_ERR "IPMI Watchdog response: Error %x on cmd %x\n",
+		printk(KERN_ERR PFX "response: Error %x on cmd %x\n",
 		       msg->msg.data[0],
 		       msg->msg.cmd);
 	}
@@ -792,7 +814,7 @@
 
 	rv = ipmi_create_user(ipmi_intf, &ipmi_hndlrs, NULL, &watchdog_user);
 	if (rv < 0) {
-		printk("IPMI watchdog: Unable to register with ipmi\n");
+		printk(KERN_CRIT PFX "Unable to register with ipmi\n");
 		goto out;
 	}
 
@@ -804,7 +826,7 @@
 	if (rv < 0) {
 		ipmi_destroy_user(watchdog_user);
 		watchdog_user = NULL;
-		printk("IPMI watchdog: Unable to register misc device\n");
+		printk(KERN_CRIT PFX "Unable to register misc device\n");
 	}
 
  out:
@@ -815,7 +837,7 @@
 		start_now = 0; /* Disable this function after first startup. */
 		ipmi_watchdog_state = action_val;
 		ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
-		printk("Starting IPMI Watchdog now!\n");
+		printk(KERN_INFO PFX "Starting now!\n");
 	}
 }
 
@@ -826,7 +848,7 @@
 	/* If no one else handled the NMI, we assume it was the IPMI
            watchdog. */
 	if ((!handled) && (preop_val == WDOG_PREOP_PANIC))
-		panic("IPMI watchdog pre-timeout");
+		panic(PFX "pre-timeout");
 
 	/* On some machines, the heartbeat will give
 	   an error and not work unless we re-enable
@@ -932,7 +954,7 @@
 {
 	int rv;
 
-	printk(KERN_INFO "IPMI watchdog driver version "
+	printk(KERN_INFO PFX "driver version "
 	       IPMI_WATCHDOG_VERSION "\n");
 
 	if (strcmp(action, "reset") == 0) {
@@ -945,7 +967,7 @@
 		action_val = WDOG_TIMEOUT_POWER_DOWN;
 	} else {
 		action_val = WDOG_TIMEOUT_RESET;
-		printk("ipmi_watchdog: Unknown action '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown action '%s', defaulting to"
 		       " reset\n", action);
 	}
 
@@ -961,7 +983,7 @@
 		preaction_val = WDOG_PRETIMEOUT_MSG_INT;
 	} else {
 		preaction_val = WDOG_PRETIMEOUT_NONE;
-		printk("ipmi_watchdog: Unknown preaction '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown preaction '%s', defaulting to"
 		       " none\n", preaction);
 	}
 
@@ -973,23 +995,21 @@
 		preop_val = WDOG_PREOP_GIVE_DATA;
 	} else {
 		preop_val = WDOG_PREOP_NONE;
-		printk("ipmi_watchdog: Unknown preop '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown preop '%s', defaulting to"
 		       " none\n", preop);
 	}
 
 #ifdef HAVE_NMI_HANDLER
 	if (preaction_val == WDOG_PRETIMEOUT_NMI) {
 		if (preop_val == WDOG_PREOP_GIVE_DATA) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: Pretimeout op is to give data"
+			printk(KERN_WARNING PFX "Pretimeout op is to give data"
 			       " but NMI pretimeout is enabled, setting"
 			       " pretimeout op to none\n");
 			preop_val = WDOG_PREOP_NONE;
 		}
 #ifdef CONFIG_X86_LOCAL_APIC
 		if (nmi_watchdog == NMI_IO_APIC) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: nmi_watchdog is set to IO APIC"
+			printk(KERN_WARNING PFX "nmi_watchdog is set to IO APIC"
 			       " mode (value is %d), that is incompatible"
 			       " with using NMI in the IPMI watchdog."
 			       " Disabling IPMI nmi pretimeout.\n",
@@ -999,8 +1019,7 @@
 #endif
 		rv = request_nmi(&ipmi_nmi_handler);
 		if (rv) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: Can't register nmi handler\n");
+			printk(KERN_WARNING PFX "Can't register nmi handler\n");
 			return rv;
 		}
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -1015,8 +1034,7 @@
 		if (preaction_val == WDOG_PRETIMEOUT_NMI)
 			release_nmi(&ipmi_nmi_handler);
 #endif
-		printk(KERN_WARNING
-		       "ipmi_watchdog: can't register smi watcher\n");
+		printk(KERN_WARNING PFX "can't register smi watcher\n");
 		return rv;
 	}
 
@@ -1061,8 +1079,7 @@
 	/* Disconnect from IPMI. */
 	rv = ipmi_destroy_user(watchdog_user);
 	if (rv) {
-		printk(KERN_WARNING
-		       "IPMI Watchdog, error unlinking from IPMI: %d\n",
+		printk(KERN_WARNING PFX "error unlinking from IPMI: %d\n",
 		       rv);
 	}
 	watchdog_user = NULL;

> -Corey

-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-08-02 16:29           ` Arkadiusz Miskiewicz
@ 2004-08-02 16:51             ` Corey Minyard
  2004-08-02 17:05               ` Arkadiusz Miskiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: Corey Minyard @ 2004-08-02 16:51 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: Holger Kiehl, linux-kernel

Arkadiusz Miskiewicz wrote:

>On Monday 02 of August 2004 17:35, Corey Minyard wrote:
>  
>
>>The IPMI watchdog has never supported writing "V" to disable it.  It's a
>>mixed bag with the other watchdogs, some do and some don't, but I can
>>certainly add that function.  Or even better, I'd be happy to take a
>>patch :).
>>    
>>
>
>Like this one (untested beside compilation) below?
>
>btw. other watchdog drivers use:
>
>	if(test_and_set_bit(0, &wdt_is_open))
>                return -EBUSY;
>
>while ipmi does just:
>	ipmi_wdog_open = 0;
>
>should it also use bit operations or setting =0 is just fine?
>
You are correct, a test and set operation is really needed.

>
>Patch:
>
>- support disabling watchdog by writting ,,V'' to device.
>- unify printk()
>
>Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>
>  
>
Your patch looks very good.  Could you add the test and set change, 
too?  Then I think it is ready to go in.

-Corey


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-08-02 16:51             ` Corey Minyard
@ 2004-08-02 17:05               ` Arkadiusz Miskiewicz
  2004-08-03  8:46                 ` Holger Kiehl
  0 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Miskiewicz @ 2004-08-02 17:05 UTC (permalink / raw)
  To: Corey Minyard; +Cc: Holger Kiehl, linux-kernel

On Monday 02 of August 2004 18:51, Corey Minyard wrote:

> Your patch looks very good.  Could you add the test and set change,
> too?  Then I think it is ready to go in.
Added.

- support disabling watchdog by writting ,,V'' to device.
- unify printk()
- use atomic bit operations on ipmi_wdog_open

Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>

--- linux.org/drivers/char/ipmi/ipmi_watchdog.c.org	2004-08-02 18:03:52.400100664 +0200
+++ linux/drivers/char/ipmi/ipmi_watchdog.c	2004-08-02 19:00:14.149996536 +0200
@@ -51,6 +51,8 @@
 #include <asm/apic.h>
 #endif
 
+#define	PFX "IPMI Watchdog: "
+
 #define IPMI_WATCHDOG_VERSION "v32"
 
 /*
@@ -160,6 +162,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(read_q);
 static struct fasync_struct *fasync_q = NULL;
 static char pretimeout_since_last_heartbeat = 0;
+static char expect_close;
 
 /* If true, the driver will start running as soon as it is configured
    and ready. */
@@ -191,7 +194,7 @@
 static int ipmi_ignore_heartbeat = 0;
 
 /* Is someone using the watchdog?  Only one user is allowed. */
-static int ipmi_wdog_open = 0;
+static unsigned long ipmi_wdog_open = 0;
 
 /* If set to 1, the heartbeat command will set the state to reset and
    start the timer.  The timer doesn't normally run when the driver is
@@ -287,7 +290,7 @@
 				      recv_msg,
 				      1);
 	if (rv) {
-		printk(KERN_WARNING "IPMI Watchdog, set timeout error: %d\n",
+		printk(KERN_WARNING PFX "set timeout error: %d\n",
 		       rv);
 	}
 
@@ -464,7 +467,7 @@
 				      1);
 	if (rv) {
 		up(&heartbeat_lock);
-		printk(KERN_WARNING "IPMI Watchdog, heartbeat failure: %d\n",
+		printk(KERN_WARNING PFX "heartbeat failure: %d\n",
 		       rv);
 		return rv;
 	}
@@ -603,6 +606,21 @@
 		return -ESPIPE;
 
 	if (len) {
+	    	if (!nowayout) {
+		    	size_t i;
+
+			/* In case it was set long ago */
+			expect_close = 0;
+			
+    			for (i = 0; i != len; i++) {
+				char c;
+
+				if (get_user(c, buf + i))
+					return -EFAULT;
+				if (c == 'V')
+					expect_close = 42;
+			}
+		}
 		rv = ipmi_heartbeat();
 		if (rv)
 			return rv;
@@ -670,11 +688,9 @@
         switch (iminor(ino))
         {
                 case WATCHDOG_MINOR:
-                    if (ipmi_wdog_open)
+		    if(test_and_set_bit(0, &ipmi_wdog_open))
                         return -EBUSY;
 
-                    ipmi_wdog_open = 1;
-
 		    /* Don't start the timer now, let it start on the
 		       first heartbeat. */
 		    ipmi_start_timer_on_heartbeat = 1;
@@ -712,14 +728,18 @@
 {
 	if (iminor(ino)==WATCHDOG_MINOR)
 	{
-		if (!nowayout) {
+		if (expect_close == 42) {
 			ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
 			ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
+			clear_bit(0, &ipmi_wdog_open);
+		} else {
+			printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+			ipmi_heartbeat();
 		}
-	        ipmi_wdog_open = 0;
 	}
 
 	ipmi_fasync (-1, filep, 0);
+	expect_close = 0;
 
 	return 0;
 }
@@ -747,7 +767,7 @@
 				  void                 *handler_data)
 {
 	if (msg->msg.data[0] != 0) {
-		printk(KERN_ERR "IPMI Watchdog response: Error %x on cmd %x\n",
+		printk(KERN_ERR PFX "response: Error %x on cmd %x\n",
 		       msg->msg.data[0],
 		       msg->msg.cmd);
 	}
@@ -792,7 +812,7 @@
 
 	rv = ipmi_create_user(ipmi_intf, &ipmi_hndlrs, NULL, &watchdog_user);
 	if (rv < 0) {
-		printk("IPMI watchdog: Unable to register with ipmi\n");
+		printk(KERN_CRIT PFX "Unable to register with ipmi\n");
 		goto out;
 	}
 
@@ -804,7 +824,7 @@
 	if (rv < 0) {
 		ipmi_destroy_user(watchdog_user);
 		watchdog_user = NULL;
-		printk("IPMI watchdog: Unable to register misc device\n");
+		printk(KERN_CRIT PFX "Unable to register misc device\n");
 	}
 
  out:
@@ -815,7 +835,7 @@
 		start_now = 0; /* Disable this function after first startup. */
 		ipmi_watchdog_state = action_val;
 		ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
-		printk("Starting IPMI Watchdog now!\n");
+		printk(KERN_INFO PFX "Starting now!\n");
 	}
 }
 
@@ -826,7 +846,7 @@
 	/* If no one else handled the NMI, we assume it was the IPMI
            watchdog. */
 	if ((!handled) && (preop_val == WDOG_PREOP_PANIC))
-		panic("IPMI watchdog pre-timeout");
+		panic(PFX "pre-timeout");
 
 	/* On some machines, the heartbeat will give
 	   an error and not work unless we re-enable
@@ -932,7 +952,7 @@
 {
 	int rv;
 
-	printk(KERN_INFO "IPMI watchdog driver version "
+	printk(KERN_INFO PFX "driver version "
 	       IPMI_WATCHDOG_VERSION "\n");
 
 	if (strcmp(action, "reset") == 0) {
@@ -945,7 +965,7 @@
 		action_val = WDOG_TIMEOUT_POWER_DOWN;
 	} else {
 		action_val = WDOG_TIMEOUT_RESET;
-		printk("ipmi_watchdog: Unknown action '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown action '%s', defaulting to"
 		       " reset\n", action);
 	}
 
@@ -961,7 +981,7 @@
 		preaction_val = WDOG_PRETIMEOUT_MSG_INT;
 	} else {
 		preaction_val = WDOG_PRETIMEOUT_NONE;
-		printk("ipmi_watchdog: Unknown preaction '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown preaction '%s', defaulting to"
 		       " none\n", preaction);
 	}
 
@@ -973,23 +993,21 @@
 		preop_val = WDOG_PREOP_GIVE_DATA;
 	} else {
 		preop_val = WDOG_PREOP_NONE;
-		printk("ipmi_watchdog: Unknown preop '%s', defaulting to"
+		printk(KERN_INFO PFX "Unknown preop '%s', defaulting to"
 		       " none\n", preop);
 	}
 
 #ifdef HAVE_NMI_HANDLER
 	if (preaction_val == WDOG_PRETIMEOUT_NMI) {
 		if (preop_val == WDOG_PREOP_GIVE_DATA) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: Pretimeout op is to give data"
+			printk(KERN_WARNING PFX "Pretimeout op is to give data"
 			       " but NMI pretimeout is enabled, setting"
 			       " pretimeout op to none\n");
 			preop_val = WDOG_PREOP_NONE;
 		}
 #ifdef CONFIG_X86_LOCAL_APIC
 		if (nmi_watchdog == NMI_IO_APIC) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: nmi_watchdog is set to IO APIC"
+			printk(KERN_WARNING PFX "nmi_watchdog is set to IO APIC"
 			       " mode (value is %d), that is incompatible"
 			       " with using NMI in the IPMI watchdog."
 			       " Disabling IPMI nmi pretimeout.\n",
@@ -999,8 +1017,7 @@
 #endif
 		rv = request_nmi(&ipmi_nmi_handler);
 		if (rv) {
-			printk(KERN_WARNING
-			       "ipmi_watchdog: Can't register nmi handler\n");
+			printk(KERN_WARNING PFX "Can't register nmi handler\n");
 			return rv;
 		}
 #ifdef CONFIG_X86_LOCAL_APIC
@@ -1015,8 +1032,7 @@
 		if (preaction_val == WDOG_PRETIMEOUT_NMI)
 			release_nmi(&ipmi_nmi_handler);
 #endif
-		printk(KERN_WARNING
-		       "ipmi_watchdog: can't register smi watcher\n");
+		printk(KERN_WARNING PFX "can't register smi watcher\n");
 		return rv;
 	}
 
@@ -1061,8 +1077,7 @@
 	/* Disconnect from IPMI. */
 	rv = ipmi_destroy_user(watchdog_user);
 	if (rv) {
-		printk(KERN_WARNING
-		       "IPMI Watchdog, error unlinking from IPMI: %d\n",
+		printk(KERN_WARNING PFX "error unlinking from IPMI: %d\n",
 		       rv);
 	}
 	watchdog_user = NULL;

> -Corey

-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: IPMI watchdog question
  2004-08-02 17:05               ` Arkadiusz Miskiewicz
@ 2004-08-03  8:46                 ` Holger Kiehl
  0 siblings, 0 replies; 10+ messages in thread
From: Holger Kiehl @ 2004-08-03  8:46 UTC (permalink / raw)
  To: Arkadiusz Miskiewicz; +Cc: Corey Minyard, linux-kernel

On Mon, 2 Aug 2004, Arkadiusz Miskiewicz wrote:

> On Monday 02 of August 2004 18:51, Corey Minyard wrote:
> 
> > Your patch looks very good.  Could you add the test and set change,
> > too?  Then I think it is ready to go in.
> Added.
> 
> - support disabling watchdog by writting ,,V'' to device.
> - unify printk()
> - use atomic bit operations on ipmi_wdog_open
> 
> Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>
> 
Many thanks for the quick patch! I have tested it and everything works as
expected.

Holger

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-08-03  8:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-28  9:08 IPMI watchdog question Holger Kiehl
2004-07-28  9:29 ` Arkadiusz Miskiewicz
2004-07-28 10:33   ` Holger Kiehl
2004-07-28 10:46     ` Arkadiusz Miskiewicz
2004-08-02 12:02       ` Holger Kiehl
2004-08-02 15:35         ` Corey Minyard
2004-08-02 16:29           ` Arkadiusz Miskiewicz
2004-08-02 16:51             ` Corey Minyard
2004-08-02 17:05               ` Arkadiusz Miskiewicz
2004-08-03  8:46                 ` Holger Kiehl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox