Re: Bug 153551: Kernel panic on Nexus 5X USB unplug while tethering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23.08.2016 19:14, Jose Marino wrote:

On 08/23/2016 06:36 AM, Mathias Nyman wrote:
On 23.08.2016 14:26, Mathias Nyman wrote:
On 23.08.2016 13:54, Mathias Nyman wrote:
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.

...
Anyways, I'll look at that panic in more detail as well


The patch did not apply on top of 4.7.2. I applied this patch instead, which I hope is equivalent:

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index d7d5025..20b1b18 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -840,6 +840,10 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
      spin_lock_irqsave(&xhci->lock, flags);

      ep->stop_cmds_pending--;
+    if (xhci->xhc_state & XHCI_STATE_REMOVING) {
+        spin_unlock_irqrestore(&xhci->lock, flags);
+        return;
+    }
      if (xhci->xhc_state & XHCI_STATE_DYING) {
          xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
                  "Stop EP timer ran, but another timer marked "
@@ -893,7 +897,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
      spin_unlock_irqrestore(&xhci->lock, flags);
      xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
              "Calling usb_hc_died()");
-    usb_hc_died(xhci_to_hcd(xhci)->primary_hcd);
+    usb_hc_died(xhci_to_hcd(xhci));
      xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
              "xHCI host controller is dead.");
  }


So, I apply the patch, reboot, suspend/resume, plug in phone and tell it to tether. The dhcp client is still unable to communicate and times out. However, the patch seems to have avoided the NULL dereference. The computer did not panic although my X session stopped responding. I went to virtual console and recorded a dmesg (find attached).

Patch looks correct, It only solves the NULL pointer issue
Thanks for testing.
The new log again points to a locking issue, I'll take a look.

-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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux