greybus: module: implement controlled module removal
authorJohan Hovold <johan@hovoldconsulting.com>
Sat, 23 Apr 2016 16:47:25 +0000 (18:47 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 25 Apr 2016 18:08:30 +0000 (11:08 -0700)
commit36602a2981c85de7b0b8600eb12cbad3d80eacd9
tree36d7d940d5c75957e5e0bc7fcaa67e6c18b2a532
parentb15d97d77017dc168c74c5e9aacfe14ff74dcbe9
greybus: module: implement controlled module removal

Implement controlled module removal through a new module attribute
"eject".

When a non-zero argument is written to the attribute, all interfaces of
the module are disabled (e.g. bundles are deregistered) and deactivated
(e.g. powered off) before instructing the SVC to physically eject the
module.

Note that the module device is not deregistered until the SVC has
reported the physical removal of all of its interfaces.

A new interface mutex is added to enforce interface state-change
serialisation.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Documentation/sysfs-bus-greybus
drivers/staging/greybus/interface.c
drivers/staging/greybus/interface.h
drivers/staging/greybus/module.c
drivers/staging/greybus/svc.c