greybus: es-drivers: add outbound timestamp to connection
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 11 Aug 2015 12:50:52 +0000 (13:50 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 03:00:40 +0000 (20:00 -0700)
In order to facilitate grabbing a timestamp that doesn't include greybus
overhead, this patch adds a timestamp right before usb_submit_urb() for
both es1.c and es2.c. Long term the timestmaping of messages like this
probably wants to go away but, for the moment it may have some use to the
firmware people instrumenting the performance of the system.

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

index 0cb7a3c7ef72a0e7120aaba8cae79b1722e5b691..7fe1eaa170242e93f1c25ef3c3e8652ea25d37c5 100644 (file)
@@ -16,6 +16,7 @@
 #include "greybus.h"
 #include "svc_msg.h"
 #include "kernel_ver.h"
+#include "connection.h"
 
 /* Memory sizes for the buffers sent to/from the ES1 controller */
 #define ES1_SVC_MSG_SIZE       (sizeof(struct svc_msg) + SZ_64K)
@@ -244,6 +245,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
                          usb_sndbulkpipe(udev, es1->cport_out_endpoint),
                          message->buffer, buffer_size,
                          cport_out_callback, message);
+       gb_connection_push_timestamp(message->operation->connection);
        retval = usb_submit_urb(urb, gfp_mask);
        if (retval) {
                pr_err("error %d submitting URB\n", retval);
index 323721a2e2aa0ec3ab22dab6468991061187e91f..43cbc4d06e5f3f37a93258fbb2bf0a0ff419fdf7 100644 (file)
@@ -16,6 +16,7 @@
 #include "greybus.h"
 #include "svc_msg.h"
 #include "kernel_ver.h"
+#include "connection.h"
 
 /* Memory sizes for the buffers sent to/from the ES1 controller */
 #define ES1_SVC_MSG_SIZE       (sizeof(struct svc_msg) + SZ_64K)
@@ -340,6 +341,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
                                          es1->cport_out[bulk_ep_set].endpoint),
                          message->buffer, buffer_size,
                          cport_out_callback, message);
+       gb_connection_push_timestamp(message->operation->connection);
        retval = usb_submit_urb(urb, gfp_mask);
        if (retval) {
                pr_err("error %d submitting URB\n", retval);