Commit graph

1421 commits

Author SHA1 Message Date
Johan Hovold
5626e0bf99 greybus: interface: clean up error messages
Drop redundant __func__ and add missing errno values.

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-08 15:56:38 -05:00
Johan Hovold
ab66dd786b greybus: interface: fix interface-registration race
Fix race with user space when registering the interface.

The interface was registered before having been fully initialised,
something which could lead to user space accessing not-yet-initialised
attribute values (e.g. zero vendor and product ids or empty vendor and
product strings).

Note that this is also needed to be able to let attribute visibility
depend on manifest data (e.g. interface unlock).

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-08 15:56:38 -05:00
Johan Hovold
708d07a9ea greybus: interface: separate manifest parsing from bundle registration
Separate manifest parsing, including bundle and connection creation,
from bundle registration.

Note that this is also needed to allow the interface to not be
registered until the manifest has been parsed.

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-08 15:56:38 -05:00
Johan Hovold
a7e36d0eac greybus: bundle: separate bundle creation and registration
Separate bundle creation and registration.

Note that the bundle connections still needs to be initialised post
registration as protocol drivers create child devices to the bundle.

This will ultimately allow connection structures to be created while
parsing manifests, but the connections to not be enabled until a driver
is bound.

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-08 15:56:38 -05:00
Johan Hovold
bdc37354aa greybus: bundle: separate connection disabling and destruction
Separate bundle-connection disabling and destruction, and destroy the
connections along with the bundle.

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-08 15:56:38 -05:00
Johan Hovold
a234792d71 greybus: bundle: use dev_err for bundle-creation errors
Use dev_err to report duplicate bundle ids when creating a bundle.

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-08 15:56:38 -05:00
Johan Hovold
1db1b24304 greybus: bundle: kill the bundle lock
Kill the bundle lock, which looked like it protected the interface
bundle lists but really did not as lock-less manipulations were still
made.

No locking for the interface bundle list is in fact needed as bundles
are created along with the interface, and the list is only used to check
for duplicate bundle ids when parsing the manifest and to destroy the
bundles when removing the interface itself.

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-08 15:56:38 -05:00
Johan Hovold
1e6fb9a145 greybus: interface: remove defensive WARN_ON
Remove defensive WARN_ON testing for a NULL-interface when removing an
interface.

Every call site has just dereferenced the interface.

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-08 15:31:14 -05: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
7adeaae713 greybus: svc: create svc along with host device
Create svc device along with host-device and move the svc-connection to
the svc structure.

The svc connection is enabled when registering the host device, but as
the SVC protocol is currently driven by the SVC, we need to defer
registration of the svc device to the connection request handler.

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-08 15:31:14 -05:00
Johan Hovold
2c848944c1 greybus: hd: make svc-connection life time coincide with host-device
Create the svc-connection as part of the host device, and destroy it in
the host-device destructor.

The svc-connection is enabled when registering the host device, and
disabled when the host device is deregistered.

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-08 15:31:14 -05:00
Johan Hovold
d4c80bad59 greybus: hd: initialise device last
Initialise the struct device last when creating the host device.

After device_initialize(), or rather dev_set_name(), we must use
put_device to release the host device. Initialising last will allow for
a simpler release callback.

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-08 15:31:14 -05:00
Johan Hovold
0bf1f24419 greybus: connection: separate connection creation and enabling
Separate connection creation from enabling.

This will ultimately allow connection structures to be created while
parsing manifests, but the connections to not be enabled until a driver
is bound.

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-08 15:31:14 -05:00
Johan Hovold
3617311235 greybus: connection: unbind protocol at exit
Unbind protocol at connection exit rather than when the connection is
destroyed.

Now a protocol is only bound while a connection is enabled.

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-08 15:31:14 -05:00
Johan Hovold
30c2de77ae greybus: connection: bind protocol at init
Bind protocol at connection init.

This is an intermediate step in separating connection creation and
enabling.

