devq: idc backend better way of handling failed notify
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Wed, 3 May 2017 14:39:36 +0000 (16:39 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Wed, 3 May 2017 14:39:36 +0000 (16:39 +0200)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

lib/devif/backends/idc/desc_queue.c

index bbf2443..d272ad1 100644 (file)
@@ -195,12 +195,15 @@ static errval_t descq_notify(struct devq* q)
 
     err = queue->binding->tx_vtbl.notify(queue->binding, NOP_CONT);
     if (err_is_fail(err)) {
-        while(err_is_fail(err)) {
-            err = queue->binding->register_send(queue->binding, get_default_waitset(),
-                                             MKCONT(resend_notify, queue));
-            if (err_is_fail(err)) {
-                event_dispatch(get_default_waitset());
-            }
+        
+        err = queue->binding->register_send(queue->binding, get_default_waitset(),
+                                            MKCONT(resend_notify, queue));
+        if (err == LIB_ERR_CHAN_ALREADY_REGISTERED) {
+            // dont care about this failure since there is an oustanding message
+            // anyway if this fails 
+            return SYS_ERR_OK;
+        } else {
+            return err;     
         }
     }
     return SYS_ERR_OK;