merge -c1521 branches/stable-1.4: Fixed race concerning ec_slave_config_state->operational.
--- a/master/fsm_master.c Fri Oct 17 08:04:08 2008 +0000
+++ b/master/fsm_master.c Fri Oct 17 13:30:55 2008 +0000
@@ -790,6 +790,8 @@
if (ec_fsm_slave_config_exec(&fsm->fsm_slave_config))
return;
+ fsm->slave->force_config = 0;
+
// configuration finished
master->config_busy = 0;
wake_up_interruptible(&master->config_queue);
--- a/master/fsm_slave_config.c Fri Oct 17 08:04:08 2008 +0000
+++ b/master/fsm_slave_config.c Fri Oct 17 13:30:55 2008 +0000
@@ -172,10 +172,6 @@
EC_DBG("Configuring slave %u...\n", fsm->slave->ring_position);
}
- // configuration will be done immediately; therefore reset the
- // force flag
- fsm->slave->force_config = 0;
-
ec_fsm_change_start(fsm->fsm_change, fsm->slave, EC_SLAVE_STATE_INIT);
ec_fsm_change_exec(fsm->fsm_change);
fsm->state = ec_fsm_slave_config_state_init;
--- a/master/slave_config.c Fri Oct 17 08:04:08 2008 +0000
+++ b/master/slave_config.c Fri Oct 17 13:30:55 2008 +0000
@@ -807,7 +807,8 @@
state->online = sc->slave ? 1 : 0;
if (state->online) {
state->operational =
- sc->slave->current_state == EC_SLAVE_STATE_OP;
+ sc->slave->current_state == EC_SLAVE_STATE_OP
+ && !sc->slave->force_config;
state->al_state = sc->slave->current_state;
} else {
state->operational = 0;