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

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