- 14 Oct, 2015 10 commits
-
-
Johan Hovold authored
Add missing error handling when registering the vibrator protocol during module init. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Include function, protocol name and id when printing the version response debug message. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Issue a warning if we fail to look up a protocol when dropping a reference. This should never happen as we hold a reference to the protocol module and protocols should only be deregistered at module unload. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
A protocol should be deregistered exactly once when the protocol module is being unloaded. This means that protocol deregister will never be called with active users as we take a module reference when looking up a protocol. Remove comment suggesting that we could one day forcefully stop a user of a protocol, and issue a big warning if a protocol is deregistered more than once or at some other time than during module unload (e.g. with active users). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Clean up and improve error messages. Demote a warning message to warning level. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Drop FIXME about sending responses in OOM situations. If we fail to allocate an operation for an incoming request, we have bigger problems than to worry about sending a response. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Replace a couple of pr_err with more informative dev_err and clean up the messages somewhat. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Replace the remaining pr_err with dev_err, and drop redundant function prefixes. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Fabien Parent authored
gb_connection_bind_protocol() returns proper error codes now and we should destroy the connection on failures. This change also fixes a NULL deref on hotplug when the control connection fails to initialize. Signed-off-by: Fabien Parent <fparent@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Fabien Parent authored
Toshiba UniPro IP requires to reset the CPort that has been used in a previous connection. This commit implement a new control request in order to reset CPorts on an APBridgeA. Signed-off-by: Fabien Parent <fparent@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 09 Oct, 2015 5 commits
-
-
Rui Miguel Silva authored
When translating capabilities from greybus to mmc values add some parentheses to clarify operation precedence and avoid static analyses warnings. [sdio.c:81]: (style) Clarify calculation precedence for '&' and '?' Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Rui Miguel Silva authored
It was missing the translation between the ocr vdd values of greybus to mmc_core values. This would make the detection of range voltage fail. mmc: host doesn't support card's voltages Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Rui Miguel Silva authored
In kernel versions bellow 3.15, the mmc_card_is_removable helper function has an extra check used for a suspend/resume hack. This made the gd_sdio_process_event to behave badly handling the module card insert event in that versions. So, just test bit the flag that we need, instead of using the helper function. This way will work in all kernel versions. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Rui Miguel Silva authored
Frequency maximum and minimum are needed to complete the configuration of the controller. Add them to get_caps response operation. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
We need to skip setting E2EFC and other flags to the SVC connection create request, for all cports, on an interface that need to boot over unipro, i.e. interfaces required to download firmware. This also adds a FIXME as we need to do it differently for ES3. Tested-by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 06 Oct, 2015 1 commit
-
-
Michael Scott authored
Currently, the greybus module .ko files are quite large and the following error was observed during Android build for each greybus module: strip: Unable to recognise the format of the input file `<module>` Fix the strip build step by replacing the undefined KERNEL_TOOLCHAIN_PATH variable with the GREYBUS_CC_PREFIX variable. Also used as the CROSS_COMPILER value for the module make. Signed-off-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 03 Oct, 2015 1 commit
-
-
Michael Scott authored
When using greybus build in a different Android setup, it was noted that several portions of this makefile rely on Linaro specific build items. Replace these with more generic build steps. - ANDROID_64 is only defined by Linaro build tasks, use TARGET_ARCH to establish ARCH= parameter for greybus build - KERNEL_TOOLS_PREFIX is only defined by Linaro build tasks. AOSP has a near equivalent variable: TARGET_TOOLS_PREFIX - build-greybus was dependant on subtask: android_kernel a task defined only by Linaro build tasks. Replace with a generic dependancy to the kernel binary located in $OUT (INSTALLED_KERNEL_TARGET). End result is the same: kernel must be built before greybus modules Signed-off-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 01 Oct, 2015 1 commit
-
-
Rui Miguel Silva authored
The generic_handle_irq_desc api only have changed in 4.3.0, so check against the correct version, if not will break builds for 4.2.x. Fixes: e7895cfc476 ("gpio: handle api change in generic_handle_irq_desc()") Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 30 Sep, 2015 1 commit
-
-
Greg Kroah-Hartman authored
generic_handle_irq_desc changed the api in the 4.2 kernel, so fix up the gpio driver to handle this properly to keep it working. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 29 Sep, 2015 2 commits
-
-
Johan Hovold authored
Remove legacy interface to "destroy" operations, which is now just a wrapper for gb_operation_put. The old interface name hides the fact that all operations are refcounted and may live on even after having "destroyed" them. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
Reset the hcpriv field before returning the message to greybus core in the OUT-URB completion callback. This fixes a use-after-free bug when sending responses to incoming requests as the final reference is then dropped when the message is returned. Reported-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 24 Sep, 2015 7 commits
-
-
Viresh Kumar authored
After downloading the firmware for the next boot stage, module's firmware (for current boot stage) jumps into it and the new firmware and sends hotplug request to SVC. On hotplug request from the SVC, the AP first removes the existing interface. At this time, there is no point sending disconnected event for the firmware protocol, for the firmware used in previous stage, as the new firmware wouldn't be aware about it. Set flags for firmware protocol to skip control-disconnected operations. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
The spec says that it doesn't need it, so dropping it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
The callers are ensuring that another interface doesn't exist with the same interface id and so there is no need to check that from gb_interface_create() anymore. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
The callers already have a valid interface pointer and there is no need for gb_interface_remove() to find the interface again. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
As per the module's boot sequence diagram, the AP needs to read/clear T_TstSrcIncrement attribute on hotplug (svc) events. Implement that. FIXME: This is module-hardware dependent and needs to be extended for every type of module we want to support. [ Based on work by Marti & Eli to clear the attribute with DME set] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
There are two cases where the AP may receive hotplug event for an existing interface, without first getting a hot-unplug request for it. - bootrom loading the firmware image and booting into that, which only generates a hotplug event. i.e. no hot-unplug event, as the module never went away. - Or the firmware on the module crashed and sent hotplug request again to the SVC, which got propagated to AP. Handle such cases by first removing the interface, with a clear print message shown to the user. And then following the normal hotplug sequence to add the interface. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Viresh Kumar authored
We already have a variable to access '&op->connection->dev' directly, lets reuse it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Jean Pihet <jean.pihet@newoldbits.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 23 Sep, 2015 7 commits
-
-
Bryan O'Donoghue authored
The datapoint we are using to return metrics across modules and cports shouldn't have a module identifier in it i.e. /sys/kernel/debug/gb_loopback/raw_latency_endo0 not /sys/kernel/debug/gb_loopback/raw_latency_endo0:X This patch removes the module_id used up to this point. Including module_id actually ends up making life harder in user-space so dropping it. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Bryan O'Donoghue authored
dev_name() will return the endo0 component of the string on it's own, there's no need to include it in the snprintf() when construting the debugfs name. This fixes 'endo0' appearing more than once in the debugfs name - shamefully slipped through testing cb570c93783f ('greybus/loopback: use dev_name to populate sysfsname'). Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Bryan O'Donoghue authored
If a thread is masked out it should not consume CPU cycles during a test. We set an arbitrary 100 millisecond sleep time for each masked out thread. Reasonably blunt instrument to ensure threads with nothing to do don't end up thrashing the acquisition/release of mutexes. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Bryan O'Donoghue authored
Currently we have sysfs entries that are created when the first incoming connection is created as sub-nodes of the module associated with that connection e.g. /sys/bus/grebus/devices/endo0:X where X is the module identifier associated with the new connection. This is conceptually incorrect since the sysfs entries we create actually aren't bound to a module. Depending on the order connections are brought up we can also have a situation where /sys/bus/greybus/devices/endo0:X has high-level control sysfs data-points but /sys/bus/greybus/devices/endo0:Y does not. Rather than needlessly replicate data-points across each endo0:X, endo0:Y, endo0:Z sysfs directories it is more sensible to locate the entries in /sys/bus/greybus/devices/endo0. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Bryan O'Donoghue authored
This patch hooks tracepoints for the handoff point to/from hardware. With these tracepoints in place we can view the time between gb_message_send and usb_submit_urb and similarly we can view the time between cport_in_callback and gb_message_recv_response/gb_message_recv_request - trace_gb_host_device_send - trace_gb_host_device_recv It provides standard tracepoints at /sys/kernel/debug/tracing/events/greybus/gb_host_device_send /sys/kernel/debug/tracing/events/greybus/gb_host_device_recv Giving outputs like gb_host_device_recv: greybus:2-1 if_id=0000 l=10 gb_host_device_send: greybus:2-1 if_id=0000 l=10 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Bryan O'Donoghue authored
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>
-
Bryan O'Donoghue authored
This patch drops tracking of internal latencies, it's possible to derive these times via kernel tracepoints and some user-space scripting. Since there's no other use of the internal timestamp than the loopback driver we remove the connection.c, connection.h, es1.c, es2.c and loopback.c inter-dependency in one go. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 22 Sep, 2015 1 commit
-
-
Greg Kroah-Hartman authored
The Qualcomm kernel builds with -Werror so the existing es2.c driver breaks the build due to unused static functions. As we are still hashing out exactly how to implement this logic at the moment, just comment out the functions to make the build be clean, no logic changes happen here at all. Reported-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
- 18 Sep, 2015 2 commits
-
-
Bryan O'Donoghue authored
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>
-
Bryan O'Donoghue authored
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>
-
- 17 Sep, 2015 2 commits
-
-
Viresh Kumar authored
The file names here weren't in sync with what we have today and the updates give a better picture of the same. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-
Johan Hovold authored
These host-driver callbacks were intended to allow host drivers to prepare a cport, something which can now be handled by the cport enable/disable callbacks instead. The current create/destroy are somewhat confusingly named as they were not supposed to create or destroy connections. They were however called from the unrelated helper functions that do create and destroy SVC connections. Furthermore, no errors were returned should the create callback fail, which should have caused the connection initialisation to fail. Remove these unused callbacks for now, and let us use the cport enable/disable callbacks that should be able handle all host cport initialisation (possibly after also adding an interface to provide information for endpoint-cport mapping). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-