On 23.08.2016 02:21, Jose Marino wrote:
I'm using my phone (Nexus 5X running Android) to tether a USB connection to my laptop (XPS 15 9550). I plug the phone through the USB-C connection and in the phone I select USB tethering. Initially things look normal: a usb0 network interface appears in the laptop and it tries to get an IP with dhcp. However, I observe two different behaviors depending on whether it's a fresh boot, or I have suspend/resumed the laptop. In a fresh boot everything works fine, I get an IP and the connection works as expected. If I unplug the phone, everything also works as expected. However, after a suspend/resume cycle, I plug the phone in but the laptop never connects to it. The usb0 interface still appears, but the dhcp daemon is unable to get any response and finally times out. The fun part happens when I unplug the phone. I consistently get a kernel panic. I managed to get some logs of the oops+panic from pstore. Find them attached. In this particular situation this is what I did: - Boot laptop (archlinux with kernel 4.7.2) - Suspend/resume - Plug Nexus 5X - After a few seconds unplug Nexus 5X I filed a bug report about this: https://bugzilla.kernel.org/show_bug.cgi?id=153551
The Dell XPS 9550 has an additional xhci controller for handling the type-C port. This controller is hotplug removed from the PCI bus when the last USB type-c device is disconnected. xhci driver, and usb core it seems is not really designed with this in mind. xhci driver will suddenly start reading ffffffff from PCI. I've been looking at issues related to this. Currently there is at least one similar case with mass storage where we see the device release function being called for the mass storage interface device _after_ we freed all memory related to both xhci hcd's. bug for that is here: https://bugzilla.kernel.org/show_bug.cgi?id=120241 usb devices with their children should be synchronously removed before hcd's are freed, but seems that is not the case, at least not for the device release function for the interface device. A horrible workaround to hide this issue was to sleep for a second or two before freeing the hcd memory, this lets some pending work finish before hcds disappear. (more info in that bug report) Also this commit in 4.8-rc3 solves a related xhci PCI hotplug issue: f1f6d9a xhci: don't dereference a xhci member after removing xhci Anyways, I'll look at that panic in more detail as well -Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html