summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/interface.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-05-27 17:26:24 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-27 12:19:29 -0700
commitd9fa3494b78a4e7fe9d8243ddd5ec472668f8fdf (patch)
treeffdd75be1195d188549ebeaa4099d80284b573be /drivers/staging/greybus/interface.c
parenta4b08df4e01beac8a5e90f5dfb8a1ffda943d73d (diff)
downloadlinux-d9fa3494b78a4e7fe9d8243ddd5ec472668f8fdf.tar.bz2
greybus: interface: avoid I/O to bootrom during removal
Add an interface quirk flag to suppress I/O during interface disable. This is needed to prevent I/O to the bootrom during controlled connection tear down (e.g. eject or driver unbind). This will be more obvious with the new connection tear-down procedure. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/interface.c')
-rw-r--r--drivers/staging/greybus/interface.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c
index 0f2b5914eae5..2cfb5a46e7d4 100644
--- a/drivers/staging/greybus/interface.c
+++ b/drivers/staging/greybus/interface.c
@@ -221,8 +221,8 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf)
* Check if the interface is executing the quirky ES3 bootrom that,
* for example, requires E2EFC, CSD and CSV to be disabled.
*/
- bootrom_quirks = GB_INTERFACE_QUIRK_NO_CPORT_FEATURES;
-
+ bootrom_quirks = GB_INTERFACE_QUIRK_NO_CPORT_FEATURES |
+ GB_INTERFACE_QUIRK_FORCED_DISABLE;
switch (init_status) {
case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED:
case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED:
@@ -674,6 +674,10 @@ void gb_interface_disable(struct gb_interface *intf)
trace_gb_interface_disable(intf);
+ /* Set disconnected flag to avoid I/O during connection tear down. */
+ if (intf->quirks & GB_INTERFACE_QUIRK_FORCED_DISABLE)
+ intf->disconnected = true;
+
list_for_each_entry_safe(bundle, next, &intf->bundles, links)
gb_bundle_destroy(bundle);