Горячее подключение Thunderbolt в Ubuntu Linux

9882
Amias

У меня Dell Precision M3800 и док-станция OWC Thunderbolt 2. Они оба прекрасно работают вместе, и все, кажется, просто работает. Я еще не пробовал FireWire, но Ethernet, USB3, DisplayPort и звук отлично работают из коробки.

Моя система не совсем довольна выдергиванием кабеля Thunderbolt и иногда зависала, когда я снимал док; В других случаях это было хорошо. Я хотел бы найти более безопасный путь и надеялся, что, возможно, появится механизм, с помощью которого я смогу сообщить своей системе, что я собираюсь отключить ее и сначала аккуратно отключить интерфейсы.

Я пробовал искать пакеты и информацию о поддержке Thunderbolt в Linux и нашел только блог Грега КХ, в котором говорится, что он будет работать, но не упомянул никаких инструментов.

Я не нашел пакетов, связанных с Thunderbolt, в репозиториях Ubuntu для моей установки 15.10.

Есть ли инструменты или узлы / proc или / sys, которые я мог бы использовать для этого?

4
FireWire работает отлично и способен запускать звуковые карты с очень низкой задержкой Amias 5 лет назад 0

3 ответа на вопрос

3
Mahmoud Al-Qudsi

Thunderbolt is basically a PCIe bus exposed in the form of a user-friendly, pluggable interface. As you can imagine, hot-plugging a PCIe card in any machine isn't something you can expect to consistently do without problems - unless extreme care has been taken by the manufacturers of the host and removable devices as well as the developers of the mainboard firmware, device firmware, OS kernel, and device drivers.

All that is to say, there's a huge surface area of potential bugs and issues that would prevent this hot-plug from working the way we'd want it to. My recommendation would be to use a debug kernel and try to break into the debugger when it freezes - if you can, then it's probably not a hardware or firmware issue. Instructions on doing that are probably a little beyond the scope of the question or my reply here, but resources are available online that make this a bit easier.

Now if you want a means by which you can manually eject the device prior to yanking it, you can try the following:

After identifying the device address in the system in the output of lspci command, where DDDD:BB:DD.F is the Domain:Bus:Device.Function of the thunderbolt peripheral in question:

05:00.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 06:00.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 06:03.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 06:04.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 06:05.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 06:06.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 07:00.0 System peripheral: Intel Corporation DSL3510 Thunderbolt Port [Cactus Ridge] (rev 03) 08:00.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Controller [Cactus Ridge] 09:00.0 PCI bridge: Intel Corporation DSL3510 Thunderbolt Controller [Cactus Ridge] 

you can execute the following:

echo "1" | sudo tee /sys/bus/pci/devices/DDDD\:BB\:DD.F/remove > /dev/null 

Which should trigger the unload routines in the kernel and the driver (and possibly even in the device firmware), after which you might be able to eject it more-safely. (A grep in a subshell can obviously take the place of the DDDD:BB:DD.F for ease-of-use in the future).

Upon replugging the device, it might become necessary to manually rescan:

echo "1" | sudo tee /sys/bus/pci/rescan > /dev/null 

(Or it might not be needed.)

I haven't used Linux in a while as I'm almost exclusively FreeBSD and OS X these days, so please forgive me if I'm off the mark on anything here.

спасибо за указатели, кажется, моя система показывает свои части молнии по-разному, не уверен, что это молнии? amias @ rome: ~ $ lspci 00: 01.0 Мост PCI: Intel Corporation Xeon E3-1200 v3 / 4-го поколения Core Процессор PCI Express x16 (версия 06) 00: 1c.0 Мост PCI: Intel Corporation 8 Series / C220 Series Chipset 08 : 00.0 Мост PCI: Intel Corporation Device 157e 0a: 00.0 Системная периферия: Intel Corporation Device 157d 0b: 00.0 Мост PCI: Intel Corporation Device 156d 0c: 00.0 Мост PCI: Intel Corporation Device 156d Amias 8 лет назад 0
См. Базу данных DeviceID вендора здесь: https://pci-ids.ucw.cz/read/PC/8086 - у вас есть довольно много подходящих результатов Thunderbolt. Mahmoud Al-Qudsi 8 лет назад 0
С ядром Linux 4.13 ситуация с Thunderbolt (3) несколько улучшилась. Например, док-станция Lenovo Thunderbolt 3 теперь возвращается в оперативный режим после приостановки / возобновления на текущем тестере Debian 10 (тестирование), в отличие от поведения Debian 9 Stretch с ядром 4.9. Unplug / replug все еще есть проблемы AdamKalisz 6 лет назад 1
Во-вторых, основное ядро ​​4.13 обеспечивает действительно сильную поддержку молнии для дисплеев, пока не испытывая большой удачи с другими периферийными устройствами и проводной сетью. Brandon Bertelsen 6 лет назад 0
2
Amias

it seems that if you lspci -vt you get a tree diagram that makes it a lot easier to spot the thunderbolt controller.

heres my output

amias@rome:~$ lspci -vt -[0000:00]-+-00.0 Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller +-01.0-[02-03]----00.0 NVIDIA Corporation GK107GLM [Quadro K1100M] +-02.0 Intel Corporation 4th Gen Core Processor Integrated Graphics Controller +-03.0 Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller +-04.0 Intel Corporation Device 0c03 +-14.0 Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI +-16.0 Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 +-1a.0 Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 +-1b.0 Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller +-1c.0-[04]-- +-1c.2-[06]----00.0 Intel Corporation Wireless 7260 +-1c.3-[07]----00.0 Realtek Semiconductor Co., Ltd. RTS5249 PCI Express Card Reader +-1c.4-[08-40]----00.0-[09-40]--+-00.0-[0a]----00.0 Intel Corporation Device 157d | \-01.0-[0b-40]----00.0-[0c-40]--+-00.0-[0d]----00.0 Fresco Logic FL1100 USB 3.0 Host Controller | +-01.0-[0e]----00.0 Intel Corporation I210 Gigabit Network Connection | +-02.0-[0f]----00.0 Fresco Logic FL1100 USB 3.0 Host Controller | +-03.0-[10]----00.0 LSI Corporation FW643 [TrueFire] PCIe 1394b Controller | +-04.0-[11]-- | \-05.0-[12-40]-- +-1d.0 Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 +-1f.0 Intel Corporation HM87 Express LPC Controller +-1f.2 Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] +-1f.3 Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller \-1f.6 Intel Corporation 8 Series Chipset Family Thermal Management Controller 

this allowed me to find 1c.4 which appears to be my thunderbolt controller.

I then used mahmoud's suggestion to hit the remove node, this did seem to disconnect my thunderbolt dock cleanly, however when i reinserted it locked hard. This would suggest that other drivers are not so happy with the hotplugging or i would need to reset the thunderbolt device.

Either way, it was worse than just pulling it out.

I guess for now i just need to ensure everything is saved before undocking. I would welcome further suggestions if there are any.

1
tolvanea

Вы можете попробовать приостановить работу вашей системы в ОЗУ, а затем вынуть кабель. Это единственный способ отключить док-станцию ​​Lenovo Thunderbolt 3 без перезагрузки.

Похожие вопросы