Skip to content

Commit a3a79b5

Browse files
committed
Raised retry attempts during setup
1 parent 73f46ad commit a3a79b5

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

plugins/logitech-bulkcontroller/fu-logitech-bulkcontroller-device.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define BULK_TRANSFER_TIMEOUT 2500
2222
#define HASH_VALUE_SIZE 16
2323
#define MAX_RETRIES 5
24+
#define MAX_SETUP_RETRIES 50
2425
#define MAX_WAIT_COUNT 150
2526
#define POST_INSTALL_SLEEP_DURATION 80 * 1000 /* ms */
2627

@@ -860,7 +861,7 @@ fu_logitech_bulkcontroller_device_ensure_info(FuLogitechBulkcontrollerDevice *se
860861
{
861862
return fu_device_retry(FU_DEVICE(self),
862863
fu_logitech_bulkcontroller_device_ensure_info_cb,
863-
MAX_RETRIES,
864+
MAX_SETUP_RETRIES,
864865
&send_req,
865866
error);
866867
}
@@ -1157,7 +1158,7 @@ fu_logitech_bulkcontroller_device_set_time(FuLogitechBulkcontrollerDevice *self,
11571158
{
11581159
return fu_device_retry(FU_DEVICE(self),
11591160
fu_logitech_bulkcontroller_device_set_time_cb,
1160-
MAX_RETRIES,
1161+
MAX_SETUP_RETRIES,
11611162
NULL,
11621163
error);
11631164
}
@@ -1206,7 +1207,7 @@ fu_logitech_bulkcontroller_device_transition_to_device_mode(FuLogitechBulkcontro
12061207
{
12071208
return fu_device_retry(FU_DEVICE(self),
12081209
fu_logitech_bulkcontroller_device_transition_to_device_mode_cb,
1209-
MAX_RETRIES,
1210+
MAX_SETUP_RETRIES,
12101211
NULL,
12111212
error);
12121213
}
@@ -1288,6 +1289,14 @@ fu_logitech_bulkcontroller_device_setup(FuDevice *device, GError **error)
12881289
{
12891290
FuLogitechBulkcontrollerDevice *self = FU_LOGITECH_BULKCONTROLLER_DEVICE(device);
12901291

1292+
/* the hardware is unable to handle requests -- firmware issue */
1293+
if (fu_device_has_private_flag(device,
1294+
FU_LOGITECH_BULKCONTROLLER_DEVICE_FLAG_POST_INSTALL)) {
1295+
fu_device_sleep(device, POST_INSTALL_SLEEP_DURATION);
1296+
fu_device_remove_private_flag(device,
1297+
FU_LOGITECH_BULKCONTROLLER_DEVICE_FLAG_POST_INSTALL);
1298+
}
1299+
12911300
/* FuUsbDevice->setup */
12921301
if (!FU_DEVICE_CLASS(fu_logitech_bulkcontroller_device_parent_class)
12931302
->setup(device, error)) {
@@ -1316,14 +1325,6 @@ fu_logitech_bulkcontroller_device_setup(FuDevice *device, GError **error)
13161325
return FALSE;
13171326
}
13181327

1319-
/* the hardware is unable to handle requests -- firmware issue */
1320-
if (fu_device_has_private_flag(device,
1321-
FU_LOGITECH_BULKCONTROLLER_DEVICE_FLAG_POST_INSTALL)) {
1322-
fu_device_sleep(device, POST_INSTALL_SLEEP_DURATION);
1323-
fu_device_remove_private_flag(device,
1324-
FU_LOGITECH_BULKCONTROLLER_DEVICE_FLAG_POST_INSTALL);
1325-
}
1326-
13271328
/* set device time */
13281329
if (!fu_logitech_bulkcontroller_device_set_time(self, error)) {
13291330
g_prefix_error(error, "failed to set time: ");

0 commit comments

Comments
 (0)