Commit Graph

142 Commits

Author SHA1 Message Date
Richard Hughes
d0e952bd93 trivial: Remove unused variable 2019-08-13 17:39:19 +01:00
Mario Limonciello
6f352cb7e5 synapticsmst: fix GUID generation (Closes: #1207)
When converting to instances we forgot to add the GUIDs to the device
as well.
2019-05-23 09:52:18 -05:00
Richard Hughes
5079f26f0e Never guess the version format from the version string
This leads to madness, as some formats are supersets of the detected types,
e.g. 'intel-me' is detected as 'quad' and 'bcd' is detected as 'pair'.

Where the version format is defined in a specification or hardcoded in the
source use a hardcoded enum value, otherwise use a quirk override.

Additionally, warn if the version does not match the defined version format
2019-04-30 09:25:41 +01:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
Mario Limonciello
57816a7907 synapticsmst: blacklist plugin when using amdgpu (Fixes: #1121)
An undiagnosed kernel issue is leading to a kernel crash involving
DP aux reads with amdgpu involved.

It's been reproduced in kernel 4.15 with a DKMS version of amdgpu as
well as kernel 4.19 with amdgpu within the kernel.

```
[16862.519947] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us * 160 tries - submit_channel_request line:246
[16862.519983] WARNING: CPU: 5 PID: 3015 at drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:254 generic_reg_wait+0xe2/0x160 [amdgpu]
[16862.519984] Modules linked in: rfcomm snd_hda_codec_realtek snd_hda_codec_generic cmac bnep arc4 nls_iso8859_1 amdkfd amd_iommu_v2 amdgpu i915 dell_rbtn iwlmvm snd_soc_skl wmi_bmof dell_wmi intel_rapl x86_pkg_temp_thermal dell_laptop intel_powerclamp snd_soc_skl_ipc dell_smbios coretemp snd_soc_sst_ipc dell_wmi_descriptor kvm_intel dcdbas snd_soc_sst_dsp snd_hda_ext_core kvmgt dell_smm_hwmon snd_soc_acpi_intel_match mac80211 vfio_mdev crct10dif_pclmul mdev vfio_iommu_type1 crc32_pclmul snd_soc_acpi vfio ghash_clmulni_intel snd_soc_core kvm pcbc snd_compress ac97_bus aesni_intel snd_hda_codec_hdmi snd_pcm_dmaengine chash gpu_sched aes_x86_64 snd_hda_intel crypto_simd snd_hda_codec cryptd ttm glue_helper pcmcia irqbypass snd_hda_core drm_kms_helper intel_cstate intel_rapl_perf snd_hwdep uvcvideo snd_pcm
[16862.520008]  drm cdc_ether iwlwifi cdc_mbim videobuf2_vmalloc snd_seq_midi videobuf2_memops cdc_ncm snd_seq_midi_event videobuf2_v4l2 snd_rawmidi videobuf2_common videodev input_leds serio_raw btusb qmi_wwan btrtl r8152 snd_seq btbcm media cdc_wdm btintel usbnet option mii usb_wwan bluetooth usbserial cdc_acm hid_multitouch joydev snd_seq_device snd_timer cfg80211 snd yenta_socket pcmcia_rsrc idma64 pcmcia_core soundcore virt_dma i2c_algo_bit fb_sys_fops syscopyarea mei_me sysfillrect ecdh_generic sysimgblt mei ucsi_acpi intel_lpss_pci processor_thermal_device typec_ucsi intel_lpss intel_soc_dts_iosf intel_pch_thermal typec wmi soc_button_array mac_hid intel_hid int3400_thermal video int3403_thermal dell_smo8800 sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad sch_fq_codel parport_pc
[16862.520033]  ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid uas usb_storage e1000e ahci libahci i2c_hid hid
[16862.520040] CPU: 5 PID: 3015 Comm: fwupd Not tainted 4.19.0 #1
[16862.520040] Hardware name: Dell Inc. Latitude 7424 Rugged Extreme/, BIOS 1.0.0 09/12/2018
[16862.520062] RIP: 0010:generic_reg_wait+0xe2/0x160 [amdgpu]
[16862.520063] Code: ab 44 8b 45 20 48 8b 4d 18 44 89 e6 8b 55 10 48 c7 c7 f0 bf 12 c1 44 89 4d d4 e8 79 1d 65 ff 41 83 7d 18 01 44 8b 4d d4 74 02 <0f> 0b 48 83 c4 18 44 89 c8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 41 0f
[16862.520064] RSP: 0018:ffffbdff831ffbe0 EFLAGS: 00010297
[16862.520065] RAX: 0000000000000000 RBX: 00000000000000a1 RCX: 0000000000000000
[16862.520065] RDX: 0000000000000000 RSI: ffff965fee356428 RDI: ffff965fee356428
[16862.520066] RBP: ffffbdff831ffc20 R08: 00000000000004d5 R09: 00000000ffffffff
[16862.520066] R10: fffff464915dbd00 R11: ffffffff981923ed R12: 000000000000000a
[16862.520067] R13: ffff965fdea5d480 R14: 0000000000000001 R15: 0000000000000000
[16862.520068] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520068] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520069] CR2: 00007f1732987150 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520070] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520070] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[16862.520070] Call Trace:
[16862.520097]  submit_channel_request+0x394/0x480 [amdgpu]
[16862.520118]  dc_link_aux_transfer+0xca/0x160 [amdgpu]
[16862.520142]  dm_dp_aux_transfer+0x59/0x120 [amdgpu]
[16862.520146]  drm_dp_dpcd_access+0x75/0x110 [drm_kms_helper]
[16862.520148]  drm_dp_dpcd_read+0x33/0xc0 [drm_kms_helper]
[16862.520152]  auxdev_read_iter+0x10f/0x1d0 [drm_kms_helper]
[16862.520154]  __vfs_read+0x106/0x180
[16862.520155]  vfs_read+0x8e/0x130
[16862.520156]  ksys_read+0x55/0xc0
[16862.520157]  __x64_sys_read+0x1a/0x20
[16862.520159]  do_syscall_64+0x5a/0x120
[16862.520161]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[16862.520162] RIP: 0033:0x7f1741b3a384
[16862.520163] Code: 84 00 00 00 00 00 41 54 55 49 89 d4 53 48 89 f5 89 fb 48 83 ec 10 e8 8b fc ff ff 4c 89 e2 41 89 c0 48 89 ee 89 df 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 48 89 44 24 08 e8 c7 fc ff ff 48
[16862.520163] RSP: 002b:00007fffadd980f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[16862.520164] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007f1741b3a384
[16862.520165] RDX: 0000000000000001 RSI: 00007fffadd98154 RDI: 0000000000000013
[16862.520165] RBP: 00007fffadd98154 R08: 0000000000000000 R09: 000055fd7e9c7010
[16862.520166] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[16862.520166] R13: 00007fffadd981c0 R14: 00007fffadd98154 R15: 000055fd7eae35b0
[16862.520167] ---[ end trace 8e8b280a234718a5 ]---
[16862.520176] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[16862.520177] PGD 0 P4D 0
[16862.520179] Oops: 0000 [#1] SMP PTI
[16862.520180] CPU: 5 PID: 3015 Comm: fwupd Tainted: G        W         4.19.0 #1
[16862.520181] Hardware name: Dell Inc. Latitude 7424 Rugged Extreme/, BIOS 1.0.0 09/12/2018
[16862.520205] RIP: 0010:dal_ddc_close+0xd/0x30 [amdgpu]
[16862.520207] Code: f1 00 e8 06 f5 ff ff 48 8b 55 f8 65 48 33 14 25 28 00 00 00 75 02 c9 c3 e8 70 09 65 d5 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb <48> 8b 7f 08 e8 da f5 ff ff 48 8b 3b e8 d2 f5 ff ff 5b 5d c3 66 2e
[16862.520208] RSP: 0018:ffffbdff831ffc58 EFLAGS: 00010246
[16862.520209] RAX: ffffffffc103f410 RBX: 0000000000000000 RCX: 0000000000000000
[16862.520210] RDX: ffffffffc10de660 RSI: 0000000000005c58 RDI: 0000000000000000
[16862.520211] RBP: ffffbdff831ffc60 R08: 0000000000000001 R09: 00000000ffffffff
[16862.520211] R10: fffff464915dbd00 R11: 0000000000000001 R12: 0000000000000000
[16862.520212] R13: ffffbdff831ffdd0 R14: ffffbdff831ffd3d R15: 0000000000000000
[16862.520213] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520215] CR2: 0000000000000008 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520216] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520217] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[16862.520218] Call Trace:
[16862.520242]  release_engine+0x16/0x70 [amdgpu]
[16862.520263]  dc_link_aux_transfer+0xfd/0x160 [amdgpu]
[16862.520287]  dm_dp_aux_transfer+0x59/0x120 [amdgpu]
[16862.520290]  drm_dp_dpcd_access+0x75/0x110 [drm_kms_helper]
[16862.520293]  drm_dp_dpcd_read+0x33/0xc0 [drm_kms_helper]
[16862.520296]  auxdev_read_iter+0x10f/0x1d0 [drm_kms_helper]
[16862.520298]  __vfs_read+0x106/0x180
[16862.520300]  vfs_read+0x8e/0x130
[16862.520301]  ksys_read+0x55/0xc0
[16862.520302]  __x64_sys_read+0x1a/0x20
[16862.520304]  do_syscall_64+0x5a/0x120
[16862.520306]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[16862.520307] RIP: 0033:0x7f1741b3a384
[16862.520308] Code: 84 00 00 00 00 00 41 54 55 49 89 d4 53 48 89 f5 89 fb 48 83 ec 10 e8 8b fc ff ff 4c 89 e2 41 89 c0 48 89 ee 89 df 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 48 89 44 24 08 e8 c7 fc ff ff 48
[16862.520309] RSP: 002b:00007fffadd980f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[16862.520310] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007f1741b3a384
[16862.520311] RDX: 0000000000000001 RSI: 00007fffadd98154 RDI: 0000000000000013
[16862.520312] RBP: 00007fffadd98154 R08: 0000000000000000 R09: 000055fd7e9c7010
[16862.520312] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[16862.520313] R13: 00007fffadd981c0 R14: 00007fffadd98154 R15: 000055fd7eae35b0
[16862.520314] Modules linked in: rfcomm snd_hda_codec_realtek snd_hda_codec_generic cmac bnep arc4 nls_iso8859_1 amdkfd amd_iommu_v2 amdgpu i915 dell_rbtn iwlmvm snd_soc_skl wmi_bmof dell_wmi intel_rapl x86_pkg_temp_thermal dell_laptop intel_powerclamp snd_soc_skl_ipc dell_smbios coretemp snd_soc_sst_ipc dell_wmi_descriptor kvm_intel dcdbas snd_soc_sst_dsp snd_hda_ext_core kvmgt dell_smm_hwmon snd_soc_acpi_intel_match mac80211 vfio_mdev crct10dif_pclmul mdev vfio_iommu_type1 crc32_pclmul snd_soc_acpi vfio ghash_clmulni_intel snd_soc_core kvm pcbc snd_compress ac97_bus aesni_intel snd_hda_codec_hdmi snd_pcm_dmaengine chash gpu_sched aes_x86_64 snd_hda_intel crypto_simd snd_hda_codec cryptd ttm glue_helper pcmcia irqbypass snd_hda_core drm_kms_helper intel_cstate intel_rapl_perf snd_hwdep uvcvideo snd_pcm
[16862.520332]  drm cdc_ether iwlwifi cdc_mbim videobuf2_vmalloc snd_seq_midi videobuf2_memops cdc_ncm snd_seq_midi_event videobuf2_v4l2 snd_rawmidi videobuf2_common videodev input_leds serio_raw btusb qmi_wwan btrtl r8152 snd_seq btbcm media cdc_wdm btintel usbnet option mii usb_wwan bluetooth usbserial cdc_acm hid_multitouch joydev snd_seq_device snd_timer cfg80211 snd yenta_socket pcmcia_rsrc idma64 pcmcia_core soundcore virt_dma i2c_algo_bit fb_sys_fops syscopyarea mei_me sysfillrect ecdh_generic sysimgblt mei ucsi_acpi intel_lpss_pci processor_thermal_device typec_ucsi intel_lpss intel_soc_dts_iosf intel_pch_thermal typec wmi soc_button_array mac_hid intel_hid int3400_thermal video int3403_thermal dell_smo8800 sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad sch_fq_codel parport_pc
[16862.520351]  ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid uas usb_storage e1000e ahci libahci i2c_hid hid
[16862.520356] CR2: 0000000000000008
[16862.520357] ---[ end trace 8e8b280a234718a6 ]---
[16862.520380] RIP: 0010:dal_ddc_close+0xd/0x30 [amdgpu]
[16862.520382] Code: f1 00 e8 06 f5 ff ff 48 8b 55 f8 65 48 33 14 25 28 00 00 00 75 02 c9 c3 e8 70 09 65 d5 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb <48> 8b 7f 08 e8 da f5 ff ff 48 8b 3b e8 d2 f5 ff ff 5b 5d c3 66 2e
[16862.520382] RSP: 0018:ffffbdff831ffc58 EFLAGS: 00010246
[16862.520384] RAX: ffffffffc103f410 RBX: 0000000000000000 RCX: 0000000000000000
[16862.520384] RDX: ffffffffc10de660 RSI: 0000000000005c58 RDI: 0000000000000000
[16862.520385] RBP: ffffbdff831ffc60 R08: 0000000000000001 R09: 00000000ffffffff
[16862.520386] R10: fffff464915dbd00 R11: 0000000000000001 R12: 0000000000000000
[16862.520387] R13: ffffbdff831ffdd0 R14: ffffbdff831ffd3d R15: 0000000000000000
[16862.520388] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520389] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520390] CR2: 0000000000000008 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520391] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520392] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
```
2019-03-29 08:13:16 -05:00
Mario Limonciello
640faed956 trivial: synapticsmst: remove unneeded fixme
The opening flow for enumerate is as expected right now.
2019-03-05 09:39:29 +00:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
Richard Hughes
65c81921b6 Add fu_device_add_instance_id() and prefer explicit conversion 2019-02-04 15:19:57 +00:00
Richard Hughes
96e6783982 trivial: Fix potential compile failures for high -j values 2019-02-01 16:52:16 +00:00
Richard Hughes
4fef28d0ac trivial: Add the missing protocol IDs to the plugin READMEs 2019-01-29 22:28:09 +00:00
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