Note that the protocol is currently still unbound when the connection is
destroyed.

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-08 15:31:14 -05:00
Johan Hovold
74c8316533 greybus: connection: fail on missing protocol
Make sure to fail properly when a protocol is missing.

This prevents the connection from being created, which is fine as we
currently never bind protocols post creation.

This is an intermediate step in moving protocol binding to
connection_init.

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-08 15:31:14 -05:00
Johan Hovold
2d54e4db4e greybus: bundle: kill gb_bundle_bind_protocols
Remove gb_bundle_bind_protocols() that was used to iterate over all
registered bundles and bind protocols to them should a protocol become
available post bundle creation.

The protocol abstraction as a generic construct is going away in favour
of class drivers. Connections will be setup when a class driver is
probed, and driver modules can be loaded on-demand by user space based
on uevents and modalias.

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-08 15:31:14 -05:00
Johan Hovold
a2cc7404e1 greybus: bundle: remove obsolete function prototype
Remove obsolete function prototype that was left after a recent code
relocation.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:34:46 -05:00
Johan Hovold
b395754a8e greybus: svc: add missing boot-status error message
Make sure to print an error message when aborting hotplug processing due
to failure to clear the interface boot status.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:34:46 -05:00
Bryan O'Donoghue
f42a6891d1 greybus: loopback: Ensure we reset stats once and once only
9445c54c ('greybus/loopback: drop bus aggregate calculation') removed the
aggregation of data in-kernel but instead of dropping the reset of
aggregate stastics, converted that reset into a second reset of the
connection-level stats. While this doesn't result in anything bad it's
also definitely a dumb thing to be doing, so, drop it now.

Also ensure we reset the bridge-specific tracking variables at least once.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:32:20 -05:00
Bryan O'Donoghue
b36f04fa94 greybus: loopback: Convert thread delay to microseconds
Currently the loopback code allows a delay between operations specified in
milliseconds. Having added asynchronous bi-directional support to loopback
its obvious that the delay value would be far more useful specified in
microseconds than milliseconds. So, this patch makes the necessary
conversion.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:32:20 -05:00
Bryan O'Donoghue
12927835d2 greybus: loopback: Add asynchronous bi-directional support
A particular ask from the firmware people for some time now has been the
ability to drive multiple outstanding bi-directional operations from
loopback to loopback Interfaces. This patch implments that change.

The approach taken is to make a call to gb_operation_send() and have
loopback capture the completion callback itself, with a parallel timer to
timeout completion callbacks that take too long. The calling thread will
issue each gb_operation_send() as fast as it can within the constraints of
thread-safety.

In order to support this addition the following new sysfs entries are
created on a per-connection basis.

- async
  Zero indicates loopback should use the traditional synchronous model
  i.e. gb_operation_request_send_sync().

  Non-zero indicates loopback should use the new asynchronous model i.e.
  gb_operation_send()

- requests_completed
  This value indicates the number of requests successfully completed.

- requests_timedout
  This value indicates the number of requests which timed out.

- timeout
  The number of microseconds to give an individual asynchronous request
  before timing that request out.

- timeout_min
  Read-only attribute informs user-space of the minimum allowed timeout.

- timeout_max
  Read-only attribute informs user-space of the maximum allowed timeout.

Note requests_completed + requests_timedout should always equal
iteration_max, once iteration_count == iteration_max. Also, at this time we
support either synchronous or asynchronous operations in one set of
transactions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:32:20 -05:00
Bryan O'Donoghue
2e238d71ed greybus: loopback: Convert cross-thread mutex to spinlock while relaxing connect locks
This patch converts the cross-thread mutex used to synchronize threads with
respect to each other to a spinlock. This is done to enable taking of locks
in the following patches while in atomic context. A small re-order of
locking in connection setup/tear-down is done to minimize the amount of
time spent in spinlock_irqsave().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:32:20 -05:00
Viresh Kumar
b933fa4a40 greybus: Prefix hexadecimal values with 0x while printing them
To clearly specify the base for printed values, prefix hexadecimal
values with 0x.

