diff --git a/plugins/synapticsmst/fu-plugin-synapticsmst.c b/plugins/synapticsmst/fu-plugin-synapticsmst.c index 0ac423402..208bc5a72 100644 --- a/plugins/synapticsmst/fu-plugin-synapticsmst.c +++ b/plugins/synapticsmst/fu-plugin-synapticsmst.c @@ -339,6 +339,7 @@ fu_plugin_update (FuPlugin *plugin, const gchar *aux_node; guint8 layer; guint8 rad; + gboolean reboot; /* extract details to build a new device */ kind = synapticsmst_device_kind_from_string (fu_device_get_metadata (dev, "SynapticsMSTKind")); @@ -357,15 +358,22 @@ fu_plugin_update (FuPlugin *plugin, if (!synapticsmst_device_enumerate_device (device, error)) return FALSE; + reboot = !fu_device_has_custom_flag (dev, "skip-restart"); fu_device_set_status (dev, FWUPD_STATUS_DEVICE_WRITE); if (!synapticsmst_device_write_firmware (device, blob_fw, fu_synapticsmst_write_progress_cb, dev, + reboot, error)) { g_prefix_error (error, "failed to flash firmware: "); return FALSE; } + if (!reboot) { + g_debug ("Skipping device restart per quirk request"); + return TRUE; + } + /* Re-run device enumeration to find the new device version */ fu_device_set_status (dev, FWUPD_STATUS_DEVICE_RESTART); for (guint i = 1; i <= SYNAPTICS_UPDATE_ENUMERATE_TRIES; i++) { diff --git a/plugins/synapticsmst/synapticsmst-device.c b/plugins/synapticsmst/synapticsmst-device.c index 6648b11fa..c896af222 100644 --- a/plugins/synapticsmst/synapticsmst-device.c +++ b/plugins/synapticsmst/synapticsmst-device.c @@ -1228,6 +1228,7 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device, GBytes *fw, GFileProgressCallback progress_cb, gpointer progress_data, + gboolean reboot, GError **error) { const guint8 *payload_data; @@ -1272,10 +1273,17 @@ synapticsmst_device_write_firmware (SynapticsMSTDevice *device, } /* enable remote control and disable on exit */ - locker = fu_device_locker_new_full (device, - (FuDeviceLockerFunc) synapticsmst_device_enable_remote_control, - (FuDeviceLockerFunc) synapticsmst_device_restart, - error); + if (reboot) { + locker = fu_device_locker_new_full (device, + (FuDeviceLockerFunc) synapticsmst_device_enable_remote_control, + (FuDeviceLockerFunc) synapticsmst_device_restart, + error); + } else { + locker = fu_device_locker_new_full (device, + (FuDeviceLockerFunc) synapticsmst_device_enable_remote_control, + (FuDeviceLockerFunc) synapticsmst_device_disable_remote_control, + error); + } if (locker == NULL) return FALSE; diff --git a/plugins/synapticsmst/synapticsmst-device.h b/plugins/synapticsmst/synapticsmst-device.h index ab95f2edb..04901c505 100644 --- a/plugins/synapticsmst/synapticsmst-device.h +++ b/plugins/synapticsmst/synapticsmst-device.h @@ -82,6 +82,7 @@ gboolean synapticsmst_device_write_firmware (SynapticsMSTDevice *device, GBytes *fw, GFileProgressCallback progress_cb, gpointer user_data, + gboolean reboot, GError **error); G_END_DECLS diff --git a/plugins/synapticsmst/synapticsmst.quirk b/plugins/synapticsmst/synapticsmst.quirk index c6c45f4f4..fd03993c0 100644 --- a/plugins/synapticsmst/synapticsmst.quirk +++ b/plugins/synapticsmst/synapticsmst.quirk @@ -10,6 +10,10 @@ # DeviceKind != system # * Will map to a GUID containing each comma delimitted substring # * These GUIDs will look like MST-${DEVICEKIND}-${CHIPID}-${BOARDID} +# +# By default the Synaptics MST device will restart after update +# To override this behavior add the custom flag "skip-restart" +# [SynapticsMSTBoardID=0] Name = Synaptics EVB development board