Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 739
b: refs/heads/master
c: 882fe01
h: refs/heads/master
i:
  737: 4b01c19
  735: 07b8a37
v: v3
  • Loading branch information
Corey Minyard authored and Linus Torvalds committed May 1, 2005
1 parent 0027562 commit a227e84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dbf68f97d585265eaadd15aea308efd9ae39d34
refs/heads/master: 882fe011a92fa4fc31ca6cc95b279f7e4e52935c
36 changes: 21 additions & 15 deletions trunk/drivers/char/ipmi/ipmi_msghandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,28 +2588,20 @@ handle_msg_timeout(struct ipmi_recv_msg *msg)
deliver_response(msg);
}

static void
send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
struct ipmi_smi_msg *smi_msg,
unsigned char seq, long seqid)
static struct ipmi_smi_msg *
smi_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
unsigned char seq, long seqid)
{
if (!smi_msg)
smi_msg = ipmi_alloc_smi_msg();
struct ipmi_smi_msg *smi_msg = ipmi_alloc_smi_msg();
if (!smi_msg)
/* If we can't allocate the message, then just return, we
get 4 retries, so this should be ok. */
return;
return NULL;

memcpy(smi_msg->data, recv_msg->msg.data, recv_msg->msg.data_len);
smi_msg->data_size = recv_msg->msg.data_len;
smi_msg->msgid = STORE_SEQ_IN_MSGID(seq, seqid);

/* Send the new message. We send with a zero priority. It
timed out, I doubt time is that critical now, and high
priority messages are really only for messages to the local
MC, which don't get resent. */
intf->handlers->sender(intf->send_info, smi_msg, 0);

#ifdef DEBUG_MSGING
{
int m;
Expand All @@ -2619,6 +2611,7 @@ send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
printk("\n");
}
#endif
return smi_msg;
}

static void
Expand Down Expand Up @@ -2683,21 +2676,34 @@ ipmi_timeout_handler(long timeout_period)
intf->timed_out_ipmb_commands++;
spin_unlock(&intf->counter_lock);
} else {
struct ipmi_smi_msg *smi_msg;
/* More retries, send again. */

/* Start with the max timer, set to normal
timer after the message is sent. */
ent->timeout = MAX_MSG_TIMEOUT;
ent->retries_left--;
send_from_recv_msg(intf, ent->recv_msg, NULL,
j, ent->seqid);
spin_lock(&intf->counter_lock);
if (ent->recv_msg->addr.addr_type
== IPMI_LAN_ADDR_TYPE)
intf->retransmitted_lan_commands++;
else
intf->retransmitted_ipmb_commands++;
spin_unlock(&intf->counter_lock);
smi_msg = smi_from_recv_msg(intf,
ent->recv_msg, j, ent->seqid);
if(!smi_msg)
continue;

spin_unlock_irqrestore(&(intf->seq_lock),flags);
/* Send the new message. We send with a zero
* priority. It timed out, I doubt time is
* that critical now, and high priority
* messages are really only for messages to the
* local MC, which don't get resent. */
intf->handlers->sender(intf->send_info,
smi_msg, 0);
spin_lock_irqsave(&(intf->seq_lock), flags);
}
}
spin_unlock_irqrestore(&(intf->seq_lock), flags);
Expand Down

0 comments on commit a227e84

Please sign in to comment.