When detaching a slave from a slave_config, fail any pending register requests instead of leaving them BUSY forever.
authorGavin Lambert <gavinl@compacsort.com>
Tue, 14 Apr 2015 09:34:15 -0400
changeset 2619 f2bc4000e47a
parent 2618 3affe9cd0b66
child 2620 0e4d098db815
When detaching a slave from a slave_config, fail any pending register requests instead of leaving them BUSY forever.
master/slave_config.c
--- a/master/slave_config.c	Tue Apr 14 09:33:24 2015 -0400
+++ b/master/slave_config.c	Tue Apr 14 09:34:15 2015 -0400
@@ -308,6 +308,10 @@
         list_for_each_entry(reg, &sc->reg_requests, list) {
             if (sc->slave->fsm.reg_request == reg) {
                 sc->slave->fsm.reg_request = NULL;
+                EC_SLAVE_WARN(sc->slave, "Aborting register request,"
+                        " slave is detaching.\n");
+                reg->state = EC_INT_REQUEST_FAILURE;
+                wake_up_all(&sc->slave->master->request_queue);
                 break;
             }
         }