Commit 0cc3bc69 authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Greg Kroah-Hartman

greybus: timesync: Fix transitions to the INACTIVE state

Analysing a backtrace associated with the current EHCI runtime suspend code
has highlighted several places where its perfectly valid to make a
transition to GB_TIMESYNC_STATE_INACTIVE when not already in the
GB_TIMESYNC_STATE_INIT state, for example failure to issue a TimeSync
enable command to the SVC can and should legitimately call
gb_timesync_teardown() - at this point the state will be
GB_TIMESYNC_STATE_WAIT_SVC and it's legitimate and desirable to transition
to the INACTIVE state in this case. This patch fixes by removing the
restrictive and incorrect restriction on the transition to INACTIVE only
being valid when state == GB_TIMESYNC_STATE_INIT.
Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Tested-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent c9e8f893
......@@ -157,10 +157,8 @@ static void gb_timesync_set_state(struct gb_timesync_svc *timesync_svc,
wake_up(&timesync_svc->wait_queue);
break;
case GB_TIMESYNC_STATE_INACTIVE:
if (timesync_svc->state != GB_TIMESYNC_STATE_INIT) {
timesync_svc->state = state;
wake_up(&timesync_svc->wait_queue);
}
timesync_svc->state = state;
wake_up(&timesync_svc->wait_queue);
break;
case GB_TIMESYNC_STATE_INIT:
if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) {
......
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