aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-01-16 19:06:43 +0100
committerAleksander Morgado <aleksander@aleksander.es>2017-01-16 22:16:38 +0100
commita7f5e8835d6936fb545f73cb67887ab902060a6d (patch)
tree7666b7f137538daa0d207f33ccc97d7afd769328
parentebeb8bb2b7c5e95a339c6b3f7c39ae49f171cdbb (diff)
downloadexternal_libqmi-a7f5e8835d6936fb545f73cb67887ab902060a6d.zip
external_libqmi-a7f5e8835d6936fb545f73cb67887ab902060a6d.tar.gz
external_libqmi-a7f5e8835d6936fb545f73cb67887ab902060a6d.tar.bz2
qmi-firmware-update: if no download needed, still run reset
When selecting firmware preference we may be told that no firmware image needs to be downloaded, because it is already there. BUT, we still need to run the module power cycle so that on the next boot the new firmware preference is applied.
-rw-r--r--src/qmi-firmware-update/qfu-updater.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/qmi-firmware-update/qfu-updater.c b/src/qmi-firmware-update/qfu-updater.c
index ca7eb6d..1575e1d 100644
--- a/src/qmi-firmware-update/qfu-updater.c
+++ b/src/qmi-firmware-update/qfu-updater.c
@@ -609,9 +609,9 @@ run_context_step_cleanup_qmi_device (GTask *task)
g_clear_object (&ctx->cdc_wdm_file);
- /* If nothing to download, we're done */
+ /* If nothing to download we don't need to wait for QDL download mode */
if (!ctx->pending_images) {
- run_context_step_next (task, RUN_CONTEXT_STEP_LAST);
+ run_context_step_next (task, RUN_CONTEXT_STEP_WAIT_FOR_CDC_WDM);
return;
}
@@ -684,6 +684,12 @@ run_context_step_power_cycle (GTask *task)
return;
}
+ /* Boothold is required when firmware preference isn't supported; and if so,
+ * there must always be images to download. The only case in which we don't
+ * have images listed for download is when we're told that there is nothing
+ * to download via firmware preference. */
+ g_assert (ctx->pending_images != NULL);
+
/* Boothold reset */
reseter = qfu_reseter_new (self->priv->device_selection, ctx->qmi_client, FALSE, FALSE);
qfu_reseter_run (reseter,
@@ -728,10 +734,10 @@ set_firmware_preference_ready (QmiClientDms *client,
/* list images we need to download? */
if (qmi_message_dms_set_firmware_preference_output_get_image_download_list (output, &array, &error)) {
if (!array->len) {
- g_print ("device already contains the given firmware/config version: nothing to do\n");
+ g_print ("device already contains the given firmware/config version: no download needed\n");
+ g_print ("will power cycle to apply the new firmware preference...\n");
g_list_free_full (ctx->pending_images, (GDestroyNotify) g_object_unref);
ctx->pending_images = NULL;
- next_step = RUN_CONTEXT_STEP_CLEANUP_QMI_DEVICE;
} else {
GString *images = NULL;
QmiDmsFirmwareImageType type;