misc: tegra-throughput: avoid flooding warning msg
David Pu [Thu, 6 Jun 2013 07:52:58 +0000 (15:52 +0800)]
timediff value will overflow easily after put dc off
for a while since the data type of long is just 4bytes
for 32bit cpu. after timediff overflowed, uart will spew
out warning messages for a long time before the timediff
becomes > 0.
fixed this issue by resetting the last_flip time as soon
as overflow is occurred.

Bug 1302148
Bug 1293211
Bug 1283757
Bug 1282005

Change-Id: I527ddc1ed7850be3938f2341d7d1623ea4f22e76
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: http://git-master/r/236192
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

drivers/misc/tegra-throughput.c

index 4079495..529a7d5 100644 (file)
@@ -65,6 +65,7 @@ static void throughput_flip_callback(void)
                if (timediff <= 0) {
                        pr_warn("%s: flips %lld nsec apart\n",
                                __func__, now.tv64 - last_flip.tv64);
+                       last_flip = now;
                        return;
                }