Commit Graph

20 Commits

Author SHA1 Message Date
Richard Hughes
6450d0deb4 Add FwupdInstallFlags of _IGNORE_CHECKSUM, _IGNORE_VID_PID and _IGNORE_POWER
The FWUPD_INSTALL_FLAG_FORCE flag has really unclear semantics, and ignoring a
file CRC, checksum or model ID should only be done when using fwupdtool actually
debugging a plugin or firmware parser.

Use the existing --force flag when we want a "gentle nudge" like reuploading
previously processed reports.
2020-10-07 13:15:09 +01:00
Mario Limonciello
10ef83c96f trivial: thunderbolt: drop unnecessary verbose statements 2020-09-28 15:58:53 -05:00
Mario Limonciello
7fc7da3999 thunderbolt: set install parent first flag for WD19TB
This is only applicable for kernel 5.9 or kernels that backported
the authenticate on disconnect patches.

For installation time this isn't very important since no device will
restart.  This also isn't relevant for the authenticate on disconnect
scenario.
However the manual activation scenario, it's important to activate the
WD19TB device first, followed by Thunderbolt.
2020-09-14 11:28:55 -05:00
Mario Limonciello
0f057d227b thunderbolt: if calling activate always use nvm_authenticate (#2374)
This will force the update to complete on logout or shutdown
2020-09-14 11:28:55 -05:00
Mario Limonciello
76cc23c736 thunderbolt: make sure that authorized to add updatable flag
If the device is not authorized, it may cause a composite update that it's part
of to not behave properly.

If device is authorized at runtime, add updatable flag at runtime as well
See #2374 for more details
2020-09-11 13:15:51 -05:00
Mario Limonciello
c756405529 trivial: thunderbolt: fixup retimer setting physical ID twice
Only needs to be set once in probe.
2020-09-11 13:15:51 -05:00
Mario Limonciello
6d0c4897e1 fu-udev-device: call rescan on the device for change events
This allows calling the correct method, and instead doesn't have
all the plugins try to process the event when they're missing
vfuncs
2020-09-11 13:15:51 -05:00
Mario Limonciello
4550cf51f8 trivial: stop creating sysfs-path metadata
This isn't needed anymore, it was only for legacy thunderbolt3 controllers
that didn't support native enumeration.
2020-09-10 12:42:14 -05:00
Mario Limonciello
64f3857751 thunderbolt: ignore non-updatable host controller (Fixes: #2373)
nvm_version will not export in Intel USB4 host controller running in
SW CM, there is no point in fwupd displaying a device for it.
2020-09-10 12:42:14 -05:00
Daniel Campello
0b74e2c91a thunderbolt: Call fu_device_set_physical_id() during probe for retimer
Error will show up if (priv->physical_id == NULL) on
fu_device_ensure_id(). This method is called after probe but before
setup on fu_device_open.

Call fu_device_set_physical_id() on fu_thunderbolt_device_probe()
for the retimer case.

Fixes https://github.com/fwupd/fwupd/issues/2371

Change-Id: I0e462fff5e8abf6073318f6424b6736afc8259b8
2020-09-09 17:33:18 -05:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +01:00
Mario Limonciello
0ebddc9fcf trivial: fix some unused variables found by clang-10 2020-08-10 10:33:31 -05:00
Mario Limonciello
c90eca4787 thunderbolt: add support for retimers 2020-07-03 12:56:44 -05:00
Mario Limonciello
58d6d329e8 trivial: thunderbolt: don't set update error for missing nvmem
Trying to explain why ICL thunderbolt isn't updatable doesn't help
people.  It just causes fwupdmgr and fwupdtool to show the device
front and center with a confusing message.

Instead don't populate the message and by the default device filter
it will be hidden.

See #2212 for background.
2020-06-24 06:31:58 +01:00
Mario Limonciello
834b28009d Add support for a delayed activation flow for Thunderbolt
This allows delaying the activation of Thunderbolt firmware until
shutdown/reboot or when the dock is unplugged.

This functionality requires features in the kernel:
https://lore.kernel.org/linux-usb/20200622143035.25327-1-mario.limonciello@dell.com/T/#t

Matrix of cases to support:

* Distro Old Linux kernel (doesn't support authenticate on disconnect)

  - WD19TB: Should have `skips-restart` flag set
    No flush or activate features called in `thunderbolt` plugin.
    `dell_dock` plugin will activate at end of composite update

  - All other devices: Shouldn't have flags set
    Should authenticate in Thunderbolt plugin.
    `1 > nvm_authenticate`

* Distro New Linux kernel (supports authenticate on disconnect)

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure TBT device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Shouldn't have flags set
    Should authenticate in `thunderbolt` plugin.
    `1 > nvm_authenticate`

* ChromeOS (supports authenticate on disconnect)

  - `thunerbolt.conf` will have `DelayedActivation=true`.

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Should have both `usable-during-update` and `skips-restart` set
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate`
    Will activate upon logout/shutdown/reboot
    `1 > nvm_authenticate`
2020-06-22 16:09:10 -05:00
Mario Limonciello
768a2680a6 Introduce a new flag skips-restart
This flag is used internally by plugins to indicate that they will
skip the phase of firmware installation that power cycles a device.

It is intended to be set by quirks or other environment settings.
2020-05-06 15:13:40 -05:00
Mario Limonciello
94874cd067 thunderbolt: Add a new subclassed thunderbolt firmware update type
Thunderbolt images brought in from the SPI don't have a FARB header.
Thunderbolt update images do.

So these two types of images need to be handled separately from the
firmware parser.
2020-05-06 11:13:51 -05:00
Mario Limonciello
16a96fbbe7 thunderbolt: Allow quirks to skip the authentication step
This will allow being able to PoC some future kernel work to split
up steps.
2020-04-29 13:15:45 -05:00
Mario Limonciello
6358e23490 thunderbolt: drop support for force power
The kernel interface for force power doesn't support tracking the state
of the device, and so this had to be tracked by fwupd.

Unfortunately due to system and thunderbolt controller firmware behavior
on some systems the thunderbolt controller /still/ didn't return even
when force power state was accurately tracked.

The device model for the uevent related to the device removal being ignored
doesn't really fit into the current fwupd architecture anymore either.

Lastly this is a very legacy feature at this point.  Thunderbolt3 controllers
distributed in the last 3 years all operate in 'native' mode meaning that
they will always be powered and use runtime power management.

USB4 controllers won't have a concept of being force powered.
USB4 reimers will have this concept, but the state will be tracked by the
kernel and obfuscated from userspace.

So with all that said, tear out all of the force power related code.
2020-04-29 13:15:45 -05:00
Mario Limonciello
ec44dd3353 Modernize the thunderbolt plugin.
Remove it's references to it's own GUdevclient and instead use
FuUdevDevice.

Some intentional casualties of the move:
* Plugin metadata around native and safe mode dropped.
  - These haven't been useful in debugging anything and aren't relevant
    on new hardware
* Extra GUID for 2 host controllers in same system dropped
  - Although this was normally static information BIOS operations like
    turning off PCI-E SD card reader or LAN controller changed things.
* The NVM version is parsed directly instead of through gudev to prevent
  cached data breaking change events.

Remaining TODO:
* Force power w/ thunderbolt-power doesn't work
2020-04-29 13:15:45 -05:00