Commit Graph

4304 Commits

Author SHA1 Message Date
Jan Tojnar
2f12e38e61 build: Re-use installed tests directory
It will make it easier for downstreams to patch the path.
2020-04-15 20:16:46 +01:00
Richard Hughes
e95613f670 vli: Do not show the USB 2 recovery devices for USB 3 hubs
The USB 2.0 controller is used as a 'backup' in case the USB 3.0 firmware fails
to start. Set USB 3 hubs as a greater priority so that the USB 2 ones do not
not get added if the USB 3 firmware is working.
2020-04-15 14:11:06 +01:00
Richard Hughes
95c3bf2617 vli: Add metadata to identify which is the same physical device 2020-04-15 14:11:06 +01:00
Richard Hughes
9c1829bf36 trivial: Allow plugins to add the same physical device with different priorities
Some plugins are just simple wrappers around custom GType creators and which
specific plugin created is not a good way to make a policy decision.

If this was added to work around a bug, we need to find a better solution or
fix the root cause.
2020-04-15 14:11:06 +01:00
Richard Hughes
fecc438521 trivial: Only auto-set the device priority if not already set
If the plugin has set the priority manually do not overwrite the value.
2020-04-15 14:11:06 +01:00
Richard Hughes
6cba2210c5 trivial: Allow setting the device priority from quirk files 2020-04-15 14:11:06 +01:00
Richard Hughes
df408d2ab1 trivial: Allow plugins to use fu_device_set_priority() directly 2020-04-15 14:11:06 +01:00
Sam Morris
6a161aa1d1 uefi: correctly format firmware version of Dynabook (né Toshiba) X30, X40 and probably others
Fixes #1998
2020-04-15 13:00:26 +01:00
Richard Hughes
a86b08f27c synaptics-cxaudio: Use the ->attach() device vfunc
This allows us to test the device reset using fwupdtool.
2020-04-15 12:36:11 +01:00
Richard Hughes
f23a906cfb synaptics-cxaudio: Wait for the device to reboot after writing firmware
Fixes an error where we get:

    failed to reload device: USB error on device 17ef:a396 : No such device
2020-04-15 12:36:11 +01:00
Richard Hughes
e1472c7f1f trivial: Add -Wmaybe-uninitialized to the list of warnings 2020-04-14 15:16:51 -05:00
Mario Limonciello
de60e04481 logitech_hidpp: decrease verbosity of messages that hid++ ID is missing
These are a regression of 9e755e2a5 when devices are asleep.
However due to the current kernel and daemon architecture, logitech devices
are not checked again at any time so if the device isn't awake when
fwupd is started or the unifying dongle is plugged in it won't be present.

This will be changed in the future when the kernel has change events
associated with devices waking up.

Fixes: #1973
2020-04-14 11:26:22 -05:00
Richard Hughes
d09f083e4a Prefer to update the child first if the order is unspecified
This fixes updating VLI hardware where there are multiple 'tiers' of USB hubs.
2020-04-14 17:11:20 +01:00
Richard Hughes
4299ba0914 Do not modify the device priority for child devices
This was incorrect when were were adding child devices by GUID (as we should
have been setting the transaction *order*, not the plugin *priority*) and just
completely unused now we're using the ParentGuid to set the parent and not
adding a reference to the child.
2020-04-14 17:11:20 +01:00
Richard Hughes
b7f5fc9a21 trivial: Add device priority to the to_string() output 2020-04-14 17:11:20 +01:00
Richard Hughes
b92f056bcc trivial: Add device order to the to_string() output 2020-04-14 17:11:20 +01:00
Richard Hughes
a51f0e11ea trivial: post release version bump 2020-04-14 10:36:12 +01:00
Richard Hughes
a3d6ee0e29 Release fwupd 1.4.0 2020-04-14 10:27:32 +01:00
Richard Hughes
cf0a7678b8 Allow removing device flags from quirk files
This also means we do the right thing when plugins call fu_device_add_flag()
directly, instead of just from a quirk file.

For instance, now `Flags = ~updatable` is a valid and useful thing to have and
allows us to remove the `Flags = None` hack.
2020-04-13 23:18:19 +01:00
Richard Hughes
fe11927eef Use black to format python source in a consistent manner
No code changes.
2020-04-13 23:06:30 +01:00
Richard Hughes
39dc902a42 Define SOURCE_VERSION when building a package
In this case git exists, but there's no git checkout and so the source version
is an empty string.
2020-04-10 16:18:25 +01:00
Mario Limonciello
11a7423d24 trivial: skip some self tests if system isn't set up properly
```
ok 10 /fwupd/client{remotes} # SKIP no valid daemon: Error calling StartServiceByName for org.freedesktop.fwupd: Failed to activate service 'org.freedesktop.fwupd': timed out (service_start_timeout=25000ms)
ok 11 /fwupd/client{devices} # SKIP no valid daemon: Error calling StartServiceByName for org.freedesktop.fwupd: Failed to activate service 'org.freedesktop.fwupd': timed out (service_start_timeout=25000ms)

```
2020-04-10 06:50:51 -05:00
Mario Limonciello
75b3904c2e trivial: show update message on downgrades too 2020-04-09 16:55:17 +01:00
Richard Hughes
b47d347823 trivial: Add some more self tests 2020-04-09 16:55:17 +01:00
Richard Hughes
2ab379e6c5 Only set the parent when adopting children
We use the ParentGuid quirk key to logically 'tie-together' different discrete
devices into one logical device, for instance making the USB soundcard in a hub
the child of the USB controller on the same PCB.

