Commit Graph

132 Commits

Author SHA1 Message Date
Richard Hughes
f425d29a28 Show a console warning if loading an out-of-tree plugin
Fixes https://github.com/hughsie/fwupd/issues/950
2019-01-19 07:26:20 +00:00
Richard Hughes
0e17e6d030 Fix building with -Wl,-z,defs
This allows us to find undefined references at compile time, not runtime.
2018-12-25 16:10:54 -06:00
Miklós Márton
7f59a6f844 Add Dell TB18DC to the known devices list 2018-12-25 16:08:10 -06:00
Richard Hughes
9729584ee4 Allow plugins to define support for a 'well-known' protocol
Future metadata from the LVFS will set the protocol the firmware is expected to
use. As vendors love to re-use common terms like DFU for incompatible protocols,
namespace them with the controlling company ID with an approximate reverse DNS
namespace.

This also allows more than one plugin to define support for the same protocol,
for instance rts54hid+rts54hub and synapticsmst+dell-dock.
2018-12-14 18:15:01 +00:00
Richard Hughes
0585172c17 trivial: Document the expected plugin firmware formats 2018-12-03 08:48:13 -06:00
Richard Hughes
75b965d01d Shut down the daemon after 2h of inactivity
Plugins are allowed to 'opt-out' of this behaviour using _RULE_INHIBITS_IDLE.
This should be used where waking up the hardware to coldplug is expensive,
either from a power consumption point of view, or if other artifacts are going
to be seem -- for instance if the screen flickers when probing display devices.

This functionality is also inhibited when the actual upgrade is happening,
for obvious reasons.

Admins can turn off this auto-sleep behaviour by editing the daemon.conf file.

Fixes https://github.com/hughsie/fwupd/issues/417
2018-11-21 18:54:44 +00:00
Richard Hughes
ba2f0ae1d4 trivial: Document the GUID generation scheme
Fixes https://github.com/hughsie/fwupd/issues/837
2018-11-08 20:39:46 +00:00
Mario Limonciello
5e36c9e792 synapticsmst: Adjust EVB board handling
1. Since board ID in synapticsmst.quirk is different based upon how
the board ID is read, don't whitelist it in `write_firmware`

2. Allow using `--force` with `fwupdmgr` or `fwupdtool` to override
board ID check.

3. Allow using custom flag `ignore-board-id` to ignore board IDs.
This will be the default for EVB boards and can be used in the event
of a factory mistake as well.

4. Move the EVB board IDs into their own synapticsmst_evb.quirk.
This file will not be installed by default (So EVB boards are only
functional when manually installed).
2018-11-05 09:31:55 -06:00
RyanChang
da4049499e synapticsmst: Remove the content checking of firmware
Keep the length checking and remove content checking because don't want to reveal detail format.
2018-11-05 09:31:55 -06:00
RyanChang
732d641bdc synapticsmst: Access Board ID through memory instead
In firmware images HDCP 2.2 will be enabled by default,so access to flash region will fail.
2018-11-05 09:31:55 -06:00
Mario Limonciello
53b49458b6 dell-dock: Prefer to flash VMM5331 via I2C instead of DP aux
Although this is (currently) slower to flash with, bad behavior
and corner case scenarios such as these don't occur:

* Flickering during enumeration
* Monitor plugged in during enumeration but not during flash
* Heavy DP traffic slowing down update significantly
* Sandboxes without access to `/dev/drm_dp_auxY` unable to flash
* Exercising existing graphics driver bugs leading to system freezes.

Additionally this removes a lot of code in dell_dock that was put
in place specifically to be able to support waking up the MST hub
to try to use DP aux for flashing.

Now DP aux will only be used to flash when fwupd is compiled
without `dell_dock`.
2018-11-01 06:29:10 -05:00
Mario Limonciello
558055c9b7 Add a plugin for an upcoming Dell USB-C dock
This plugin requires infrastructure introduced in fwupd 1.1.3
and can not be backported to earlier versions of fwupd.

