Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bryan O'Donoghue and committed by
Greg Kroah-Hartman
5cb74976 7aa278b7

+1 -2
+1 -2
drivers/staging/greybus/timesync.c
··· 806 806 return -EINVAL; 807 807 808 808 mutex_lock(&timesync_svc->mutex); 809 - if (timesync_svc->state == GB_TIMESYNC_STATE_INACTIVE || 810 - timesync_svc->state == GB_TIMESYNC_STATE_ACTIVE) { 809 + if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) { 811 810 gb_timesync_set_state_atomic(timesync_svc, state); 812 811 } else { 813 812 ret = -ENODEV;