From 7d206b2b804ea6e4b9f37611b9b8cf885db6f8fd Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Jan 23 2020 18:25:16 +0000 Subject: Add patch to ignore wakeup device uevents See https://bugzilla.redhat.com/show_bug.cgi?id=1790398 for more information. --- diff --git a/bolt-error-typedef.patch b/bolt-error-typedef.patch new file mode 100644 index 0000000..f982608 --- /dev/null +++ b/bolt-error-typedef.patch @@ -0,0 +1,27 @@ +From 5a739574608e5190816b3efd22e75f214c5fe4c4 Mon Sep 17 00:00:00 2001 +From: Christian Kellner +Date: Thu, 23 Jan 2020 19:07:05 +0100 +Subject: [PATCH] common: fix BoltError to be a typedef + +It was always meant to be a typedef not a (tentative) definition +of a global variable. +--- + common/bolt-error.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/bolt-error.h b/common/bolt-error.h +index 569da46..0486964 100644 +--- a/common/bolt-error.h ++++ b/common/bolt-error.h +@@ -36,7 +36,7 @@ G_BEGIN_DECLS + * + * Error codes used inside Bolt. + */ +-enum { ++typedef enum { + BOLT_ERROR_FAILED = 0, + BOLT_ERROR_UDEV, + BOLT_ERROR_NOKEY, +-- +2.24.1 + diff --git a/bolt.spec b/bolt.spec index 28d15e2..16722a4 100644 --- a/bolt.spec +++ b/bolt.spec @@ -1,10 +1,12 @@ Name: bolt Version: 0.8 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Thunderbolt device manager License: LGPLv2+ URL: https://gitlab.freedesktop.org/bolt/bolt Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: wakeup-uevents.patch +Patch1: bolt-error-typedef.patch BuildRequires: gcc BuildRequires: asciidoc @@ -38,7 +40,7 @@ boltctl, can be used to control the daemon and perform all the above mentioned tasks. %prep -%setup -q +%autosetup -p1 %build %meson -Ddb-name=boltd @@ -76,6 +78,11 @@ mentioned tasks. %ghost %dir %{_localstatedir}/lib/boltd %changelog +* Thu Jan 23 2020 Christian Kellner - 0.8-3 +- Add patch to ignore uevents from wakeup devices. See upstream issue + https://gitlab.freedesktop.org/bolt/bolt/issues/156 +- Add patch to fix BoltError not being a typedef. + * Wed Jul 24 2019 Fedora Release Engineering - 0.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/wakeup-uevents.patch b/wakeup-uevents.patch new file mode 100644 index 0000000..a10d420 --- /dev/null +++ b/wakeup-uevents.patch @@ -0,0 +1,50 @@ +From ea3e3e30eb3ce76f6a0ae816a0f35809872f4edf Mon Sep 17 00:00:00 2001 +From: Christian Kellner +Date: Mon, 13 Jan 2020 17:38:47 +0100 +Subject: [PATCH] manager: ignore wakeup device uevents for probing + +The probing detection code should ignore wakeup device uevents +because these virtual devices can be added (and removed) without +and correspondence to any physical thunderbolt device (un-)plug +events. +--- + boltd/bolt-manager.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/boltd/bolt-manager.c b/boltd/bolt-manager.c +index 877c008..c8b60da 100644 +--- a/boltd/bolt-manager.c ++++ b/boltd/bolt-manager.c +@@ -2043,6 +2043,16 @@ device_is_thunderbolt_root (struct udev_device *dev) + bolt_streq (driver, "thunderbolt"); + } + ++static gboolean ++device_is_wakeup (struct udev_device *dev) ++{ ++ const char *subsys; ++ ++ subsys = udev_device_get_subsystem (dev); ++ ++ return bolt_streq (subsys, "wakeup"); ++} ++ + static gboolean + probing_add_root (BoltManager *mgr, + struct udev_device *dev) +@@ -2080,6 +2090,12 @@ manager_probing_device_added (BoltManager *mgr, + if (syspath == NULL) + return; + ++ /* ignore events for wakeup devices which get removed ++ * and added at random time without any connection to ++ * any physical thunderbolt device */ ++ if (device_is_wakeup (dev)) ++ return; ++ + roots = mgr->probing_roots; + for (guint i = 0; i < roots->len; i++) + { +-- +2.24.1 +