It works together with the Synaptics and Thunderbolt plugins to
coordinate the proper flashing procedure for devices in this dock.
2018-10-12 07:58:29 +01:00
Mario Limonciello
bae478f555 trivial: synapticsmst: clarify some error flows
As seen in the previous commit if ESM update failed some error prefixes
are not useful, clarify them.
2018-09-28 08:39:44 -05:00
Mario Limonciello
7cb2c1092c synapticsmst: Adjust panamera ESM update routine for some reported issues
Reported failure:
"failed to flash firmware: ESM update failed: ESM update failed:
 failed to write data: failed to write"

1) Add a sleep after erasing (matches other SPI write calls)
2) Erase & sleep between retries
2018-09-28 08:39:44 -05:00
Mario Limonciello
680d9dc228 trivial: synapticsmst: downgrade remote control retry statement to debug
This happens often enough and it does recover each time.
2018-09-28 08:39:44 -05:00
Richard Hughes
c125ec02ed Clarify what the platform ID actually is by renaming it
It wasn't hugely clear what the platform ID was actually meant to represent. In
some cases it was being used like a physical ID, in others it was a logical ID,
and in others it was both. In some cases it was even used as a sysfs path.

Clear up all the confusion by splitting the platform ID into two parts, an
optional *physical* ID to represent the electrical connection, and an optional
*logical* ID to disambiguate composite devices with the same physical ID.

Also create an explicit sysfs_path getter for FuUdevDevice to make this clear.

