aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_si_intf.c
diff options
context:
space:
mode:
authorCorey Minyard <minyard@acm.org>2006-12-06 23:41:14 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:47 -0500
commit4d7cbac7c870ca66d8fb27d68188efbb5de2dffa (patch)
tree8abf21f9eb42347cfa9d7a071bce9390c6995583 /drivers/char/ipmi/ipmi_si_intf.c
parent168b35a7f67c5a8189e6b92780dfb5262604057c (diff)
[PATCH] IPMI: Fix BT long busy
The IPMI BT subdriver has been patched to survive "long busy" timeouts seen during firmware upgrades and resets. The patch never returns the HOSED state, synthesizes response messages with meaningful completion codes, and recovers gracefully when the hardware finishes the long busy. The subdriver now issues a "Get BT Capabilities" command and properly uses those results. More informative completion codes are returned on error from transaction starts; this logic was propogated to the KCS and SMIC subdrivers. Finally, indent and other style quirks were normalized. Signed-off-by: Rocky Craig <rocky.craig@hp.com> 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/ipmi/ipmi_si_intf.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index c7de2e86a6dc..81a0c89598e7 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -247,14 +247,18 @@ static void deliver_recv_msg(struct smi_info *smi_info,
247 spin_lock(&(smi_info->si_lock)); 247 spin_lock(&(smi_info->si_lock));
248} 248}
249 249
250static void return_hosed_msg(struct smi_info *smi_info) 250static void return_hosed_msg(struct smi_info *smi_info, int cCode)
251{ 251{
252 struct ipmi_smi_msg *msg = smi_info->curr_msg; 252 struct ipmi_smi_msg *msg = smi_info->curr_msg;
253 253
254 if (cCode < 0 || cCode > IPMI_ERR_UNSPECIFIED)
255 cCode = IPMI_ERR_UNSPECIFIED;
256 /* else use it as is */
257
254 /* Make it a reponse */ 258 /* Make it a reponse */
255 msg->rsp[0] = msg->data[0] | 4; 259 msg->rsp[0] = msg->data[0] | 4;
256 msg->rsp[1] = msg->data[1]; 260 msg->rsp[1] = msg->data[1];
257 msg->rsp[2] = IPMI_ERR_UNSPECIFIED; 261 msg->rsp[2] = cCode;
258 msg->rsp_size = 3; 262 msg->rsp_size = 3;
259 263
260 smi_info->curr_msg = NULL; 264 smi_info->curr_msg = NULL;
@@ -305,7 +309,7 @@ static enum si_sm_result start_next_msg(struct smi_info *smi_info)
305 smi_info->curr_msg->data, 309 smi_info->curr_msg->data,
306 smi_info->curr_msg->data_size); 310 smi_info->curr_msg->data_size);
307 if (err) { 311 if (err) {
308 return_hosed_msg(smi_info); 312 return_hosed_msg(smi_info, err);
309 } 313 }
310 314
311 rv = SI_SM_CALL_WITHOUT_DELAY; 315 rv = SI_SM_CALL_WITHOUT_DELAY;
@@ -647,7 +651,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
647 /* If we were handling a user message, format 651 /* If we were handling a user message, format
648 a response to send to the upper layer to 652 a response to send to the upper layer to
649 tell it about the error. */ 653 tell it about the error. */
650 return_hosed_msg(smi_info); 654 return_hosed_msg(smi_info, IPMI_ERR_UNSPECIFIED);
651 } 655 }
652 si_sm_result = smi_info->handlers->event(smi_info->si_sm, 0); 656 si_sm_result = smi_info->handlers->event(smi_info->si_sm, 0);
653 } 657 }