• Johan Hovold's avatar
    greybus: interface: implement generic mode-switch functionality · 55742d2a
    Johan Hovold authored
    Add a generic interface for bundle drivers to use to request that a
    mode switch is carried out on its behalf.
    
    Mode switching involves tearing down all connections to an interface,
    sending a unidirectional mode-switch request, and waiting for a mailbox
    event that triggers deferred control connection reset and re-enumeration
    of the interface. In case of a timeout waiting for the interface mailbox
    event, or on other errors, the interface is powered off.
    
    All of this needs to be done by core from work-queue context in order
    not to block incoming SVC requests and bundle-device tear down. Care
    must also be taken to serialise against concurrent module removal events
    and eject requests.
    
    Special handling of legacy mode-switching is also added in order to
    continue to support the ES3 bootrom.
    Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
    55742d2a
svc.c 38.8 KB