Commit 47a2e676 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: core: disable bundle connections on hot-unplug

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 01547770
......@@ -161,8 +161,12 @@ static int greybus_remove(struct device *dev)
struct gb_bundle *bundle = to_gb_bundle(dev);
struct gb_connection *connection;
list_for_each_entry(connection, &bundle->connections, bundle_links)
gb_connection_disable_rx(connection);
list_for_each_entry(connection, &bundle->connections, bundle_links) {
if (bundle->intf->disconnected)
gb_connection_disable(connection);
else
gb_connection_disable_rx(connection);
}
driver->disconnect(bundle);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment