diff --git a/libfwupdplugin/fu-device.c b/libfwupdplugin/fu-device.c index 1586c9edb..3ba69da2a 100644 --- a/libfwupdplugin/fu-device.c +++ b/libfwupdplugin/fu-device.c @@ -2955,6 +2955,8 @@ fu_device_remove_flag(FuDevice *self, FwupdDeviceFlags flag) /* allow it to be updatable again */ if (flag & FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION) fu_device_uninhibit(self, "needs-activation"); + if (flag & FWUPD_DEVICE_FLAG_UNREACHABLE) + fu_device_uninhibit(self, "unreachable"); } /** @@ -2996,6 +2998,10 @@ fu_device_add_flag(FuDevice *self, FwupdDeviceFlags flag) /* don't let devices be updated until activated */ if (flag & FWUPD_DEVICE_FLAG_NEEDS_ACTIVATION) fu_device_inhibit(self, "needs-activation", "Pending activation"); + + /* do not let devices be updated until back in range */ + if (flag & FWUPD_DEVICE_FLAG_UNREACHABLE) + fu_device_inhibit(self, "unreachable", "Device is unreachable"); } typedef struct { diff --git a/plugins/logitech-hidpp/fu-logitech-hidpp-device.c b/plugins/logitech-hidpp/fu-logitech-hidpp-device.c index 262524f5b..49b20d5c8 100644 --- a/plugins/logitech-hidpp/fu-logitech-hidpp-device.c +++ b/plugins/logitech-hidpp/fu-logitech-hidpp-device.c @@ -188,7 +188,6 @@ fu_logitech_hidpp_device_ping(FuLogitechHidPpDevice *self, GError **error) } if (g_error_matches(error_local, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE)) { fu_device_add_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UNREACHABLE); - fu_device_inhibit(FU_DEVICE(self), "unreachable", "device is unreachable"); return TRUE; } g_propagate_error(error, g_steal_pointer(&error_local)); @@ -197,12 +196,10 @@ fu_logitech_hidpp_device_ping(FuLogitechHidPpDevice *self, GError **error) /* device no longer asleep */ fu_device_remove_flag(FU_DEVICE(self), FWUPD_DEVICE_FLAG_UNREACHABLE); - fu_device_uninhibit(FU_DEVICE(self), "unreachable"); children = fu_device_get_children(FU_DEVICE(self)); for (guint i = 0; i < children->len; i++) { FuDevice *radio = g_ptr_array_index(children, i); fu_device_remove_flag(radio, FWUPD_DEVICE_FLAG_UNREACHABLE); - fu_device_uninhibit(radio, "unreachable"); } /* if the device index is unset, grab it from the reply */ diff --git a/plugins/logitech-hidpp/fu-logitech-hidpp-runtime-bolt.c b/plugins/logitech-hidpp/fu-logitech-hidpp-runtime-bolt.c index 4c715a3b5..52688206a 100644 --- a/plugins/logitech-hidpp/fu-logitech-hidpp-runtime-bolt.c +++ b/plugins/logitech-hidpp/fu-logitech-hidpp-runtime-bolt.c @@ -139,12 +139,10 @@ fu_logitech_hidpp_runtime_bolt_update_paired_device(FuLogitechHidPpRuntimeBolt * GPtrArray *children = NULL; /* any successful 'ping' will clear this */ fu_device_add_flag(FU_DEVICE(child), FWUPD_DEVICE_FLAG_UNREACHABLE); - fu_device_inhibit(FU_DEVICE(child), "unreachable", "device is unreachable"); children = fu_device_get_children(FU_DEVICE(child)); for (guint i = 0; i < children->len; i++) { FuDevice *radio = g_ptr_array_index(children, i); fu_device_add_flag(radio, FWUPD_DEVICE_FLAG_UNREACHABLE); - fu_device_inhibit(radio, "unreachable", "device is unreachable"); } } } else if (reachable) {