Commit graph

32 commits

Author SHA1 Message Date
Greg Kroah-Hartman 863dbc52e7 staging: greybus: Remove redundant license text
Now that the SPDX tag is in all greybus files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: David Lin <dtwlin@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11 14:46:21 +01:00
Greg Kroah-Hartman eb50fd3a22 staging: greybus: add SPDX identifiers to all greybus driver files
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/staging/greybus files files with the correct SPDX
license identifier based on the license text in the file itself.  The
SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: David Lin <dtwlin@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11 14:46:20 +01:00
Greg Kroah-Hartman bdfb95c4ba staging: greybus: remove timesync protocol support
While the timesync protocol was a great idea, it never ended up getting
implemented by any known hardware devices.  It's also a bit
"interesting" in how it ties into the platform controller.

So, just remove it for now.  It's not needed, no one uses it, and it's a
stumbling block in getting the greybus core code merged out of the
staging tree.  If anyone wants it in the future, reverting this patch is
a great place to start from.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alex Elder <elder@kernel.org>
Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07 17:00:57 +01:00
Alex Elder c0b06a6d4e greybus: tracing: drop "greybus" prefix
I posted this once before but it got rejected for fear it would
not be clear which messages were related to Greybus.

Every trace event currently defined for Greybus is recorded in a
function whose name begins with "gb_".  Every trace event reported
in /sys/kernel/debug/tracing/trace includes the name of the function
in which the event was recorded.

Get rid of the "greybus: " prefix in all of the Greybus trace
events.  It just takes up precious space and is not actually
helpful.  Anyone actually enabling individual trace events should
know enough about what they're doing to recognize which ones
are being enabled.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-09 12:12:43 -07:00
Bryan O'Donoghue 6da7c88972 greybus: tracepoints: Add standard Linux tracepoint for TimeSync event
This patch adds a tracepoint to the TimeSync ISR, the purpose of which is
to indicate a TimeSync event has happened. This tracepoint can be enabled
by issuing the following command:

echo 1 > /sys/kernel/debug/tracing/events/greybus/gb_timesync_irq/enable

Synchronization looks like this:

 TIMESTAMP  FUNCTION
    |         |
147.865788: gb_timesync_irq: strobe 1/4 frame-time 2910076529
147.866781: gb_timesync_irq: strobe 2/4 frame-time 2910095689
147.867777: gb_timesync_irq: strobe 3/4 frame-time 2910114820
147.868791: gb_timesync_irq: strobe 4/4 frame-time 2910134038

A ping can be triggered like this:

cat /sys/kernel/debug/greybus/frame-time

And that ping looks like this:

 TIMESTAMP  FUNCTION
    |         |
