Fix fsm_foe timeout regression
author"Dave Page <dave.page@gleeble.com>"
Wed, 05 Mar 2014 06:36:18 +1300
changeset 2607 b59d6aecdbaa
parent 2606 764801a0f2aa
child 2608 ec0b5d9a2ff1
Fix fsm_foe timeout regression
master/fsm_foe.c
--- a/master/fsm_foe.c	Wed Jan 22 19:02:02 2014 +1300
+++ b/master/fsm_foe.c	Wed Mar 05 06:36:18 2014 +1300
@@ -374,7 +374,7 @@
 
     if (!ec_slave_mbox_check(fsm->datagram)) {
         // slave did not put anything in the mailbox yet
-        if (time_after(datagram->jiffies_received,
+        if (time_after(fsm->datagram->jiffies_received,
                     fsm->jiffies_start + EC_FSM_FOE_TIMEOUT_JIFFIES)) {
             ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);
             EC_SLAVE_ERR(slave, "Timeout while waiting for ack response.\n");
@@ -736,7 +736,7 @@
     }
 
     if (!ec_slave_mbox_check(fsm->datagram)) {
-        if (time_after(datagram->jiffies_received,
+        if (time_after(fsm->datagram->jiffies_received,
                     fsm->jiffies_start + EC_FSM_FOE_TIMEOUT_JIFFIES)) {
             ec_foe_set_tx_error(fsm, FOE_TIMEOUT_ERROR);
             EC_SLAVE_ERR(slave, "Timeout while waiting for ack response.\n");