Hi! > Because of wrong device descriptor, certain oppo/oneplus phones, > like my oppo find x5, can't connect to linux computers using usb3 cables, > the issue is also on other oppo/oneplus phones such as oneplus 9 pro, > starting from OxygenOs 13 in december 2022 > link: https://xdaforums.com/t/connection-problems-to-a-computer-with-linux.4642402/ > The issue is present in kernel 6.17 but also in older versions. > The connection correctly works using an usb2 cable. > > The phone is detected as a USB SuperSpeed device but the device descriptor flag given is USB 2.0, > so, according to dmesg, the kernel warm reset the phone and don't manage to establishes the connection, which is annoying: > > [ 3537.701845] usb 2-2: new SuperSpeed USB device number 4 using xhci_hcd > [ 3537.722594] usb 2-2: got a wrong device descriptor, warm reset device > [ 3538.105960] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd > [ 3538.126933] usb 2-2: got a wrong device descriptor, warm reset device > [ 3538.313826] usb usb2-port2: attempt power cycle > [ 3539.241985] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd > [ 3539.262410] usb 2-2: got a wrong device descriptor, warm reset device > [ 3539.646017] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd > [ 3539.666993] usb 2-2: got a wrong device descriptor, warm reset device > [ 3539.853713] usb usb2-port2: unable to enumerate USB device > > The issue is due to oppo phones not being conformant to usb standard. > Maybe the kernel should still establish the connection if warm resets fail, by counting fails or something, > otherwise oppo phones will never manage to connect through usb3.0 cables, until oppo fixes it. > > I'm not a dev, so my solution was just to disable the feature: I'm afraid patch will not be acceptable like this, but you could be able to put this behind some kind of blacklist. Best regards, Pavel > drivers/usb/core/hub.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 256fe8c86828..be28296b39de 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -5186,20 +5186,6 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, > *dev_descr = *descr; > kfree(descr); > > - /* > - * Some superspeed devices have finished the link training process > - * and attached to a superspeed hub port, but the device descriptor > - * got from those devices show they aren't superspeed devices. Warm > - * reset the port attached by the devices can fix them. > - */ > - if ((udev->speed >= USB_SPEED_SUPER) && > - (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300)) { > - dev_err(&udev->dev, "got a wrong device descriptor, warm reset device\n"); > - hub_port_reset(hub, port1, udev, HUB_BH_RESET_TIME, true); > - retval = -EINVAL; > - goto fail; > - } > - > usb_detect_quirks(udev); > > if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201) { -- I don't work for Nazis and criminals, and neither should you. Boycott Putin, Trump, Netanyahu and Musk!