dfu: Do not wait for a USB runtime if will-disappear is set

Fixes https://github.com/fwupd/fwupd/issues/4000
This commit is contained in:
Richard Hughes 2021-11-19 13:50:32 +00:00
parent d62d281871
commit e121332c97
2 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,8 @@ Plugin = dfu
# GD32VF103 Rev1
[USB\VID_28E9&PID_0189]
Flags = gd32,force-dfu-mode
Flags = gd32,force-dfu-mode,will-disappear
Name = GD32VF103
Vendor = GDMicroelectronics
# Realtek USB camera
@ -330,7 +331,7 @@ DfuAltName = @Flash/0x0/1*32Kg
# STM32F745 dfuse bootloader
[USB\VID_0483&PID_DF11]
Flags = absent-sector-size
Flags = absent-sector-size,will-disappear
Plugin = dfu
DfuForceVersion = 011a
DfuForceTimeout = 5000

View File

@ -1400,6 +1400,10 @@ fu_dfu_device_attach(FuDevice *device, FuProgress *progress, GError **error)
return FALSE;
}
/* there is no USB runtime whatsoever */
if (fu_device_has_flag(device, FWUPD_DEVICE_FLAG_WILL_DISAPPEAR))
return TRUE;
/* success */
priv->force_version = 0x0;
fu_device_add_flag(device, FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG);