aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/loopback.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-03-03 15:29:39 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-03-03 10:02:48 -0800
commit41993cd54fdc5c774cc4881e18a21e3e4a2544cd (patch)
tree36949afce41b15907af155856446efcbbb0216b9 /drivers/staging/greybus/loopback.c
parentgreybus: audio: Split start and stop APBridgeA requests (diff)
downloadlinux-dev-41993cd54fdc5c774cc4881e18a21e3e4a2544cd.tar.xz
linux-dev-41993cd54fdc5c774cc4881e18a21e3e4a2544cd.zip
greybus: loopback: fix double error count
Make sure not count errors during asynchronous tests twice (first in the timeout handler then again in the completion handler) to avoid obviously broken error stats such as: $ loopback_test -i 1000 -t transfer -p -o 200000 -c 64 -x -s 2000 1970-1-1 1:3:35 test: transfer path: gb_loopback0 size: 2000 iterations: 1000 errors: 1998 async: Enabled requests per-sec: min=0, max=0, average=0.310556, jitter=0 ap-throughput B/s: min=0 max=4026 average=1254.647461 jitter=4026 ap-latency usec: min=12803 max=12803 average=12803.000000 jitter=0 apbridge-latency usec: min=89 max=89 average=89.000000 jitter=0 gpbridge-latency usec: min=294 max=294 average=294.000000 jitter=0 where we supposedly have more errors than iterations (operations initiated). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/loopback.c')
-rw-r--r--drivers/staging/greybus/loopback.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 9014c2b51ae0..ba6e12a3648c 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -516,15 +516,15 @@ static void gb_loopback_async_operation_callback(struct gb_operation *operation)
err = true;
}
- if (err) {
- gb->error++;
- } else {
+ if (!err) {
gb_loopback_push_latency_ts(gb, &op_async->ts, &te);
gb->elapsed_nsecs = gb_loopback_calc_latency(&op_async->ts,
&te);
}
if (op_async->pending) {
+ if (err)
+ gb->error++;
gb->iteration_count++;
op_async->pending = false;
del_timer_sync(&op_async->timer);