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

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: 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 a4b08df4
...@@ -221,8 +221,8 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) ...@@ -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, * Check if the interface is executing the quirky ES3 bootrom that,
* for example, requires E2EFC, CSD and CSV to be disabled. * 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) { switch (init_status) {
case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED: case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED:
case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED: case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED:
...@@ -674,6 +674,10 @@ void gb_interface_disable(struct gb_interface *intf) ...@@ -674,6 +674,10 @@ void gb_interface_disable(struct gb_interface *intf)
trace_gb_interface_disable(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) list_for_each_entry_safe(bundle, next, &intf->bundles, links)
gb_bundle_destroy(bundle); gb_bundle_destroy(bundle);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0) #define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1) #define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1)
#define GB_INTERFACE_QUIRK_NO_ARA_IDS BIT(2) #define GB_INTERFACE_QUIRK_NO_ARA_IDS BIT(2)
#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
struct gb_interface { struct gb_interface {
struct device dev; struct device dev;
......
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