Suggested-by: Johan Hovold <johan@hovoldconsulting.com>
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>
2015-12-04 16:23:36 -08:00
Viresh Kumar
2f3db927cd greybus: don't use %h and %hh for printing short and char variables
Because the width of our fields is already known, we can use %0Nx (for
hex) to print N bytes and %u (for unsigned decimal), instead of using %h
and %hh, which isn't that readable.

This patch makes following changes:
- s/%hx/%04x
- s/%04hx/%04x
- s/%hhx/%02x
- s/%02hhx/%02x
- s/%hhu/%u
- s/%hu/%u
- s/%x/%02x for u8 value (only at a single place)

Suggested-by: Johan Hovold <johan@hovoldconsulting.com>
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>
2015-12-04 16:23:36 -08:00
Viresh Kumar
4aac6c5a14 greybus: svc: Use -EIO instead of -EINVAL for unipro errors
-EIO fits better here, rather than -EINVAL as the arguments to the
routine itself are valid, just that we failed while doing unipro
transfers.

Suggested-by: Johan Hovold <johan@hovoldconsulting.com>
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>
2015-12-04 16:23:36 -08:00
Viresh Kumar
c5b6df9c8d greybus: Documentation: Arrange entries in alphabetical order
The order of entries in sysfs-bus-greybus file doesn't match the order
files/directories in sysfs on a real board. More specifically, N-svc
comes at last and ap_interface_id comes before endo_id within the svc.

Fix that.

Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-04 16:22:40 -08:00
Johan Hovold
c29c016f7e greybus: core: add bundle id to bundle uevents
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-04 15:37:59 -08:00
Johan Hovold
c5e6b05ce4 greybus: core: add interface id to interface and bundle uevents
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-03 17:25:28 -08:00
Johan Hovold
f0960d05f5 greybus: core: add bus id to uevents
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-12-03 17:25:28 -08:00
Johan Hovold
1cacb456fd greybus: svc: flush workqueue at connection exit
Make sure to flush the workqueue from hotplug and hotunplug events when
the svc connection is tore down.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:38:54 -08:00
Bryan O'Donoghue
8e1d6c336d greybus: loopback: drop bus aggregate calculation
At some point we had a statement in a Jira work item to pull out 'bus
level' data from greybus and to have messages to different interfaces be
synchronized with respect to each other. Synchronizing threads with respect
to each other is slow and it turns out we can get the same 'bus level'
stastics by making the user-space test application smarter.

That's great news for the in-kernel code since it means we can cut out a
whole lot of code to-do with calculating 'bus level' aggregate data and we
can stop forcing threads to hit a rendezvous before sending out another
loopback operation.

So this patch drops bus level aggregates in favour of doing that in
user-space. It subtracts a lot of code and cycles that in practice nobody
cares about anyway.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:37:24 -08:00
Bryan O'Donoghue
9673dcebe4 greybus: loopback: Drop unused timeval variables
start and end aren't used and should be dropped.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:37:24 -08:00
Bryan O'Donoghue
d6a1a3b5ea greybus: loopback: Move latency_ts initialization to transfer routine
Initializing the bridge specific latency variables is only relevant to the
transfer operation, so make it loopback-transfer specific.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:37:24 -08:00
Bryan O'Donoghue
d9fb3754ec greybus: loopback: Relax locking during loopback operations
Currently a per-connection mutex is held during calls to
gb_operation_send_sync. It is not necessary to hold this lock and later
patches supporting multiple-outstanding bi-directional operations need to
take the per-connection lock and the gb_dev level lock. Since gb_dev must
always be taken before per-connection locks, it is both desirable and safe
to drop the lock now.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:37:24 -08:00
Rui Miguel Silva
1700507d8c greybus: lights: default value for v4l2 flash controls
V4l2 flash will return erro ERANGE if val(which is the default value)
is not defined. Just set it to the max value reported by the module.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:33:34 -08:00
Rui Miguel Silva
d644181fe6 greybus: lights: avoid channel torch double free
When attaching torch to a flash we release the channel torch resources,
but afterwards we do it again when releasing all the channels.
Just free all the resource at channel release.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:33:34 -08:00
Rui Miguel Silva
3f85c787b7 greybus: lights: add v4l2 flash operations
We do not implement any of the v4l2 flash operations, as the default
ones are ok for now, however the init needs anything define, if not it
will return an error. So, just define it and have an error free v4l2
flash init.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 15:33:34 -08:00
Viresh Kumar
e6420dac3d greybus: Documentation: Fix N-svc directory name
endo_id was present in place of the directory N-svc, fix it.

