summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-06-09 18:42:19 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-09 12:12:43 -0700
commit82278bfea04c9cda1e01ac4fe41938cc3f5f1252 (patch)
treea3766cbb45a9b8ae84149da68a7d50de9232f9ab /drivers/staging/greybus/core.c
parentc0b06a6d4e07902f7e1eef88d242901c0a1faf03 (diff)
greybus: fix forced disable of offloaded connections
Core disables all connections for bundles whose interface is already gone in order to avoid unnecessary operation timeouts during driver disconnect. This isn't needed for offloaded connections (as the AP can not send requests over such connections), and in fact must not be done since only the bundle driver currently knows how to disable I/O on such connections in a class-specific way (this may eventually be handled by core though). Also add comment about why connection are disabled early on forced disconnect. Testing Done: Tested on EVT2. Reported-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Tested-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r--drivers/staging/greybus/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index c8129068001d..5811299c96fa 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -189,7 +189,15 @@ static int greybus_remove(struct device *dev)
struct gb_bundle *bundle = to_gb_bundle(dev);
struct gb_connection *connection;
+ /*
+ * Disable (non-offloaded) connections early in case the interface is
+ * already gone to avoid unceccessary operation timeouts during
+ * driver disconnect. Otherwise, only disable incoming requests.
+ */
list_for_each_entry(connection, &bundle->connections, bundle_links) {
+ if (gb_connection_is_offloaded(connection))
+ continue;
+
if (bundle->intf->disconnected)
gb_connection_disable_forced(connection);
else