greybus: loopback: capture and present firmware supplied latencies
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 15 Oct 2015 15:10:45 +0000 (16:10 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 15 Oct 2015 18:32:07 +0000 (11:32 -0700)
commit1ec5843ee9889914be80a6763e58a79064716023
tree67b042c1910c5138746e37fa2086036d6d93b834
parente6227ee64782e1cda88a70512ac2b0ae8fda2203
greybus: loopback: capture and present firmware supplied latencies

In order to provide deep inspection of the greybus/UniPro system
instrumentation of

1. APBridge's view of UniPro latency
2. GPBridge's view of internal firmware-only latency

have both been added and reported to the AP in the transfer loopback
response header. When this data are present we latch and average it over
the number of requested cycles, presenting it to user-space via sysfs.

This patch adds the following sysfs entries for each loopback CPort

- apbridge_unipro_latency_avg_con
- apbridge_unipro_latency_max_con
- apbridge_unipro_latency_min_con
- gpbridge_firmware_latency_avg_con
- gpbridge_firmware_latency_max_con
- gpbridge_firmware_latency_min_con

and the following sysfs entries representing the average values across all
available CPorts

- apbridge_unipro_latency_avg_dev
- apbridge_unipro_latency_max_dev
- apbridge_unipro_latency_min_dev
- gpbridge_firmware_latency_avg_dev
- gpbridge_firmware_latency_max_dev
- gpbridge_firmware_latency_min_dev

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