Fixes: 4f7b1833e78f ("Documentation/sysfs-bus-greybus: update the bus ABI documentation")
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>
2015-12-03 14:20:49 -08:00
Rui Miguel Silva
31bc2c9bcd greybus: spi: fix transfers bigger than greybus payload
Add helper functions calculate the tx and rx size possible that fit a
greybus payload size and change the operation creation to adjust to that.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 14:20:49 -08:00
Michael Scott
11aa7121ed greybus: build: remove Android makefile
There is no standard way of building a kernel from source in
Android.  Each device/SoC can (and do) implement it in their own way.
To that end, let's remove this makefile and let each device define
how they want to build the modules.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-03 13:47:49 -08:00
Rui Miguel Silva
b343f6afd7 greybus: spi: add master and device config operations
Add master and device config operations, one is to merge all the master
operations and the device config will allow to fetch and add devices for
each chip select.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 17:04:58 -08:00
Rui Miguel Silva
b455c84655 greybus: spi: add rdwr field to transfer descriptor
Add read and/or write field to transfer descriptor to make it possible
to identify the type of transfer.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 17:04:58 -08:00
Johan Hovold
3e48acac26 greybus: svc: fix racy hotplug handling
Fix racy hotplug handling by serialising all processing of hot-plug and
unplug requests using a single-threaded dedicated workqueue.

This fixes a reported crash during enumeration when processing multiple
events.

The current svc implementation does not handle concurrency at all (e.g.
no interface list lock or refcounting) so we need to use the big hammer
for now.

Note that we will eventually want to process events for different
interfaces in parallel, but that we'd still need a workqueue in order
not to starve other svc requests (e.g. for timesync).

Reported-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Johan Hovold
57ccd4b087 greybus: svc: defer processing of hot-unplug requests
Defer processing also of hot-unplug events.

This is a step towards serialising hot-plug and unplug event processing.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Johan Hovold
9ae4109e5d greybus: svc: generalise deferred request handling
Clean up and generalise deferred request handling by simply storing a
reference-counted pointer to the operation itself in the work context.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Johan Hovold
b4ee82ece8 greybus: svc: clean up interface-remove helper
Pass the svc rather than its connection to the interface remove helper.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Johan Hovold
24456a09a8 greybus: svc: clean up deferred hotplug handler
Rename the hotplug request message, and clarify that the message size
has already been verified by the primary handler.

Also add a debug message that includes the interface id.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Johan Hovold
d34a3643fe greybus: svc: clean up hotplug/unplug request handlers
Clean up hotplug/unplug request handlers somewhat.

Also add a debug message to both handlers that includes the interface id.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-02 16:55:45 -08:00
Viresh Kumar
f1e941a6e4 greybus: firmware: Fetch es2 VID/PID to distinguish module vendors
The es2 chip doesn't have VID/PID programmed into the hardware and we
need to hack that up to distinguish different modules and their firmware
packages.

This fetches VID/PID (over firmware protocol) for es2 chip only, when
VID/PID already sent during hotplug are 0.

Since only the bootrom contains a firmware protocol cport, this only
affects bootrom's working and not nuttx.

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>
2015-11-30 08:19:12 -08:00