From e59bee1f45c20bba817cb8266de361ba079a2bd4 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 18 Feb 2019 08:03:49 -0600 Subject: [PATCH] trivial: dell-dock: make passive dependency include Hub2 1.42 An extra race condition bug exists due to the MCU firmware on Hub2. Require to already be on 1.42 or later to use passive flow. --- plugins/dell-dock/fu-dell-dock-i2c-ec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/dell-dock/fu-dell-dock-i2c-ec.c b/plugins/dell-dock/fu-dell-dock-i2c-ec.c index 9f81200fe..ec3c9e299 100644 --- a/plugins/dell-dock/fu-dell-dock-i2c-ec.c +++ b/plugins/dell-dock/fu-dell-dock-i2c-ec.c @@ -312,6 +312,7 @@ fu_dell_dock_ec_get_dock_info (FuDevice *device, const FuDellDockDockInfoHeader *header = NULL; const FuDellDockEcQueryEntry *device_entry = NULL; const FuDellDockEcAddrMap *map = NULL; + const gchar *hub_version; guint32 oldest_base_pd = 0; g_autoptr(GBytes) data = NULL; @@ -447,13 +448,18 @@ fu_dell_dock_ec_get_dock_info (FuDevice *device, fu_device_set_version_lowest (device, self->ec_minimum_version); - /* TODO: Drop if minimum EC is set to 25+ + /* TODO: Drop part of clause if minimum EC is set to 26+ * Determine if the passive flow should be used when flashing */ - if (fu_common_vercmp (self->ec_version, "00.00.00.25") >= 0) { + hub_version = fu_device_get_version (self->symbiote); + if (fu_common_vercmp (self->ec_version, "00.00.00.26") >= 0 && + fu_common_vercmp (hub_version, "1.42") >= 0) { g_debug ("using passive flow"); self->passive_flow = PASSIVE_REBOOT_MASK; fu_device_set_custom_flags (device, "skip-restart"); + } else { + g_debug ("not using passive flow (EC: %s Hub2: %s)", + self->ec_version, hub_version); } /* TODO: drop if minimum board is to 5+ and minimum EC to 24+ */ if (self->data->board_id == 4 && oldest_base_pd >= 0x18) { @@ -580,6 +586,8 @@ fu_dell_dock_ec_to_string (FuDevice *device, GString *str) self->ec_minimum_version); g_string_append_printf (str, "\tblacklist pd: %d\n", self->pd_blacklist); + g_string_append_printf (str, "\tpassive flow: %d\n", + self->passive_flow); } gboolean