浏览代码

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>
Johan Hovold 9 年之前
父节点
当前提交
82278bfea0
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      drivers/staging/greybus/core.c

+ 8 - 0
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