Kernel bug when unplugging Thunderbolt 3 cable, leaves xHCI host controller dead
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Medium
|
Unassigned |
Bug Description
===SRU Justification===
[Impact]
When unplugging the Thunderbolt 3 cable from the TBT controller, kernel
oops.
[Test]
The user confirms this patch works.
[Fix]
tty_unregister_
hotplug cases,it will cause the kernel oops. This patch checked
dbc_tty_driver to make sure it is unregistered only 1 time.
[Regression Potential]
Low. The change is to guard against null pointer, so it's the correct
behavior.
===Original Bugreport===
When unplugging the Thunderbolt 3 cable that was connected to a Lenovo Thunderbolt 3 Dock:
[78402.194718] xhci_hcd 0000:0f:00.0: remove, state 4
[78402.194726] usb usb8: USB disconnect, device number 1
[78402.194727] usb 8-2: USB disconnect, device number 2
[78402.195072] xhci_hcd 0000:0f:00.0: USB bus 8 deregistered
[78402.195077] xhci_hcd 0000:0f:00.0: xHCI host controller not responding, assume dead
[78402.195086] xhci_hcd 0000:0f:00.0: remove, state 1
[78402.195091] usb usb7: USB disconnect, device number 1
[78402.195092] usb 7-2: USB disconnect, device number 2
[78402.195094] usb 7-2.1: USB disconnect, device number 3
[78402.242648] usb 7-2.2: USB disconnect, device number 4
[78402.246827] xhci_hcd 0000:0f:00.0: Host halt failed, -19
[78402.246829] xhci_hcd 0000:0f:00.0: Host not accessible, reset failed.
[78402.246917] xhci_hcd 0000:0f:00.0: USB bus 7 deregistered
[78402.247998] pcieport 0000:0a:03.0: Refused to change power state, currently in D3
[78402.255841] xhci_hcd 0000:0d:00.0: remove, state 1
[78402.255847] usb usb6: USB disconnect, device number 1
[78402.255849] usb 6-1: USB disconnect, device number 2
[78402.255900] xhci_hcd 0000:0d:00.0: xHCI host controller not responding, assume dead
[78402.255920] r8152 5-3.4.3:1.0 enx00e04c6814c6: Stop submitting intr, status -108
[78402.302674] xhci_hcd 0000:0d:00.0: USB bus 6 deregistered
[78402.302679] xhci_hcd 0000:0d:00.0: remove, state 1
[78402.302685] usb usb5: USB disconnect, device number 1
[78402.302687] usb 5-3: USB disconnect, device number 2
[78402.302688] usb 5-3.4: USB disconnect, device number 3
[78402.302689] usb 5-3.4.1: USB disconnect, device number 4
[78402.430677] usb 5-3.4.2: USB disconnect, device number 5
[78402.470512] usb 5-3.4.3: USB disconnect, device number 6
[78402.506481] usb 5-3.4.4: USB disconnect, device number 7
[78402.507533] BUG: unable to handle kernel NULL pointer dereference at 0000000000000034
[78402.507540] IP: tty_unregister_
[78402.507542] PGD 0 P4D 0
[78402.507544] Oops: 0000 [#1] SMP PTI
[78402.507546] Modules linked in: xt_nat xt_tcpudp veth rfcomm ipt_MASQUERADE nf_nat_
[78402.507582] snd_hda_intel snd_hda_codec snd_hda_core iwlmvm input_leds mac80211 snd_usb_audio snd_usbmidi_lib cdc_ether snd_hwdep r8152 iwlwifi snd_pcm uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core videodev thinkpad_acpi media cfg80211 nvram cdc_mbim qcserial cdc_wdm cdc_ncm snd_seq_midi usb_wwan snd_seq_midi_event usbnet rtsx_pci_ms btusb snd_rawmidi btrtl memstick btbcm usbserial mii btintel snd_seq bluetooth snd_seq_device snd_timer mei_me ucsi_acpi mei shpchp intel_pch_thermal typec_ucsi ecdh_generic snd typec soundcore acpi_pad mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 zfs(PO) zunicode(PO) zavl(PO) icp(PO) zcommon(PO) znvpair(PO) spl(O) hid_generic usbhid rtsx_pci_sdmmc i915 psmouse i2c_algo_bit e1000e drm_kms_helper syscopyarea
[78402.507629] ptp sysfillrect sysimgblt pps_core nvme rtsx_pci fb_sys_fops thunderbolt nvme_core drm wmi i2c_hid video hid
[78402.507639] CPU: 0 PID: 15421 Comm: kworker/u8:3 Tainted: P O 4.15.0-20-generic #21-Ubuntu
[78402.507640] Hardware name: LENOVO 20HRCTO1WW/
[78402.507644] Workqueue: kacpi_hotplug acpi_hotplug_
[78402.507648] RIP: 0010:tty_
[78402.507649] RSP: 0018:ffffa16e94
[78402.507651] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[78402.507652] RDX: ffff8c4e4e972f00 RSI: fffff687520f9380 RDI: 0000000000000000
[78402.507654] RBP: ffffa16e94de3af8 R08: ffff8c4e43e4e110 R09: 00000001801e0013
[78402.507655] R10: fffff687512bfa00 R11: 0000000000000000 R12: ffff8c4e43e0e230
[78402.507656] R13: ffff8c4e43e0e27c R14: ffff8c4e43e0e390 R15: 0000000000000060
[78402.507658] FS: 000000000000000
[78402.507659] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[78402.507661] CR2: 0000000000000034 CR3: 00000003ef40a001 CR4: 00000000003606f0
[78402.507662] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[78402.507664] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[78402.507665] Call Trace:
[78402.507671] xhci_dbc_
[78402.507673] xhci_dbc_
[78402.507676] xhci_stop+
[78402.507679] usb_remove_
[78402.507681] usb_hcd_
[78402.507683] xhci_pci_
[78402.507686] pci_device_
[78402.507694] device_
[78402.507696] device_
[78402.507699] pci_stop_
[78402.507701] pci_stop_
[78402.507703] pci_stop_
[78402.507705] pci_stop_
[78402.507708] trim_stale_
[78402.507711] trim_stale_
[78402.507713] trim_stale_
[78402.507715] ? get_slot_
[78402.507718] acpiphp_
[78402.507720] acpiphp_
[78402.507723] ? free_bridge+
[78402.507725] acpi_device_
[78402.507727] acpi_hotplug_
[78402.507730] process_
[78402.507732] worker_
[78402.507735] kthread+0x121/0x140
[78402.507737] ? process_
[78402.507739] ? kthread_
[78402.507742] ? do_syscall_
[78402.507744] ? SyS_exit_
[78402.507746] ret_from_
[78402.507748] Code: c2 bf 2c 94 b6 48 c7 c7 90 0d e4 b6 e8 ed 92 ee ff 48 89 df e8 85 c7 c6 ff 5b 5d c3 66 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb <8b> 77 34 8b 7f 2c c1 e7 14 0b 7b 30 e8 22 15 ca ff 48 c7 c7 e0
[78402.507776] RIP: tty_unregister_
[78402.507777] CR2: 0000000000000034
[78402.507779] ---[ end trace 5ed527061c666404 ]---
[78402.808128] thinkpad_acpi: EC reports that Thermal Table has changed
Some time later (cable *not* plugged back in yet):
[79559.939390] xhci_hcd 0000:0b:00.0: xHCI host controller not responding, assume dead
[79559.939423] xhci_hcd 0000:0b:00.0: HC died; cleaning up
[79559.939448] xhci_hcd 0000:0b:00.0: Timeout while waiting for configure endpoint command
[79559.939494] usb 3-1: Not enough bandwidth for altsetting 1
[79559.939504] usb 3-1: 2:1: usb_set_interface failed (-62)
[79559.940534] usb 3-1: Not enough bandwidth for altsetting 1
[79559.940546] usb 3-1: 2:1: usb_set_interface failed (-19)
[79559.940777] usb 3-1: Not enough bandwidth for altsetting 1
[79559.940787] usb 3-1: 2:1: usb_set_interface failed (-19)
[79559.941181] usb 3-1: Not enough bandwidth for altsetting 1
[79559.941188] usb 3-1: 2:1: usb_set_interface failed (-19)
[79559.941510] usb 3-1: Not enough bandwidth for altsetting 1
[79559.941517] usb 3-1: 2:1: usb_set_interface failed (-19)
[79559.941863] usb 3-1: USB disconnect, device number 2
[79560.000039] usb 3-4: USB disconnect, device number 3
When I plug the Thunderbolt 3 cable back in, the monitor ports of Thunderbolt 3 Dock are working, but USB is not.
Hardware is a Lenovo ThinkPad X1 from 2017. This started happening after updating to Ubuntu 18.04. It did not happen on Ubuntu 17.10.
---
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
/dev/snd/
CurrentDesktop: MATE
DistroRelease: Ubuntu 18.04
InstallationDate: Installed on 2017-10-04 (210 days ago)
InstallationMedia: Ubuntu-MATE 17.04 "Zesty Zapus" - Release amd64 (20170412)
MachineType: LENOVO 20HRCTO1WW
NonfreeKernelMo
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.173
Tags: bionic
Uname: Linux 4.15.0-20-generic x86_64
UpgradeStatus: Upgraded to bionic on 2018-05-02 (1 days ago)
UserGroups: adm cdrom dip docker lpadmin plugdev sambashare sudo
WifiSyslog:
_MarkForUpload: True
dmi.bios.date: 08/30/2017
dmi.bios.vendor: LENOVO
dmi.bios.version: N1MET38W (1.23 )
dmi.board.
dmi.board.name: 20HRCTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697 WIN
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.
dmi.modalias: dmi:bvnLENOVO:
dmi.product.family: ThinkPad X1 Carbon 5th
dmi.product.name: 20HRCTO1WW
dmi.product.
dmi.sys.vendor: LENOVO
description: | updated |
Changed in linux (Ubuntu Bionic): | |
status: | New → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu Cosmic): | |
status: | In Progress → Fix Released |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1768852
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.