I have a USB-3.1 dock; sometimes I see a kernel panic when I unplug it. The panic hangs the entire system (and strangely does not appear to be reproducible at a text console). The start of the panic, as captured over a serial console, is as follows: [ 44.010232] BUG: unable to handle kernel NULL pointer dereference at (null) [ 44.010274] IP: [<ffffffff81630316>] usb_hc_died+0x16/0xc0 [ 44.010292] PGD 0 [ 44.010300] Oops: 0000 [#1] SMP [ 44.010310] Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 It appears that the first unplug is successful; the second one normally triggers a crash. The situation is complicated by the fact that this USB bridge is behind a chain of PCI bridges, which appear to power down when nothing is plugged into the USB-C port.
Created attachment 231301 [details] stack trace I captured a dump via kdump; this is the result of 'bt' from 'crash'.
Created attachment 231311 [details] lspci -vv without dock present
Created attachment 231321 [details] lspci -vv after hotplug
On Mon, Aug 29, 2016 at 07:57:24PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=155541 > > Bug ID: 155541 > Summary: panic: BUG at usb_hc_died+0x16 when unplugging usb-c > dock All USB bugs should be sent to the linux-usb@vger.kernel.org mailing list, and not entered into bugzilla. Please bring this issue up there, if it is still a problem in the latest kernel release.
For the record, this got fixed by commit bcf42aa60c28 in kernel 4.9.