Commit e1891cff authored by Corey Minyard's avatar Corey Minyard

ipmi: Make the smi watcher be disabled immediately when not needed

The code to tell the lower layer to enable or disable watching for
certain things was lazy in disabling, it waited until a timer tick
to see if a disable was necessary.  Not a really big deal, but it
could be improved.

Modify the code to enable and disable watching immediately and don't
do it from the background timer any more.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Tested-by: default avatarKamlakant Patel <kamlakant.patel@cavium.com>
parent c65ea996
This diff is collapsed.
...@@ -1066,7 +1066,7 @@ static void set_need_watch(void *send_info, unsigned int watch_mask) ...@@ -1066,7 +1066,7 @@ static void set_need_watch(void *send_info, unsigned int watch_mask)
unsigned long flags; unsigned long flags;
int enable; int enable;
enable = !!(watch_mask & ~IPMI_WATCH_MASK_INTERNAL); enable = !!watch_mask;
atomic_set(&smi_info->need_watch, enable); atomic_set(&smi_info->need_watch, enable);
spin_lock_irqsave(&smi_info->si_lock, flags); spin_lock_irqsave(&smi_info->si_lock, flags);
......
...@@ -1129,7 +1129,7 @@ static void ssif_set_need_watch(void *send_info, unsigned int watch_mask) ...@@ -1129,7 +1129,7 @@ static void ssif_set_need_watch(void *send_info, unsigned int watch_mask)
if (watch_mask & IPMI_WATCH_MASK_CHECK_MESSAGES) if (watch_mask & IPMI_WATCH_MASK_CHECK_MESSAGES)
timeout = SSIF_WATCH_MSG_TIMEOUT; timeout = SSIF_WATCH_MSG_TIMEOUT;
else if (watch_mask & ~IPMI_WATCH_MASK_INTERNAL) else if (watch_mask)
timeout = SSIF_WATCH_WATCHDOG_TIMEOUT; timeout = SSIF_WATCH_WATCHDOG_TIMEOUT;
flags = ipmi_ssif_lock_cond(ssif_info, &oflags); flags = ipmi_ssif_lock_cond(ssif_info, &oflags);
......
...@@ -32,14 +32,11 @@ struct ipmi_smi; ...@@ -32,14 +32,11 @@ struct ipmi_smi;
/* /*
* Flags for set_check_watch() below. Tells if the SMI should be * Flags for set_check_watch() below. Tells if the SMI should be
* waiting for watchdog timeouts, commands and/or messages. There is * waiting for watchdog timeouts, commands and/or messages.
* also an internal flag for the message handler, SMIs should ignore
* it.
*/ */
#define IPMI_WATCH_MASK_INTERNAL (1 << 0) #define IPMI_WATCH_MASK_CHECK_MESSAGES (1 << 0)
#define IPMI_WATCH_MASK_CHECK_MESSAGES (1 << 1) #define IPMI_WATCH_MASK_CHECK_WATCHDOG (1 << 1)
#define IPMI_WATCH_MASK_CHECK_WATCHDOG (1 << 2) #define IPMI_WATCH_MASK_CHECK_COMMANDS (1 << 2)
#define IPMI_WATCH_MASK_CHECK_COMMANDS (1 << 3)
/* /*
* Messages to/from the lower layer. The smi interface will take one * Messages to/from the lower layer. The smi interface will take one
...@@ -66,12 +63,6 @@ struct ipmi_smi_msg { ...@@ -66,12 +63,6 @@ struct ipmi_smi_msg {
int rsp_size; int rsp_size;
unsigned char rsp[IPMI_MAX_MSG_LENGTH]; unsigned char rsp[IPMI_MAX_MSG_LENGTH];
/*
* There should be a response message coming back in the BMC
* message queue.
*/
bool needs_response;
/* /*
* Will be called when the system is done with the message * Will be called when the system is done with the message
* (presumably to free it). * (presumably to free it).
......
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