• Gavin Guo's avatar
    usb: Check if port status is equal to RxDetect · 23596265
    Gavin Guo authored
    commit bb86cf56 upstream.
    
    When using USB 3.0 pen drive with the [AMD] FCH USB XHCI Controller
    [1022:7814], the second hotplugging will experience the USB 3.0 pen
    drive is recognized as high-speed device. After bisecting the kernel,
    I found the commit number 41e7e056
    (USB: Allow USB 3.0 ports to be disabled.) causes the bug. After doing
    some experiments, the bug can be fixed by avoiding executing the function
    hub_usb3_port_disable(). Because the port status with [AMD] FCH USB
    XHCI Controlleris [1022:7814] is already in RxDetect
    (I tried printing out the port status before setting to Disabled state),
    it's reasonable to check the port status before really executing
    hub_usb3_port_disable().
    
    Fixes: 41e7e056 (USB: Allow USB 3.0 ports to be disabled.)
    Signed-off-by: default avatarGavin Guo <gavin.guo@canonical.com>
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    [bwh: Backported to 3.2: use hub device as context for dev_dbg(),
     as hub ports are not devices in their own right]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    23596265
hub.c 121 KB