Commit Graph

228 Commits

Author SHA1 Message Date
Richard Hughes
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
3f77af3cd4 Split out the kernel helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
4b1313b406 Split out the GByte helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
d6fd08e3a5 Remove some deprecated API 2022-06-03 13:47:11 -05:00
Richard Hughes
15add57746 Do not run some tests using -Db_sanitize=address 2022-05-24 08:24:24 +01:00
Mario Limonciello
a8b159503d trivial: thunderbolt: set signed payload attribute for some external devices
The signed payload attribute is currently set for devices connected through
Intel host controllers.  When Thunderbolt 3 devices are connected to non-Intel
host controllers they still support signed payloads.

Update the flag accordingly in these circumstances.
2022-04-12 08:25:48 +01:00
Mario Limonciello
1241e156b9 Don't export USB4 host controllers as updatable if they don't have unique GUIDs
Fixes: #4438
2022-03-24 16:44:27 +00:00
Daniel Campello
f58217a0ab thunderbolt: add configuration option to force retimer enumeration
Change-Id: I300b94291d6d989b4b1c88daaadc5f0f49ac88be
2022-03-18 14:26:34 -06:00
Richard Hughes
8b62bf6b64 Set the context in the right place more often 2022-03-16 09:18:29 +00:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Richard Hughes
758d5d8c6f Add a flag to indicate the device is signed or unsigned
Devices without either flag are unknown.
2022-02-22 19:12:06 +00:00
Kranthi Kuntala
c77847b7ff [thunderbolt] Add 5 secs delay after nvm update
- this is needed for the retimer to be accessible after update
- and to bring the port back to online

Signed-off-by: Kranthi Kuntala <kranthi.kuntala@intel.corp-partner.google.com>
Change-Id: I2234ebe23a55fc03f9ef30c1ea10febfe46a2003
2022-02-22 09:13:39 +00:00
Richard Hughes
fb4c3dfc9c trivial: Remove one warning from -Wunused-variable 2022-02-21 09:30:47 +00:00
Richard Hughes
e300e4ea1e thunderbolt: Fix up some error handling when updating usb4 retimers 2022-02-16 14:51:03 +00:00
Crag Wang
f7b6fa2e82 trivial: don't replug if thunderbolt device supports auth on disconnect
Fixes: #4262
2022-02-09 16:30:23 +00:00
Richard Hughes
915c4805f5 thunderbolt: Set the update timeout if required
I think this accidentally got inverted during the retimer split.
2022-02-07 14:25:58 +00:00
Kranthi Kuntala
97e6c1d7c2 [thunderbolt] remove the skip-restart flag for retimer
-this is indeed needed to reflect the updated version after system reboot

Signed-off-by: Kranthi Kuntala <kranthi.kuntala@intel.corp-partner.google.com>
Change-Id: Id4751d531528590cc93c08db0d0939a547f4d59f
2022-02-04 20:28:57 +00:00
Mario Limonciello
3f1dde7911 trivial: thunderbolt: use environment for overriding quirk location 2022-02-03 09:40:12 -06:00
Richard Hughes
d7b682430e thunderbolt: Set the retimer NVM version 2022-01-14 18:04:13 +00:00
Richard Hughes
045bc383a6 thunderbolt: Fix a typo in the USB4 port online 2022-01-14 18:04:13 +00:00
Richard Hughes
e03b8c46ed thunderbolt: Split the retimer and controller into two different objects
Although they do a lot of the same things, trying to deal with both
kinds of device in the same GObject type was making it very hard to
understand and maintain.

Split out two GObjects that both derive from FuThunderboltDevice.
2022-01-11 20:15:44 +00:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
736a56ccee Use the UDev devtype for quirk matching 2021-12-30 16:35:04 +00:00
Richard Hughes
5af2677373 thunderbolt: Fix a trivial retimer failure path 2021-12-30 16:32:52 +00:00
Richard Hughes
179f250b9a trivial: Properly namespace _INTERNAL_FLAG_NO_AUTO_REMOVE 2021-12-10 17:25:54 +00:00
Richard Hughes
3822422b1e trivial: Workaround two false 'unused' warnings from clang 2021-12-10 16:00:07 +00:00
Kranthi Kuntala
de1f971e14 thunderbolt: set ports offline on host controller
This change offline ports in the host controller
for retimers to enumerate in the NDA case.

-offline and rescan usb4 ports
-this enable enumeration of the retimers
-updates nvm to the enumerated retimers
-online usb4 port this will de-enumerate retimers

BUG=b:187506425
TEST=emerge-volteer fwupd

Signed-off-by: Kranthi Kuntala <kranthi.kuntala@intel.corp-partner.google.com>
2021-12-07 15:54:30 +00:00
Richard Hughes
2c72b24978 thunderbolt: Use fu_device_inhibit() to correctly use UPDATABLE_HIDDEN
By not exposing either UPDATABLE or UPDATABLE_HIDDEN the device is
hidden in gnome-firmware. Do what all the other devices do.
2021-11-10 17:23:25 +00:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Richard Hughes
51a1bc5b66 thunderbolt: Fix a small memory leak at startup 2021-10-27 15:57:53 +01:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Richard Hughes
bd43647554 Add fu_usb_device_new_with_context() helpers
This means the context is set at construction time, which is much less
fragile than setting the context manually.
2021-10-15 15:59:34 +01:00
Daniel Campello
a2129c05d1 thunderbolt: fix host controller probing 2021-09-24 14:25:16 -05:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
96b693fb50 trivial: thunderbolt: fix include order for future changes 2021-08-24 11:18:40 -05:00
Richard Hughes
a5a978b3f6 Rename some confusing API
More than one person has asked about 'why call fu_plugin_update() for a
reinstall or downgrade' and I didn't have a very good answer.

The plugin API is not officially stable, and we should fix things to be
less confusing. Use the same verbs as the FuDevice vfuncs instead.
2021-08-06 19:49:53 +01:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
dfaae2e837 Move amdgpu safety check into the plugin
There are now multiple plugins using drm_dp_aux_dev interface which
may potentially be combined with an amdgpu. Prevent exercising this
interface with any plugin using DP aux unless a new enough kernel is
installed.
2021-07-04 17:49:36 +01:00
Mario Limonciello
3a48af58c2 trivial: move kernel version check into common library code
This will be used by more than one plugin in an upcoming commit.
2021-06-16 14:54:17 -05:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Mario Limonciello
8541f678b7 trivial: don't set priority between thunderbolt and dell-dock plugins
The dell-dock plugin has a check whether or not to create the I2C based
child device based upon whether thunderbolt link is active during probe.

So there will never be a situation that daemon needs to de-duplicate and
set priority between the two plugins.
2021-06-09 07:42:58 -05:00
Richard Hughes
faa35e430b Show a warning if the device has no GType and the plugin has no default
This also renames a symbol to make it clear that you can call it more than once.

Fixes https://github.com/fwupd/fwupd/issues/3148
2021-04-15 16:52:56 +01:00
Mario Limonciello
1f9c035788 trivial: fix some trailing whitespace problems across the project 2021-04-09 16:02:20 +01:00
Mario Limonciello
395856afeb trivial: remove some unused variables
Caught by clang
2021-04-06 14:09:12 -05:00