147.934678: gb_timesync_irq: ping 4/4 frame-time 2911380356
169.280551: gb_timesync_irq: ping 4/4 frame-time 3321221069

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Acked-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-06 20:50:08 -07:00
Alex Elder 0790c09a3b greybus: tracing: fix message traces
The original message trace events were defined long before the
recent tracing updates.  It records information that's not
really directly related to a message.  Change the information
recorded and reported for message events to just be the content
of the message header.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 495787a792 greybus: tracing: add timing traces
Bryan reports he used certain message traces to determine when time
sync messages transit the boundary between the Greybus core and the
host device.  This patch adds two trace events--one a message event
for outbound messages (because it indicates its operation and its
destination), and one host device event for incoming messages
(because message information isn't available as early as desired).
These events are being created to allow the same sort of analysis
of messages without having to store extra information for every
message trace.  (The next patch changes the information a message
trace records.)

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 79c8c64942 greybus: tracing: define connection traces
Define a new gb_connection trace point event class, used to trace
events associated with the connection abstraction.  Define four basic
trace events for this--creation, drop of last reference, and when
adding or dropping any other reference.  There are certainly
more events that we might want to add, but aim is to just get the
basic framework in place.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 4f9c5c0bbb greybus: tracing: define bundle traces
Define a new gb_bundle trace point event class, used to trace events
associated with the bundle abstraction.  Define four basic trace
points for this--creation time, drop of last reference, before
adding it to its interface and when removed when its interface
is destroyed.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 6879dbf15e greybus: tracing: add interface mode_switch
Add the value of an interface's mode_switch field to the information
tracked and reported for tracing.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 14a36ae704 greybus: tracing: assign "parent" id first
Most abstractions to be traced will have a sort of "parent" object
it is associated with, and an identifier for that parent is stored
with the as trace event data.  For example, the parent of a message
is the operation it's a part of, and the parent of an operation is
the connection it uses.

We'll arrange to define that parent id first in all events.  Most
abstractions already do this.  Move an interface's module id so it's
defined and assigned first.  The message traces are going to be
changed soon, so leave that one alone.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder c65fdf0318 greybus: tracing: fix module num_interfaces
A module's num_interfaces field is included in the data to be
recorded for tracing, but it's never assigned or reported.  Fix
its type to be size_t, to match its definition in the gb_module
structure.

Also correct a format length modifier used for a host device's
num_cports field.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder 1ea3ed54dc greybus: tracing: reorder trace definitions
Move the definition of the module trace events below those for the
interface.  We'll define them in an order that represents a sort of
layering of the abstractions (note not all of these are defined yet):
    message
    operation
    connection
    bundle
    interface
    module
    host device
Other tracepoints (like perhaps some tied to timesync) will go at the
beginning or end.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder c507397455 greybus: tracing: fix host device num_cports
The type of the gb_host_device num_cports field is size_t.  Correct
the num_cports data recorded with a host device event so its type
matches that; fix the format length modifier used for it as well.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Alex Elder e5f23c4584 greybus: tracing: fix "make check" warnings
Some of the trace buffer fields were defined as Booleans.  This
leads to two problems reported by "make check":
    - the __field() macro (or some descendent macro) performs
      a sizeof(bool) operation, which results in a warning
    - The TP_printk() macro, which specifies a printf() style
      format string, produces a warning when one attempts to
      format a Boolean as an integer.
Fix both problems implicitly converting Boolean values from the data
structures into integers in the trace buffer.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Johan Hovold 18079ece81 greybus: operation: add helper for creating core operations
Add a new core operation flag and a helper that core can use to create
core operations.

This will be used to implement the ping operations that core sends as
part of connection tear down.

Note that a new trace point is also added.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-27 12:21:16 -07:00
Alex Elder cb4c8441e5 greybus: tracing: define interface traces
Define a new gb_module trace point event class, used to trace events
associated with the interface abstraction.  Define four basic trace
points for this--creation time, drop of last reference, before
registring interfaces and after de-registering them.  In addition,
define traces for activating and deactivating, and enabling and
disabling an interface.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26 22:37:19 -07:00
Alex Elder 5451ea0e99 greybus: tracing: add module traces
Define a new gb_module trace point event class, used to trace events
associated with the module abstraction.  Define four basic trace
points for this--creation time, drop of last reference, before
registring interfaces and after de-registering them.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26 22:37:19 -07:00
Alex Elder 1f79046bd7 greybus: tracing: fix hd traces
Currently there are two trace points defined for the Greybus host
device structure.  One records information when a message gets sent,
and another when it gets received.  Neither of these is really a
host device event.

We have trace points defined for messages that dump information
about all sent and received messages.  As a result, the information
about sending messages over a host is redundant, and can go away.
(Note that the message traces may need a little refinement so they
produce all desired information.)

Instead of these trace points, define some that are directly
related to the host device abstraction: when one is created,
added, deleted, or released (destroyed).  These do not require
a CPort ID or payload size, so eliminate those two parameters
from the host device trace point prototype.  Change the trace
information recorded for a host device to be just a subset of
interesting fields in a host device.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26 22:37:19 -07:00
Alex Elder 206dc534e9 greybus: tracing: refine comments
I believe that duplicating the tracepoint name in comments prior to
the tracepoint is redundant, and doesn't add a lot of value.

I also believe that we can provide a little more information about
what exactly an event means, or when exactly it is called.

I don't claim this is a huge improvement, but it's a proposal.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-20 17:19:03 -07:00
Alex Elder 58a8813763 greybus: tracing: eliminate "location" comments
Each message event has a set of comments preceeding its definition.
One of them, "location", indicates where that event is used.  I
am certain that this comment will become out of date very easily.
Hopefully just the name of the event is a good enough suggestion
about where it will be used.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-20 17:19:03 -07:00
Alex Elder 630175698e greybus: tracing: define events using macros
A tracepoint event is defined with TP_PROTO() and TP_ARGS macros
that match that of the event's class.  A lot of repetition (and
opportunity for inadvertent errors) in tracepoint event definitions
can be eliminated by using a macro.  Define and use class-specific
event definition macros for gb_message and gb_host_device class
events.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-20 17:19:03 -07:00
Alex Elder f866e66f36 greybus: add operation traces
Define a new gb_operation event class, and define and use trace
events that record when an operation is created, finally destroyed,
and when its active count changes.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-20 17:12:25 -07:00
Bryan O'Donoghue 5015d5cff9 greybus: greybus_trace.h: Fix dodgy indentation
We should use tabs not spaces when indenting multi-line macros and ensure
that the relevant '\' characters are aligned to each-other.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-05 13:49:02 -07:00
David Lin 30b442b385 greybus: greybus_trace: Fix broken greybus ftrace
Enabling greybus ftrace event causes null pointer access due to
that gb_message to SVC has no Bundle. Fix it by handling this in
the trace header.

