Bug 155541

Summary: panic: BUG at usb_hc_died+0x16 when unplugging usb-c dock
Product: Drivers Reporter: Richard van der Hoff (bugzilla)
Component: USBAssignee: Greg Kroah-Hartman (greg)
Status: RESOLVED CODE_FIX    
Severity: normal CC: andreas.noever
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.7 Subsystem:
Regression: No Bisected commit-id:
Attachments: stack trace
lspci -vv without dock present
lspci -vv after hotplug

Description Richard van der Hoff 2016-08-29 19:57:24 UTC
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.
Comment 1 Richard van der Hoff 2016-08-29 20:00:48 UTC
Created attachment 231301 [details]
stack trace

I captured a dump via kdump; this is the result of 'bt' from 'crash'.
Comment 2 Richard van der Hoff 2016-08-29 20:02:51 UTC
Created attachment 231311 [details]
lspci -vv without dock present
Comment 3 Richard van der Hoff 2016-08-29 20:03:18 UTC
Created attachment 231321 [details]
lspci -vv after hotplug
Comment 4 Greg Kroah-Hartman 2016-08-30 05:28:37 UTC
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.
Comment 5 Richard van der Hoff 2018-12-21 09:04:55 UTC
For the record, this got fixed by commit bcf42aa60c28 in kernel 4.9.