summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
AgeCommit message (Collapse)Author
2017-11-11staging: greybus: Remove redundant license textGreg Kroah-Hartman
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-11staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman
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-01-07staging: greybus: remove timesync protocol supportGreg Kroah-Hartman
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>
2016-07-21greybus: pm: add error handling to bundle activationBartosz Golaszewski
The firmware now keeps the underlying hardware disabled until receiving the first Bundle Activate request. Additionally: requesting transition to a state the bundle is already in is no longer an error. We can now add proper error handling to the bundle activate call. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-20greybus: timesync: probe shouldn't complete until FrameTime sync doesBryan O'Donoghue
Currently the probe() function contains the asynchronous() variant of FrameTime synchronization. This patch converts to the synchronous() version of synchronization. This is required for two reasons first a probe() cannot reasonably be considered to be complete without successfully completing a time synchronization for Interfaces that care about that sync. Secondly scheduling the operation asynchronously means its possible the PM-runtime suspend() path can execute before the async timesync operation completes. For both reasons we want to run synchronization - synchronously. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-16greybus: hd: arche-platform: implement greybus shutdownDavid Lin
Implement platform driver shutdown callback to perform proper greybus shutdown so that the userspace unipro_shutdown service that shuts down the APB/SVC abruptly can be removed. The shutdown callback in arche-platform will first remove SVC so that all the Interface can be Deactivated in a sequence according to the spec before powering off the APB: Before: -> Arche/APB power off -> SoC power off After this patch: -> HD shutdown -> SVC shutdown -> Module shutdown -> Interface shutdown -> Bundle shutdown -> Arche/APB power off -> SoC power off Testing Done: - Observe all Interfaces are deactivated in the log during shutdown - Measure power off current and make sure no regression Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-14greybus: bundle: add runtime pm supportDavid Lin
This patch adds runtime pm support for the bundle core. Unbound bundle devices are always deactivated. During probe, Runtime PM status is set to enabled and active and the usage count is incremented. If the driver supports runtime PM, it should call pm_runtime_put() in its probe routine and pm_runtime_get_sync() in remove routine as bundle needs to be resume before it can be deactivated. Testing Done: - Check runtime_status of the bundle driver when bundle goes to suspend Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-14greybus: bundle: add activate and deactivateDavid Lin
AP shall send the Bundle Activate Operation to power on a bundle, and send the Bundle Deactivate Request after closing all the associated connections for power down. Testing Done: - Check for the return code of the bundle activate and deactivate operation sent Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-06-09greybus: hd: Export host device tracepoint from hd.cViresh Kumar
There is no point keeping this code in core.c, while its only used by hd.c. Relocate it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-09greybus: core: Make greybus_match_one_id() return boolViresh Kumar
This routine always returns 0 or 1 and a return type of 'bool' suits it the best. Update it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-09greybus: bootrom: Compile as a separate moduleViresh Kumar
User space doesn't break anymore with new greybus modules and its time to make bootrom a separate module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-09greybus: fix forced disable of offloaded connectionsJohan Hovold
Core disables all connections for bundles whose interface is already gone in order to avoid unnecessary operation timeouts during driver disconnect. This isn't needed for offloaded connections (as the AP can not send requests over such connections), and in fact must not be done since only the bundle driver currently knows how to disable I/O on such connections in a class-specific way (this may eventually be handled by core though). Also add comment about why connection are disabled early on forced disconnect. Testing Done: Tested on EVT2. Reported-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Tested-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-06greybus: timesync: Bind TimeSync into GreybusBryan O'Donoghue
TimeSync needs to bind into Greybus in a few places. - core.c To initialize its internal state and tear-down its internal state. To schedule a timesync to a newly added Bundle after probe() completes. - svc.c To get access to the SVC and enable/disable timesync as well as extracting the authoritative time from the SVC to subsequently disseminate to other entities in the system. - interface.c To get access to an Interface in order to inform APBx of timesync enable/disable and authoritative operations. This patch adds those bindings into Greybus core. 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-05-27greybus: core: avoid I/O to disconnected interfacesJohan Hovold
Add new helper to disable connections to interfaces that have already been disconnected (e.g. forcibly removed). The connection tear-down procedure differs enough depending on whether the interface is still present or already gone to warrant a dedicated helper. This will become more obvious with the new tear-down procedure, which involves I/O on the connection being tore down. This also simplifies handling of the legacy bootrom, which does not support the new tear-down operations. Specifically, this allows us to remove the early control-connection tear down during interface disable, and also avoids some error messages currently printed during legacy mode switch (i.e. bootrom boot-over-UniPro) and forcible removal. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-26greybus: tracing: fix hd tracesAlex Elder
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-20greybus: legacy: remove legacy driver supportDavid Lin
This patch removes the greybus legacy driver support Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-13greybus: core: Rename greybus_module_match()Viresh Kumar
greybus_module_match() doesn't match modules anymore but bundle devices and should be named correctly. Though we can use greybus_bundle_match() as well, rest of the kernel uses terminology like 'greybus_match_device' and so choosing that instead. Compile tested. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-04greybus: core: add MODULE uevent var for all control devicesSandeep Patil
The new ctrl device under interface is missing a MODULE uevent var, add it. Testing Done: cat 'uevent' from ctrl device. $ cat 1-3.3.ctrl/uevent DEVTYPE=greybus_control BUS=1 MODULE=3 INTERFACE=3 GREYBUS_ID=fffe0001/ffee0011 Signed-off-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: core: add module abstractionJohan Hovold
Add Greybus module abstraction that will be used to implement controlled module removal (eject) and represent module geometry. Greybus module devices correspond to physical modules and have one or more interfaces. Modules have an id that is identical to the id of their primary interface, which in turn is the interface with lowest numbered id. The module name is constructed from the bus and module id: <bus_id>-<module_id> Interfaces, bundles, and control devices are consequently renamed as <bus_id>-<module_id>.<interface_id> <bus_id>-<module_id>.<interface_id>.<bundle_id> <bus_id>-<module_id>.<interface_id>.ctrl As before, interface ids (and therefore in a sense now also module ids) correspond to physical interface positions on the frame. Modules have the following attributes: module_id num_interfaces where module_id is the id of the module and num_interface the number of interfaces the module has. Note that until SVC module-size detection has been implemented, all interfaces are considered to be part of 1x2 modules. Specifically, the two interfaces of a 2x2 module will be presented as two 1x2 modules for now. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-21greybus: core: make the control object be a deviceJohan Hovold
Make the control object be a greybus device. The control device will be used to expose attributes specific to greybus-type interfaces. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-04greybus: firmware: Rename to bootrom protocolViresh Kumar
Align with Greybus specifications and rename Firmware Protocol driver as Bootrom Protocol driver. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-26greybus: expose full 32 bits of vid/pid to userspaceGreg Kroah-Hartman
Now that userspace is ready for all 32 bits of the vid/pid, take off our mask and send the full values. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-01greybus: firmware: convert to bundle driverJohan Hovold
Convert the legacy firmware protocol driver to a bundle driver. This also fixes a potential crash should a (malicious) module have sent an early request before the private data had been initialised. Note that the firmware protocol needs to support the version request indefinitely since it has been burnt into ROM. In order to avoid having to update current module-loading scripts, keep this driver internal to greybus core at least until modalias support is added. Note that there is no MODULE_DEVICE_TABLE defined for firmware as we cannot have two greybus tables in one module on ancient 3.10 kernels and that the legacy driver is currently also internal to core. This needs be added once the driver can be built as a module. Testing Done: Tested on DB3. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: core: defer connection creation to driver probeJohan Hovold
Defer connection creation to bundle driver probe instead of creating them when initialising the interface and parsing the manifest. Store copies of the CPorts descriptors in the bundle for the drivers to use, and update the legacy driver. This is needed for drivers that need more control over host-device resource management, for example, when a protocol needs to use a dedicated host CPort for traffic offloading (e.g. camera data). This also avoids allocating host CPorts for bundles that are not bound to a driver or for remote CPorts that a driver does not need. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: add bundle class to the bundle ueventGreg Kroah-Hartman
When bundles are added and then removed, we have a race where we go to read the sysfs file, but it is now for a different bundle than the uevent was originally for. So add the bundle class to the uevent so we "know" what the correct bundle class was. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: core: disable bundle connections on hot-unplugJohan Hovold
Disable bundle connections in core before calling driver disconnect in case the interface is already gone. This avoids unnecessary timeouts on hot-unplug when a driver does I/O in its disconnect callback. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: svc: drop legacy-protocol dependencyJohan Hovold
Drop dependency on the legacy protocol abstraction. Remove the now unused and last legacy-protocol flag GB_PROTOCOL_SKIP_VERSION along with the protocol-flag feature. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: control: drop legacy-protocol dependencyJohan Hovold
Drop dependency on the legacy protocol abstraction. Instead implement the protocol-specific version request directly, and use the new interface for managing the control connection. Note that the version request is being removed from most protocols, but we need to keep the current request for the control protocol as-is indefinitely to maintain backwards compatibility (e.g. with the ES2/ES3 bootrom). Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: core: add defensive connection disable post disconnectJohan Hovold
Bundle drivers *must* disable their connections in the disconnect callback, but add a defensive test and warn about buggy drivers nonetheless. Note that bundle drivers would generally release their state containers in disconnect so a failure stop I/O could potentially lead to use-after-free bugs in any late operation completion callbacks. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: core: disable incoming operations pre disconnectJohan Hovold
Disable and flush incoming operations before calling driver disconnect. Bundle drivers are still responsible for disabling their connections in their disconnect callback. Note that specifically the legacy protocols must have incoming operations disabled when their connection_exit callback is called as that is where their state is deallocated. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: legacy: add legacy-protocol bundle driverJohan Hovold
Add the first Greybus bundle driver that will be used when transitioning from legacy Greybus protocols to bundle drivers. The legacy-protocol driver initially binds to all current bundle classes. In order to avoid having to update current module-loading scripts, keep this driver internal to greybus core at least until modalias support is added. Note that this prevents unloading any protocol drivers without first tearing down the host device due to a circular module dependency. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-13greybus: uevent: add GREYBUS_ID to ueventGreg Kroah-Hartman
This adds the GREYBUS_ID environment variable to all interface uevents to let userspace know the vendor/product id of the module interface that has been added or removed from the system. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
2016-01-09greybus: core: fix greybus device matchingJohan Hovold
The bus code should only match bundle devices for now, and must not assume all greybus devices are bundles. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-09greybus: core: fix greybus driver registrationJohan Hovold
Add missing bus type to driver structure when registering a greybus driver. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-04greybus: core: add bundle id to bundle ueventsJohan Hovold
Add the bundle id to bundle uevents. This is needed to identify bundles that are being removed (e.g. at hot-unplug). 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-12-03greybus: core: add interface id to interface and bundle ueventsJohan Hovold
Add the interface id to interface and bundle uevents. This is needed to identify interfaces that are being removed (e.g. at hot-unplug). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03greybus: core: add bus id to ueventsJohan Hovold
Add the bus id to all greybus uevents. This is needed to identify devices that are being removed (e.g. at hot-unplug). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: kill the endoJohan Hovold
Remove the now unused endo and module code. Note that the never-implemented serial and version attributes of the endo can be implemented as svc attributes if needed. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: svc: register svc device at helloJohan Hovold
Register the svc device upon reception of the HELLO request. The SVC HELLO request contains the endo id and AP interface id, which will be exposed from the svc device rather than the endo. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: hd: make host device a deviceJohan Hovold
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-25greybus: interface: rename vendor and product attributesJohan Hovold
Rename vendor and product attributes vendor_id and product_id. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-21greybus: move id-matching back to coreJohan Hovold
Move id-matching back to core and the bus code where it belongs. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: create host-device compilation unitJohan Hovold
Move everything host-device related to hd.c and hd.h. 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-04greybus: connection: kill gb_hd_connections_exitJohan Hovold
Connections are destroyed as part of interface tear down. If we fail to do that properly it's a bug that should be fixed rather than papered over by a fall-back clean up function. 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-10-21greybus: endo: move greybus_endo_setup() to endo.cViresh Kumar
It belongs to the endo layer and should be placed in endo.c instead. Do it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-10-19greybus: core: remove uevent handling for gb_connectionGreg Kroah-Hartman
As we are going to be removing the struct device from gb_connection, there is no need to do anything for uevents for them. So just remove the code. It wasn't doing anything anyway, so no functionality is lost here at all. As is_gb_connection() is no longer used, that is also removed in this patch. 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-09-23greybus: tracepoints: add tracepoints for host_device tx/rxBryan O'Donoghue
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-18greybus: operation, core: hook tracepoints into message opertionsBryan O'Donoghue
This patch hooks tracepoints for greybus messages - trace_gb_message_send - trace_gb_message_recv_request - trace_gb_message_recv_response - trace_gb_message_cancel_outgoing - trace_gb_message_cancel_incoming It provides standard tracepoints at /sys/kernel/debug/tracing/events/greybus/gb_message_send /sys/kernel/debug/tracing/events/greybus/gb_message_recv_response /sys/kernel/debug/tracing/events/greybus/gb_message_recv_request /sys/kernel/debug/tracing/events/greybus/gb_message_cancel_outgoing /sys/kernel/debug/tracing/events/greybus/gb_message_cancel_incoming Giving outputs like gb_message_recv_request: greybus:1-1.1:0 op=0001 if_id=0000 hd_id=0000 l=2 gb_message_send: greybus:1-1.1:0 op=0001 if_id=0000 hd_id=0000 l=2 Similarly perf events can be viewed with standard perf tools e.g. root@beaglebone:~# perf list 'greybus:*' greybus:gb_message_send [Tracepoint event] greybus:gb_message_recv_request [Tracepoint event] greybus:gb_message_recv_response [Tracepoint event] greybus:gb_message_cancel_outgoing [Tracepoint event] greybus:gb_message_cancel_incoming [Tracepoint event] Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-03greybus: connection: call gb_connection_exit() from gb_connection_destroy()Viresh Kumar
Both the routines are always called together and in the same sequence. Rather than duplicating this at different places, make gb_connection_destroy() call gb_connection_exit(). This also makes it more sensible, as gb_connection_init() is never called directly by the users and so its its counterpart shouldn't be called directly as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
2015-09-03greybus: core: fix hd-creation error pathJohan Hovold
Make sure to return an errno when a host-device buffer-size check fails. Fixes: 1f92f6404614 ("core: return error code when creating host device") Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>