diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 6d8f38144..2dd2f8475 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -319,6 +319,7 @@ done %config(noreplace)%{_sysconfdir}/fwupd/uefi_capsule.conf %endif %config(noreplace)%{_sysconfdir}/fwupd/redfish.conf +%config(noreplace)%{_sysconfdir}/fwupd/synaptics_mst.conf %config(noreplace)%{_sysconfdir}/fwupd/thunderbolt.conf %dir %{_libexecdir}/fwupd %{_libexecdir}/fwupd/fwupd diff --git a/plugins/synaptics-mst/fu-plugin-synaptics-mst.c b/plugins/synaptics-mst/fu-plugin-synaptics-mst.c index c4227da23..1fb34867d 100644 --- a/plugins/synaptics-mst/fu-plugin-synaptics-mst.c +++ b/plugins/synaptics-mst/fu-plugin-synaptics-mst.c @@ -23,12 +23,19 @@ struct FuPluginData { /* see https://github.com/fwupd/fwupd/issues/1121 for more details */ static gboolean -fu_synaptics_mst_check_amdgpu_safe (GError **error) +fu_synaptics_mst_check_amdgpu_safe (FuPlugin *plugin, GError **error) { gsize bufsz = 0; + g_autofree gchar *minimum_kernel = NULL; g_autofree gchar *buf = NULL; g_auto(GStrv) lines = NULL; + minimum_kernel = fu_plugin_get_config_value (plugin, "MinimumAmdGpuKernelVersion"); + if (minimum_kernel == NULL) { + g_debug ("Ignoring kernel safety checks"); + return TRUE; + } + /* no module support in the kernel, we can't test for amdgpu module */ if (!g_file_test ("/proc/modules", G_FILE_TEST_EXISTS)) return TRUE; @@ -38,13 +45,8 @@ fu_synaptics_mst_check_amdgpu_safe (GError **error) lines = g_strsplit (buf, "\n", -1); for (guint i = 0; lines[i] != NULL; i++) { - if (g_str_has_prefix (lines[i], "amdgpu ")) { - g_set_error_literal (error, - FWUPD_ERROR, - FWUPD_ERROR_NOT_SUPPORTED, - "amdgpu has known issues with synaptics_mst"); - return FALSE; - } + if (g_str_has_prefix (lines[i], "amdgpu ")) + return fu_common_check_kernel_version (minimum_kernel, error); } return TRUE; @@ -146,7 +148,7 @@ fu_plugin_backend_device_added (FuPlugin *plugin, FuDevice *device, GError **err gboolean fu_plugin_startup (FuPlugin *plugin, GError **error) { - return fu_synaptics_mst_check_amdgpu_safe (error); + return fu_synaptics_mst_check_amdgpu_safe (plugin, error); } gboolean diff --git a/plugins/synaptics-mst/meson.build b/plugins/synaptics-mst/meson.build index 3ebd646aa..dd3fbd0c1 100644 --- a/plugins/synaptics-mst/meson.build +++ b/plugins/synaptics-mst/meson.build @@ -36,6 +36,10 @@ shared_module('fu_plugin_synaptics_mst', ], ) +install_data(['synaptics_mst.conf'], + install_dir: join_paths(sysconfdir, 'fwupd') +) + if get_option('tests') testdatadirs = environment() testdatadirs.set('G_TEST_SRCDIR', meson.current_source_dir()) diff --git a/plugins/synaptics-mst/synaptics_mst.conf b/plugins/synaptics-mst/synaptics_mst.conf new file mode 100644 index 000000000..d7de296ac --- /dev/null +++ b/plugins/synaptics-mst/synaptics_mst.conf @@ -0,0 +1,5 @@ +[synaptics_mst] +# Minimum kernel version to allow use of this plugin on amdgpu +# It's important that all backports from this kernel have been +# made if using an older kernel +MinimumAmdGpuKernelVersion=5.2.0