mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-15 04:23:21 +00:00
synapticsmst: Allow using a custom flag 'skip-restart'
This flag is intended for devices that the restart procedure will be performed as part of a transactional update by an external controller. None of the currently supported devices need this flag.
This commit is contained in:
parent
102074eeea
commit
812ac02bac
@ -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++) {
|
||||
|
@ -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 */
|
||||
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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user