]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
greybus: timesync: Bugfix ping should not result in -EAGAIN
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 19 Jul 2016 00:56:49 +0000 (01:56 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 19 Jul 2016 18:16:25 +0000 (11:16 -0700)
gb_timesync_schedule_synchronous() is currently making a synchronous
FrameTime synchronization happen. It does a wait_event_interruptible() and
then goes to check the status of the state-machine. Occasionally the state
indicates PING - which is a completely valid state and should result in a
result code of 0 not -EAGAIN. This patch fixes by making
__gb_timesync_get_status() return 0 instead of -EAGAIN for the PING state.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: David Lin <dtwlin@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/timesync.c

index 14531edb824c7099e6395393365aebc645645d80..ddbdf2beb48db280d9fd5c2aaf1b9cdfa26c4c96 100644 (file)
@@ -462,9 +462,9 @@ static int __gb_timesync_get_status(struct gb_timesync_svc *timesync_svc)
        case GB_TIMESYNC_STATE_INIT:
        case GB_TIMESYNC_STATE_WAIT_SVC:
        case GB_TIMESYNC_STATE_AUTHORITATIVE:
-       case GB_TIMESYNC_STATE_PING:
                ret = -EAGAIN;
                break;
+       case GB_TIMESYNC_STATE_PING:
        case GB_TIMESYNC_STATE_ACTIVE:
                ret = 0;
                break;