<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
I experienced an issue with the FoE write where a spurious
timeout would occur. This turned out to be due to
datagram->jiffies_received < fsm->jiffies_start for some
reason. The following patch resolves this issue:<br>
<br>
<tt>diff -r 2eff7c993a63 master/fsm_foe.c</tt><tt><br>
</tt><tt>--- a/master/fsm_foe.c Tue Feb 12 17:31:08 2013 +0100</tt><tt><br>
</tt><tt>+++ b/master/fsm_foe.c Mon Dec 16 14:01:56 2013 -0500</tt><tt><br>
</tt><tt>@@ -42,9 +42,9 @@</tt><tt><br>
</tt><tt><br>
</tt><tt> /*****************************************************************************/</tt><tt><br>
</tt><tt><br>
</tt><tt>-/** Maximum time in ms to wait for responses when reading
out the dictionary.</tt><tt><br>
</tt><tt>+/** Maximum time in jiffies to wait for responses when
reading out the dictionary.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt>-#define EC_FSM_FOE_TIMEOUT 3000</tt><tt><br>
</tt><tt>+#define EC_FSM_FOE_TIMEOUT (3*HZ)</tt><tt><br>
</tt><tt><br>
</tt><tt> /** Mailbox type FoE.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt>@@ -370,9 +370,7 @@</tt><tt><br>
</tt><tt><br>
</tt><tt> if (!ec_slave_mbox_check(fsm->datagram)) {</tt><tt><br>
</tt><tt> // slave did not put anything in the mailbox yet</tt><tt><br>
</tt><tt>- unsigned long diff_ms =</tt><tt><br>
</tt><tt>- (datagram->jiffies_received -
fsm->jiffies_start) * 1000 / HZ;</tt><tt><br>
</tt><tt>- if (diff_ms >= EC_FSM_FOE_TIMEOUT) {</tt><tt><br>
</tt><tt>+ if (time_after(datagram->jiffies_received,
fsm->jiffies_start+EC_FSM_FOE_TIMEOUT)) {</tt><tt><br>
</tt><tt> ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);</tt><tt><br>
</tt><tt> EC_SLAVE_ERR(slave, "Timeout while waiting for
ack response.\n");</tt><tt><br>
</tt><tt> return;</tt><tt><br>
</tt><tt>@@ -709,10 +707,7 @@</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> if (!ec_slave_mbox_check(fsm->datagram)) {</tt><tt><br>
</tt><tt>- unsigned long diff_ms =</tt><tt><br>
</tt><tt>- (fsm->datagram->jiffies_received -
fsm->jiffies_start) *</tt><tt><br>
</tt><tt>- 1000 / HZ;</tt><tt><br>
</tt><tt>- if (diff_ms >= EC_FSM_FOE_TIMEOUT) {</tt><tt><br>
</tt><tt>+ if (time_after(datagram->jiffies_received,
fsm->jiffies_start+EC_FSM_FOE_TIMEOUT)) {</tt><tt><br>
</tt><tt> ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);</tt><tt><br>
</tt><tt> EC_SLAVE_ERR(slave, "Timeout while waiting for
ack response.\n");</tt><tt><br>
</tt><tt> return;</tt><tt><br>
</tt><br>
<br>
<br>
<div class="moz-signature">-- <br>
<hr>
David Page, Chief Embedded Architect<br>
Dynamic Systems Inc.<br>
PO Box 1234<br>
Poestenkill, NY 12140<br>
Telephone: +1 (518) 283-5350 | Fax: +1 (518) 283-3160 | </div>
</body>
</html>