This allows WAIT_FOR_REPLUG to always work, rather than depending on the order
that the GUIDs were added, and that the kernel would always return the same
sysfs path (which it doesn't have to do, especially for hidraw devices).
2018-09-06 16:22:46 +01:00
Mario Limonciello
b900fe6b4e trivial: move all Dell dock related quirks into dell.quirk
These quirks aren't really needed if compiled without the Dell plugin
since they just set the parentage.
2018-09-05 08:10:52 -05:00
Richard Hughes
4adf3bb52c trivial: Remove duplicate header includes 2018-09-04 08:22:39 -05:00
Mario Limonciello
6cfd3f21f5 synapticsmst: Use fu_plugin_device_removed signal
If another plugin causes a Synaptics MST device to be removed, it
also needs to be removed from the cache to prevent problems when
the device is re-probed.
2018-09-04 10:00:52 +01:00
Mario Limonciello
0235b70463 trivial: synapticsmst: Correct the GUID for the WD15
The WD15 has a slightly different chip than the TB16/TB18 and this was
not transcribed properly.
2018-09-04 10:00:52 +01:00
Mario Limonciello
9ef5f741bc plugins: Set platform IDs for non-USB/non-UDEV plugins 2018-09-02 14:45:39 -05:00
Mario Limonciello
812ac02bac synapticsmst: Allow using a custom flag 'skip-restart'
This flag is intended for devices that the restart procedure will
be performed as part of a transactional update by an external
controller.

None of the currently supported devices need this flag.
2018-08-29 07:55:27 +01:00
Mario Limonciello
102074eeea synapticsmst: Move GUID generation into quirks
This should allow trivially adding support for new
Tesla/Leaf/Panamera devices by a quirk.
2018-08-28 15:30:21 -05:00
Mario Limonciello
7555738827 synapticsmst: Set parentage for Dell WD15/TB16/TB18 docks through quirks 2018-08-28 18:30:00 +01:00
Mario Limonciello
f19222414c trivial: synapticsmst: Let device finalize close remaining fd 2018-08-13 11:11:27 -05:00
Mario Limonciello
9818692336 synapticsmst: Use FuDeviceLocker for all instances of remote control
This will make sure that remote control requests are always paired with
a close.
2018-08-13 11:11:27 -05:00
Mario Limonciello
8bba1ed2ef synapticsmst: Plumb error handling everywhere return codes are used
This makes the code more consistent, easier to debug and to reuse
in other plugins.
2018-08-13 11:11:27 -05:00
Mario Limonciello
32ac99c6dd trivial: synapticsmst: remove unnecessary includes 2018-08-13 11:11:27 -05:00
Mario Limonciello
d4e443e8e2 synapticsmst: Fix alignment issues (Closes: #207) 2018-08-11 08:34:38 +01:00
Mario Limonciello
7343ed4f33 synapticsmst: Run the plugin on non-dell systems
It generally won't be interesting on most systems, but if a supported
Dell USB device is connected to a non-dell system it can be updated
then.
2018-08-09 15:04:25 -05:00
Richard Hughes
14a8e40966 synapticsmst: Fix const warnings on Centos7 2018-08-09 16:59:04 +01:00
Richard Hughes
55c424a7be synapticsmst: Add some missing failure handling code
If synapticsmst_common_rc_set_command() fails, return an error.

Found using Coverity.
2018-08-09 15:27:36 +01:00
Richard Hughes
c5a392ac8f synapticsmst: Remove some dead code
0x40000/64 has no remainder, and both numbers are defined constants.

Found using Coverity.
2018-08-09 15:27:36 +01:00
Richard Hughes
02c90d8a03 Remove the unused Emacs indenting headers from all source files
Fixes https://github.com/hughsie/fwupd/issues/636
2018-08-09 12:48:04 +01:00
Mario Limonciello
faa9aaae0b trivial: synapticsmst: whitespace fixes 2018-08-06 00:34:42 -05:00
Mario Limonciello
dc5566a8db synapticsmst: Add support Synaptics Panamera chip
Panamera is a newer MST chip with a different flash layout and
multiple MCU running and accessing SPI/EEPROM simultaneously.

The firmware update process has to be run separately for each
SPI/EEPROM region.

Signed-off-by: Ryan Chang <ryan.chang@synaptics.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2018-08-06 00:34:42 -05:00
Mario Limonciello
9a77f1c7ad synapticsmst: Rework Tesla/Leaf write process
- Split up `synapticsmst_device_write_firmware` to smaller more manageable
  chunks
- Use `FuDeviceLocker` to ensure that device is in a known state after
  update is complete (both in success or failure scenarios)
- Retry the write process up to 10 times in case of DPCD update failures
- Wait for flash clear to settle before writing to EEPROM/SPI
2018-08-06 00:34:42 -05:00
Mario Limonciello
0677d92b03 synapticsmst: If failing to enable remote control, disable and retry
Any previously failed runs or outside tools may adjust the remote
control register leaving the MST controller in a poor state.

If remote control enablement fails, try to disable and then re-enable
before aborting.
2018-08-06 00:34:42 -05:00
Mario Limonciello
2b4013562d synapticsmst: Add a reboot at end of flash cycle
This makes sure the MST hub jumps to the new active firmware after
completion.
2018-08-06 00:34:42 -05:00
Mario Limonciello
801cca6dc3 synapticsmst: remove support for setting dock type from another plugin
As seen by recent testing this is not working every time.
Since e6cda81f we're now building GUIDs that represent all the possibilities
for shared parts so it's not important to set dock type.
2018-08-06 00:34:42 -05:00
Mario Limonciello
d173901e79 synapticsmst: set parent devices for known docks without metadata 2018-08-06 00:34:42 -05:00
Mario Limonciello
e6cda81f8d synapticsmst: Drop the dependency on Dell plugin to populate devices
If the dock information is available then show that in the device name
and restrict the GUIDs created.

If it's not available, then just create GUIDs for all known docks
2018-07-19 11:09:05 -05:00
Richard Hughes
d3f2878f19 synapticsmst: Fix several small memory leaks during enumeration 2018-06-28 18:16:24 +01:00
Mario Limonciello
dfb87c51c9 trivial: synapticsmst: drop efivar dep 2018-06-04 20:00:07 -05:00
Richard Hughes
4be17d1364 Add support for relocating various runtime paths
This allows a snap package to be easily built.

With much help from Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-31 16:25:22 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
cf22df177f trivial: Remove the synapticsmst noinst tool 2018-05-18 10:24:38 +01:00
Mario Limonciello
1a60231658 trivial: synapticsmst: Recognize boardid 0x103
This board_id will be used in a new device in the future.
The enum and description will be updated later when more details
are ready.
2018-05-03 14:07:42 -05:00
Mario Limonciello
e9046e7207 synapticsmst: Set TB16/WD15 appropriately in topology 2018-05-03 08:07:04 +01:00
Mario Limonciello
a98df55d82 Disable -Wunused-function on clang builds (Closes #467)
GLib creates two static inline functions for paramaters that may
not be used that set off warnings in clang but not gcc.

Ignore these on clang builds everywhere that
G_DEFINE_AUTOPTR_CLEANUP_FUNC is used.
2018-04-17 10:10:43 +01:00