Testing Done:
$ echo 1 > /d/tracing/event/greybus/enable
 [002] ...1    54.504426: gb_message_send: greybus:1-svc op=0023 if_id=0 hd_id=0 l=0
 [002] ...1    54.504461: gb_host_device_send: greybus:greybus1 if_id=0 l=8

Signed-off-by: David Lin <dtwlin@google.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-03-22 00:31:31 -04:00
Johan Hovold 100e900008 greybus: use decimal notation for interfaces, bundles and cports
Fix up the last few places where hexadecimal rather than decimal
notation was used for interface, bundle and cport ids.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-08 15:31:14 -05:00
Johan Hovold 2adaefb145 greybus: hd: make host device a device
Make the host device a proper device in the kernel device model.

Host devices will be our new greybus-bus root devices.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25 15:27:06 -08:00
Viresh Kumar e3c25930d9 greybus: es1: Remove the (now) unused es1 driver
This was used by gbsim earlier, but not anymore. Lets remove it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-16 22:18:52 -08:00
Johan Hovold 2537636aba greybus: hd: rename host-device structure
Rename host-device structure gb_host_device to match our other
structures.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04 20:25:57 -08:00
Greg Kroah-Hartman 5d9c68da01 greybus: greybus_trace: use the bundle struct device instead of the connector
We are removing struct device from the gb_connection structure in the
near future.  The gb_bundle structure's struct device should be used as
a replacement.

This patch moves the greybus trace code to use the bundle pointer
instead of the connection pointer when printing out tracing messages.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
2015-10-19 12:09:10 -07:00
Bryan O'Donoghue 32b2b16737 greybus: tracepoints: add tracepoints for host_device tx/rx
This patch adds new tracepoint declarations to greybus_trace.h to allow for
capture of greybus host device tx and rx events. These two tracepoints
allow an observer to see the point where the hardware interface driver
performs the relevant read or write to receive or write the data it's been
given from the higher layer greybus driver.

The following two new tracepoints are declared:
- trace_gb_host_device_send
- trace_gb_host_device_recv

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-23 12:39:24 -07:00
Bryan O'Donoghue bb03ed9201 greybus: tracepoints: add tracepoint definitions
This patch adds greybus_trace.h with the following trace definitions

- trace_gb_message_send
- trace_gb_message_recv_request
- trace_gb_message_recv_response
- trace_gb_message_cancel_incoming
- trace_gb_message_cancel_outgoing

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-18 14:07:28 -07:00