Browse Source

greybus: timesync: Ensure parallel synchronous calls succeed

The guard for initiating a new synchronization operation should allow for
that resync to happen in every single state except for INVALID. This patch
fixes by ensuring the guard does just that. With local testing it was
possible to break a sync to a Module. This hasn't been observed in a buglog
but should be fixed anyway.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: David Lin <dtwlin@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Bryan O'Donoghue 9 years ago
parent
commit
5cb74976b9
1 changed files with 1 additions and 2 deletions
  1. 1 2
      drivers/staging/greybus/timesync.c

+ 1 - 2
drivers/staging/greybus/timesync.c

@@ -806,8 +806,7 @@ static int gb_timesync_schedule(struct gb_timesync_svc *timesync_svc, int state)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	mutex_lock(&timesync_svc->mutex);
 	mutex_lock(&timesync_svc->mutex);
-	if (timesync_svc->state ==  GB_TIMESYNC_STATE_INACTIVE ||
-	    timesync_svc->state == GB_TIMESYNC_STATE_ACTIVE) {
+	if (timesync_svc->state !=  GB_TIMESYNC_STATE_INVALID) {
 		gb_timesync_set_state_atomic(timesync_svc, state);
 		gb_timesync_set_state_atomic(timesync_svc, state);
 	} else {
 	} else {
 		ret = -ENODEV;
 		ret = -ENODEV;