Hello,
Unfortunately, it looks like my laptop is one of the many devices
(across multiple brands) affected by a NVM firmware issue which causes
the Thunderbolt driver to permanently stay in safe mode. Unfortunately,
this also means that fwupd can neither detect the device, nor update
it.
The actual fix is to flash it using a programmer - unfortunately, I
know nothing about firmware flashing and I do not want to risk breaking
my only device.
Fortunately, there is a work-around it. Unbinding and binding the
specific driver should resolve the almost-20-seconds-delay. Below is a
script (in Guile Scheme) that does the same.
#!/usr/bin/env -S guile --no-auto-compile -s
!#
(use-modules (ice-9 match))
(define (write-to-sysfs path value)
(catch 'system-error
(lambda ()
(call-with-output-file
path
(lambda (port)
(display value port)
(newline port))))
(lambda _ #t)))
(let
((driver-path "/sys/bus/pci/drivers/thunderbolt/")
(pci-addr "0000:06:00.0"))
(match (cdr (command-line))
(("pre" . _)
(write-to-sysfs
(string-append driver-path "unbind")
pci-addr))
(("post" _)
(write-to-sysfs
(string-append driver-path "bind")
pci-addr))
(_ #t)))
This file can then be introduced as a local-file object.
(define thunderbolt-rule
(local-file
(string-append
(dirname (current-filename))
"/../misc/thunderbolt-rule.scm")))
And finally, add the system-sleep-hook-files configuration to elogind-
services-type.
(service elogind-service-type
(elogind-configuration
(system-sleep-hook-files
(list thunderbolt-rule))))
Regards,
Ashvith