greybus: loopback: handle timestamp roll-over
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 11 Aug 2015 12:50:54 +0000 (13:50 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 03:06:58 +0000 (20:06 -0700)
commitfd489e1ac617d662e248557afd8aa06ee731440b
tree46ae2134c3f22cf917856edc5c151d95369d225f
parent4c192665f0183150cff38b6954687752f3461e13
greybus: loopback: handle timestamp roll-over

This patch ensures we account for roll-over in the loopback driver.
do_gettimeofday() is used to grab a timestamp. Two timestamps are derived
one before and one after a gb_operation_sync(), however since
do_gettimeofday() returns the number of seconds and mircoseconds that have
elapsed today - we need to account for a situation where the timestamp
starts at say 23:59:999us rolls over and the end time is now earlier than
the start time.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c