aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_kcs_sm.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_kcs_sm.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_kcs_sm.c')
-rw-r--r--drivers/char/ipmi/ipmi_kcs_sm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c
index 2062675f9e9..fb46979567e 100644
--- a/drivers/char/ipmi/ipmi_kcs_sm.c
+++ b/drivers/char/ipmi/ipmi_kcs_sm.c
@@ -261,12 +261,14 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data,
261{ 261{
262 unsigned int i; 262 unsigned int i;
263 263
264 if ((size < 2) || (size > MAX_KCS_WRITE_SIZE)) { 264 if (size < 2)
265 return -1; 265 return IPMI_REQ_LEN_INVALID_ERR;
266 } 266 if (size > MAX_KCS_WRITE_SIZE)
267 if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) { 267 return IPMI_REQ_LEN_EXCEEDED_ERR;
268 return -2; 268
269 } 269 if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED))
270 return IPMI_NOT_IN_MY_STATE_ERR;
271
270 if (kcs_debug & KCS_DEBUG_MSG) { 272 if (kcs_debug & KCS_DEBUG_MSG) {
271 printk(KERN_DEBUG "start_kcs_transaction -"); 273 printk(KERN_DEBUG "start_kcs_transaction -");
272 for (i = 0; i < size; i ++) { 274 for (i = 0; i < size; i ++) {