aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2014-04-14 10:46:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-17 15:23:07 -0400
commit89986496de141213206d49450ffdd36098d41209 (patch)
tree8e58ac04ee38226de409ad2f6594c83b9e18f59a /include
parent0dfe6e7ed47feeb22f3cf8c7d8ac7e65bd4e87f5 (diff)
ipmi: Turn off all activity on an idle ipmi interface
The IPMI driver would wake up periodically looking for events and watchdog pretimeouts. If there is nothing waiting for these events, it's really kind of pointless to be checking for them. So modify the driver so the message handler can pass down if it needs the lower layer to be waiting for these. Modify the system interface lower layer to turn off all timer and thread activity if the upper layer doesn't need anything and it is not currently handling messages. And modify the message handler to not restart the timer if its timer is not needed. The timers and kthread will still be enabled if: - the SI interface is handling a message. - a user has enabled watching for events. - the IPMI watchdog timer is in use (since it uses pretimeouts). - the message handler is waiting on a remote response. - a user has registered to receive commands. This mostly affects interfaces without interrupts. Interfaces with interrupts already don't use CPU in the system interface when the interface is idle. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ipmi.h2
-rw-r--r--include/linux/ipmi_smi.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 1f9f56e28851..76d2acbfa7c6 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -237,7 +237,7 @@ int ipmi_set_maintenance_mode(ipmi_user_t user, int mode);
237 * The first user that sets this to TRUE will receive all events that 237 * The first user that sets this to TRUE will receive all events that
238 * have been queued while no one was waiting for events. 238 * have been queued while no one was waiting for events.
239 */ 239 */
240int ipmi_set_gets_events(ipmi_user_t user, int val); 240int ipmi_set_gets_events(ipmi_user_t user, bool val);
241 241
242/* 242/*
243 * Called when a new SMI is registered. This will also be called on 243 * Called when a new SMI is registered. This will also be called on
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 8ea3fe0b9759..2a7ff302d990 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -109,6 +109,13 @@ struct ipmi_smi_handlers {
109 events from the BMC we are attached to. */ 109 events from the BMC we are attached to. */
110 void (*request_events)(void *send_info); 110 void (*request_events)(void *send_info);
111 111
112 /* Called by the upper layer when some user requires that the
113 interface watch for events, received messages, watchdog
114 pretimeouts, or not. Used by the SMI to know if it should
115 watch for these. This may be NULL if the SMI does not
116 implement it. */
117 void (*set_need_watch)(void *send_info, int enable);
118
112 /* Called when the interface should go into "run to 119 /* Called when the interface should go into "run to
113 completion" mode. If this call sets the value to true, the 120 completion" mode. If this call sets the value to true, the
114 interface should make sure that all messages are flushed 121 interface should make sure that all messages are flushed