Blame SOURCES/0001-wacom-usb-Retry-set_report-on-failure.patch

75fbaf
From 8076090a000d4adde59fddeadb17a6f769993d1e Mon Sep 17 00:00:00 2001
75fbaf
From: Jason Gerecke <killertofu@gmail.com>
75fbaf
Date: Tue, 17 Jan 2023 14:24:14 -0800
75fbaf
Subject: [PATCH] wacom-usb: Retry set_report on failure
75fbaf
75fbaf
Sometimes the flash process will randomly hang and time-out when sending
75fbaf
data to the device. We currently do not use any retry logic, so if this
75fbaf
happens the flash attempt is treated as a failure. This can be a source
75fbaf
of worry or frustration, especially if subsequent manual retries fail
75fbaf
in a similar way.
75fbaf
75fbaf
Adding FU_HID_DEVICE_FLAG_RETRY_FAILURE to the list of flags used when
75fbaf
calling fu_hid_device_set_report allows fwupd to try sending a block
75fbaf
multiple times if such a time-out (or other error) occurs. This makes
75fbaf
the flash process less prone to failure.
75fbaf
75fbaf
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
75fbaf
---
75fbaf
 plugins/wacom-usb/fu-wac-device.c | 4 +++-
75fbaf
 1 file changed, 3 insertions(+), 1 deletion(-)
75fbaf
75fbaf
diff --git a/plugins/wacom-usb/fu-wac-device.c b/plugins/wacom-usb/fu-wac-device.c
75fbaf
index 9162d19a9..714761b1e 100644
75fbaf
--- a/plugins/wacom-usb/fu-wac-device.c
75fbaf
+++ b/plugins/wacom-usb/fu-wac-device.c
75fbaf
@@ -182,7 +182,8 @@ fu_wac_device_set_feature_report(FuWacDevice *self,
75fbaf
 					buf,
75fbaf
 					bufsz,
75fbaf
 					FU_WAC_DEVICE_TIMEOUT,
75fbaf
-					flags | FU_HID_DEVICE_FLAG_IS_FEATURE,
75fbaf
+					flags | FU_HID_DEVICE_FLAG_IS_FEATURE |
75fbaf
+					    FU_HID_DEVICE_FLAG_RETRY_FAILURE,
75fbaf
 					error);
75fbaf
 }
75fbaf
 
75fbaf
@@ -920,6 +921,7 @@ fu_wac_device_init(FuWacDevice *self)
75fbaf
 	fu_device_set_install_duration(FU_DEVICE(self), 10);
75fbaf
 	fu_device_set_remove_delay(FU_DEVICE(self), FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE);
75fbaf
 	fu_device_set_firmware_gtype(FU_DEVICE(self), FU_TYPE_WAC_FIRMWARE);
75fbaf
+	fu_device_retry_set_delay(FU_DEVICE(self), 30); /* ms */
75fbaf
 }
75fbaf
 
75fbaf
 static void
75fbaf
-- 
75fbaf
2.39.1
75fbaf