Setting the discrete child is sometimes correct, for instance when rebooting
the hub, the audio device also goes away -- but it's also sometimes wrong.
If we set the child for a discrete device and the parent does *not* go away
then we get to a situation where the child reference may no longer be valid
if it comes back as a different object.
When we try to remove this no-longer-valid device with the removal timeout the
daemon segfaults. This is realy bad.

Continue to allow using fu_device_add_child() in plugins, where we know the
child lifecycle is is matched by the the parent. In the engine just set the
weak parent directly and let the client use this information to show the tree
of logical devices correctly. There's no benefit to setting up the children as
referenced objects anyway.
2020-04-09 16:55:17 +01:00
Richard Hughes
6affeb84fc Revert "Only set the parent ID when adopting children"
This reverts commit b4f14e8f0f.
2020-04-09 16:55:17 +01:00
Richard Hughes
f6b4d92dae Revert "Fix a crash when removing device parents"
We add the child devices using fu_plugin_device_add() so we have to remove them
the same way. The original fix is wrong, as it leaves child devices when the
parent is removed.

This reverts commit 02b588c035.
2020-04-09 15:46:41 +01:00
Richard Hughes
0e8ee75890 trivial: Add some more device regression tests 2020-04-09 09:55:30 +01:00
Richard Hughes
a8c6c02459 Do not conditionalize attach() and detach() on IS_BOOTLOADER
This is nice in theory, until you need to look at the bootloader status of the
parent, or of a different device entirely. Handle this in plugins for the few
cases we care about and stop setting or clearing IS_BOOTLOADER manually just to
get the vfuncs to be run.

Note: I do not think we want to use cleanup() for attaching devices not in
bootloader states -- as cleanup is only run at the end of the composite update.
2020-04-09 09:55:30 +01:00
Richard Hughes
d5e9f59804 trivial: Use the official libjcat packages in the Fedora CI 2020-04-09 09:40:38 +01:00
Richard Hughes
d668225685 trivial: Allow filtering the device-test by the protocol
This allows us to run the device tests with all 4 supported types of unifying
dongles plugged in at the same time.
2020-04-09 09:07:13 +01:00
Richard Hughes
6c0e3d4efa Do not crash the daemon if a plugin does something dumb
In this case, a plugin was doing:

    g_autoptr(FuDevice) parent = fu_device_get_parent (device);

Which is not valid as it is `(transfer none)` but that shouldn't be enough to
get the daemon to crash. If the FuDevice refcount drops to zero just print
a critical warning with the pointer (no FuDevice details are available) and
remove the FuDeviceItem from the device list.

Using `G_DEBUG=fatal-criticals` it is very easy to backtrace at the right place
and find out which naughty plugin needs to go on the thinking spot.
2020-04-08 17:40:08 +01:00
Richard Hughes
b452c752aa trivial: Add some more device regression tests 2020-04-08 16:52:22 +01:00
Mario Limonciello
22306055e3 trivial: enable libjcat from Debian & Ubuntu distro builds 2020-04-08 10:32:34 -05:00
Richard Hughes
508fb380d0 wacom-usb: Add more sanity checks in case the daemon goes crazy 2020-04-08 16:30:15 +01:00
Richard Hughes
385b3b29b4 wacom-usb: Use a per-device cleanup function
We never had this when the plugin was created and it makes bluetooth updates
without main firmware updates reboot the device correctly.
2020-04-08 16:30:15 +01:00
Richard Hughes
02b588c035 Fix a crash when removing device parents
This was missed for the conversion of 1e571730d0
2020-04-08 15:29:12 +01:00
Richard Hughes
854e6f6362 Add some more device regression tests 2020-04-08 13:55:39 +01:00
Richard Hughes
3fc550e9ed wacom-usb: Add a lot of missing metadata about the devices 2020-04-08 13:55:39 +01:00
Richard Hughes
46eefe72c1 wacom-usb: Hide a lot of debugging behind FWUPD_WACOM_VERBOSE 2020-04-08 13:55:39 +01:00
Richard Hughes
cddf5b5b89 Only auto-add counterpart GUIDs when required
Doing this unconditionally means we accidentally 'bleed' one device mode into
another in a non-obvious way. For instance, a device might have two operating
modes with different GUIDs. If firmware is supplied for both modes in the same
cabinet archive then we might accidentally match the 'wrong' firmware when
the daemon has observed a mode switch and added the counterpart GUIDs.

We only really need the counterpart GUIDs when switching between Jabra, 8bitdo
and DFU devices where the DFU bootloader VID:PID is not manually tagged with
`CounterpartGuid` in a quirk file. In the general case lets keep it simple to
avoid difficult to find bugs.
2020-04-08 13:55:39 +01:00
Richard Hughes
372565aef8 trivial: Show what device test is being run right now 2020-04-08 13:55:39 +01:00
Ryan Lee
ac58360be7 ccgx: remove update message 2020-04-08 13:27:37 +01:00
Ryan Lee
d3fe478168 ccgx: add parent guid for hybrid dock 2020-04-08 09:09:54 +01:00
Richard Hughes
d38baba712 ccgx: Use a smaller timeout for i2c read and write operations 2020-04-07 19:50:43 +01:00
Richard Hughes
ebaa488b64 ccgx: Retry the register read and write with a i2c reset
Based on a patch by Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
2e0954f5c9 ccgx: Fix buffer overflow when reading out i2c status
Based on a patch by Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
1ae10f1016 Revert "ccgx: Reset the i2c bridge on status failure"
This reverts commit 49797d7de4.
2020-04-07 19:50:43 +01:00
Richard Hughes
5a7095dee4 ccgx: Retry the HID disconnect up to 5 times
Based on a patch by  Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
920713245d ccgx: Show a better error message on failure 2020-04-07 12:50:28 -05:00