From: Bryan O'Donoghue Date: Thu, 16 Jun 2016 12:42:15 +0000 (+0100) Subject: greybus: timesync: Fix transitions to the INACTIVE state X-Git-Tag: v4.14-rc1~2366^2~378^2~21^2~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cc3bc6930d02ff5083b7b7bc18ca53299bb383a;p=platform%2Fkernel%2Flinux-rpi.git 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: Bryan O'Donoghue Reviewed-by: Vaibhav Hiremath Tested-by: Vaibhav Hiremath Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/timesync.c b/drivers/staging/greybus/timesync.c index a9b6202..cc08b09 100644 --- a/drivers/staging/greybus/timesync.c +++ b/drivers/staging/greybus/timesync.c @@ -157,10 +157,8 @@ static void gb_timesync_set_state(struct gb_timesync_svc *timesync_svc, wake_up(×ync_svc->wait_queue); break; case GB_TIMESYNC_STATE_INACTIVE: - if (timesync_svc->state != GB_TIMESYNC_STATE_INIT) { - timesync_svc->state = state; - wake_up(×ync_svc->wait_queue); - } + timesync_svc->state = state; + wake_up(×ync_svc->wait_queue); break; case GB_TIMESYNC_STATE_INIT: if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) {