aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorCorey Minyard <minyard@acm.org>2006-12-06 23:41:04 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:47 -0500
commit55162fb165571b3ba4283fe657f1a5968cef361a (patch)
tree9341bb3293c155603f47760dc72182d38a175e1d /drivers/char
parentb9675136e2ad95156fb93be6155f17590bb26fd7 (diff)
[PATCH] IPMI: fix request events
When the IPMI message handler requested that the interface look for events, the ipmi_si driver would request flags, see if the event buffer full flag was set, then request events. It's better to just send the request for events, as it cuts one message out of the transaction if there happens to be events, and it will fetch events even if the event buffer was not full. Signed-off-by: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index f04bee76ba2b..c02f5177a816 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -684,22 +684,24 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
684 { 684 {
685 /* We are idle and the upper layer requested that I fetch 685 /* We are idle and the upper layer requested that I fetch
686 events, so do so. */ 686 events, so do so. */
687 unsigned char msg[2]; 687 atomic_set(&smi_info->req_events, 0);
688 688
689 spin_lock(&smi_info->count_lock); 689 smi_info->curr_msg = ipmi_alloc_smi_msg();
690 smi_info->flag_fetches++; 690 if (!smi_info->curr_msg)
691 spin_unlock(&smi_info->count_lock); 691 goto out;
692 692
693 atomic_set(&smi_info->req_events, 0); 693 smi_info->curr_msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
694 msg[0] = (IPMI_NETFN_APP_REQUEST << 2); 694 smi_info->curr_msg->data[1] = IPMI_READ_EVENT_MSG_BUFFER_CMD;
695 msg[1] = IPMI_GET_MSG_FLAGS_CMD; 695 smi_info->curr_msg->data_size = 2;
696 696
697 smi_info->handlers->start_transaction( 697 smi_info->handlers->start_transaction(
698 smi_info->si_sm, msg, 2); 698 smi_info->si_sm,
699 smi_info->si_state = SI_GETTING_FLAGS; 699 smi_info->curr_msg->data,
700 smi_info->curr_msg->data_size);
701 smi_info->si_state = SI_GETTING_EVENTS;
700 goto restart; 702 goto restart;
701 } 703 }
702 704 out:
703 return si_sm_result; 705 return si_sm_result;
704} 706}
705 707