mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-15 11:59:02 +00:00
thunderbolt: add configuration option to force retimer enumeration
Change-Id: I300b94291d6d989b4b1c88daaadc5f0f49ac88be
This commit is contained in:
parent
8624f454d6
commit
f58217a0ab
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <fwupdplugin.h>
|
#include <fwupdplugin.h>
|
||||||
|
|
||||||
|
#include "fu-thunderbolt-common.h"
|
||||||
#include "fu-thunderbolt-controller.h"
|
#include "fu-thunderbolt-controller.h"
|
||||||
#include "fu-thunderbolt-firmware-update.h"
|
#include "fu-thunderbolt-firmware-update.h"
|
||||||
#include "fu-thunderbolt-firmware.h"
|
#include "fu-thunderbolt-firmware.h"
|
||||||
@ -36,6 +37,8 @@ fu_plugin_thunderbolt_device_created(FuPlugin *plugin, FuDevice *dev, GError **e
|
|||||||
fu_plugin_add_rule(plugin,
|
fu_plugin_add_rule(plugin,
|
||||||
FU_PLUGIN_RULE_INHIBITS_IDLE,
|
FU_PLUGIN_RULE_INHIBITS_IDLE,
|
||||||
"thunderbolt requires device wakeup");
|
"thunderbolt requires device wakeup");
|
||||||
|
if (fu_plugin_get_config_value_boolean(plugin, "RetimerOfflineMode"))
|
||||||
|
fu_device_add_private_flag(dev, FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +80,7 @@ fu_plugin_thunderbolt_composite_prepare(FuPlugin *plugin, GPtrArray *devices, GE
|
|||||||
for (guint i = 0; i < devices->len; i++) {
|
for (guint i = 0; i < devices->len; i++) {
|
||||||
FuDevice *dev = g_ptr_array_index(devices, i);
|
FuDevice *dev = g_ptr_array_index(devices, i);
|
||||||
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
|
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
|
||||||
|
fu_device_has_private_flag(dev, FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION) &&
|
||||||
fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
|
fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
|
||||||
return fu_thunderbolt_retimer_set_parent_port_offline(dev, error);
|
return fu_thunderbolt_retimer_set_parent_port_offline(dev, error);
|
||||||
}
|
}
|
||||||
@ -90,6 +94,7 @@ fu_plugin_thunderbolt_composite_cleanup(FuPlugin *plugin, GPtrArray *devices, GE
|
|||||||
for (guint i = 0; i < devices->len; i++) {
|
for (guint i = 0; i < devices->len; i++) {
|
||||||
FuDevice *dev = g_ptr_array_index(devices, i);
|
FuDevice *dev = g_ptr_array_index(devices, i);
|
||||||
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
|
if ((g_strcmp0(fu_device_get_plugin(dev), "thunderbolt") == 0) &&
|
||||||
|
fu_device_has_private_flag(dev, FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION) &&
|
||||||
fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
|
fu_device_has_internal_flag(dev, FU_DEVICE_INTERNAL_FLAG_NO_AUTO_REMOVE)) {
|
||||||
g_usleep(FU_THUNDERBOLT_RETIMER_CLEANUP_DELAY);
|
g_usleep(FU_THUNDERBOLT_RETIMER_CLEANUP_DELAY);
|
||||||
return fu_thunderbolt_retimer_set_parent_port_online(dev, error);
|
return fu_thunderbolt_retimer_set_parent_port_online(dev, error);
|
||||||
|
@ -9,6 +9,13 @@
|
|||||||
|
|
||||||
#include <fwupdplugin.h>
|
#include <fwupdplugin.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION:
|
||||||
|
*
|
||||||
|
* Forces composite device components to be enumerated.
|
||||||
|
*/
|
||||||
|
#define FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION (1ull << 1)
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
fu_thunderbolt_udev_set_port_online(FuUdevDevice *device, GError **error);
|
fu_thunderbolt_udev_set_port_online(FuUdevDevice *device, GError **error);
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -289,7 +289,9 @@ fu_thunderbolt_controller_setup(FuDevice *device, GError **error)
|
|||||||
} else {
|
} else {
|
||||||
fu_device_add_internal_flag(device, FU_DEVICE_INTERNAL_FLAG_REPLUG_MATCH_GUID);
|
fu_device_add_internal_flag(device, FU_DEVICE_INTERNAL_FLAG_REPLUG_MATCH_GUID);
|
||||||
}
|
}
|
||||||
if (self->controller_kind == FU_THUNDERBOLT_CONTROLLER_KIND_HOST) {
|
if (self->controller_kind == FU_THUNDERBOLT_CONTROLLER_KIND_HOST &&
|
||||||
|
fu_device_has_private_flag(FU_DEVICE(self),
|
||||||
|
FU_THUNDERBOLT_DEVICE_FLAG_FORCE_ENUMERATION)) {
|
||||||
g_autoptr(GError) error_local = NULL;
|
g_autoptr(GError) error_local = NULL;
|
||||||
if (!fu_thunderbolt_controller_setup_usb4(self, &error_local))
|
if (!fu_thunderbolt_controller_setup_usb4(self, &error_local))
|
||||||
g_warning("failed to setup host: %s", error_local->message);
|
g_warning("failed to setup host: %s", error_local->message);
|
||||||
|
@ -7,3 +7,6 @@ MinimumKernelVersion=4.13.0
|
|||||||
|
|
||||||
# Forces delaying activation until shutdown/logout/reboot
|
# Forces delaying activation until shutdown/logout/reboot
|
||||||
DelayedActivation=false
|
DelayedActivation=false
|
||||||
|
|
||||||
|
# Uses offline mode interface to update retimers
|
||||||
|
RetimerOfflineMode=false
|
||||||
|
Loading…
Reference in New Issue
Block a user