aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-05-26 17:43:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:49 -0400
commit3326f4f2276791561af1fd5f2020be0186459813 (patch)
tree1a448dae09ae046e30be294085699cd40dd054a7 /drivers
parentea4078ca1a7a3a198e519c2a7a2ed6126e40b130 (diff)
ipmi: reduce polling
We can reasonably alter the poll rate depending on whether we're performing a transaction or merely waiting for an event. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index c8d68cf68598..46bf2a97d6cb 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -893,6 +893,9 @@ static void sender(void *send_info,
893 893
894 mod_timer(&smi_info->si_timer, jiffies + SI_TIMEOUT_JIFFIES); 894 mod_timer(&smi_info->si_timer, jiffies + SI_TIMEOUT_JIFFIES);
895 895
896 if (smi_info->thread)
897 wake_up_process(smi_info->thread);
898
896 if (smi_info->run_to_completion) { 899 if (smi_info->run_to_completion) {
897 /* 900 /*
898 * If we are running to completion, then throw it in 901 * If we are running to completion, then throw it in
@@ -1013,6 +1016,8 @@ static int ipmi_thread(void *data)
1013 ; /* do nothing */ 1016 ; /* do nothing */
1014 else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait) 1017 else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait)
1015 schedule(); 1018 schedule();
1019 else if (smi_result == SI_SM_IDLE)
1020 schedule_timeout_interruptible(100);
1016 else 1021 else
1017 schedule_timeout_interruptible(0); 1022 schedule_timeout_interruptible(0);
1018 } 1023 }
@@ -1055,6 +1060,7 @@ static void smi_timeout(unsigned long data)
1055 unsigned long flags; 1060 unsigned long flags;
1056 unsigned long jiffies_now; 1061 unsigned long jiffies_now;
1057 long time_diff; 1062 long time_diff;
1063 long timeout;
1058#ifdef DEBUG_TIMING 1064#ifdef DEBUG_TIMING
1059 struct timeval t; 1065 struct timeval t;
1060#endif 1066#endif
@@ -1075,9 +1081,9 @@ static void smi_timeout(unsigned long data)
1075 1081
1076 if ((smi_info->irq) && (!smi_info->interrupt_disabled)) { 1082 if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {
1077 /* Running with interrupts, only do long timeouts. */ 1083 /* Running with interrupts, only do long timeouts. */
1078 smi_info->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES; 1084 timeout = jiffies + SI_TIMEOUT_JIFFIES;
1079 smi_inc_stat(smi_info, long_timeouts); 1085 smi_inc_stat(smi_info, long_timeouts);
1080 goto do_add_timer; 1086 goto do_mod_timer;
1081 } 1087 }
1082 1088
1083 /* 1089 /*
@@ -1086,15 +1092,15 @@ static void smi_timeout(unsigned long data)
1086 */ 1092 */
1087 if (smi_result == SI_SM_CALL_WITH_DELAY) { 1093 if (smi_result == SI_SM_CALL_WITH_DELAY) {
1088 smi_inc_stat(smi_info, short_timeouts); 1094 smi_inc_stat(smi_info, short_timeouts);
1089 smi_info->si_timer.expires = jiffies + 1; 1095 timeout = jiffies + 1;
1090 } else { 1096 } else {
1091 smi_inc_stat(smi_info, long_timeouts); 1097 smi_inc_stat(smi_info, long_timeouts);
1092 smi_info->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES; 1098 timeout = jiffies + SI_TIMEOUT_JIFFIES;
1093 } 1099 }
1094 1100
1095 do_add_timer: 1101 do_mod_timer:
1096 if ((smi_result != SI_SM_IDLE) || smi_info->interrupt_disabled) 1102 if (smi_result != SI_SM_IDLE)
1097 add_timer(&(smi_info->si_timer)); 1103 mod_timer(&(smi_info->si_timer), timeout);
1098} 1104}
1099 1105
1100static irqreturn_t si_irq_handler(int irq, void *data) 1106static irqreturn_t si_irq_handler(int irq, void *data)