Commit 5cb74976 authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Greg Kroah-Hartman

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: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: default avatarDavid Lin <dtwlin@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 7aa278b7
......@@ -806,8 +806,7 @@ static int gb_timesync_schedule(struct gb_timesync_svc *timesync_svc, int state)
return -EINVAL;
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);
} else {
ret = -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment