force usb disconnect/reconnect












2















My external HDD dock require a frustrating sequence for mounting where plugging the usb cable must be the last step (ie insert HDD, power on, plug-in).



When I do this it works perfectly, but the cable is not very accessible, and I fear that frequent plug/unplug will eventually damage it.



So I tried to power-on the device while leaving the usb cable plugged. Sometimes it works and sometimes it doesn't.
When it does not work I get this message (dmesg):



[372734.412683] xhci_hcd 0000:00:14.0: Command completion event does not match command
[372734.412686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[372739.622686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[372739.826432] usb 3-5: device not accepting address 21, error -62


A lsusb -v gives:



Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 3
bMaxPacketSize0 9
idVendor 0x1d6b Linux Foundation
idProduct 0x0003 3.0 root hub
bcdDevice 4.02
iManufacturer 3 Linux 4.2.0-0.bpo.1-amd64 xhci-hcd
iProduct 2 xHCI Host Controller
iSerial 1 0000:00:14.0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 31
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
bMaxBurst 0
Hub Descriptor:
bLength 12
bDescriptorType 42
nNbrPorts 6
wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
bHubDecLat 0.0 micro seconds
wHubDelay 0 nano seconds
DeviceRemovable 0x00
Hub Port Status:
Port 1: 0000.02a0 5Gbps power Rx.Detect
Port 2: 0000.02a0 5Gbps power Rx.Detect
Port 3: 0000.02a0 5Gbps power Rx.Detect
Port 4: 0000.02a0 5Gbps power Rx.Detect
Port 5: 0000.02e0 5Gbps power Polling
Port 6: 0000.02a0 5Gbps power Rx.Detect


so if I understand correctly there is some error within an internal usb hub.



So I wonder if there is a way to simulate some kind of reset that would make the device to register again, without manipulating the usb cable.



This could also be helpful to remotely mount the device for example.



Thanks










share|improve this question



























    2















    My external HDD dock require a frustrating sequence for mounting where plugging the usb cable must be the last step (ie insert HDD, power on, plug-in).



    When I do this it works perfectly, but the cable is not very accessible, and I fear that frequent plug/unplug will eventually damage it.



    So I tried to power-on the device while leaving the usb cable plugged. Sometimes it works and sometimes it doesn't.
    When it does not work I get this message (dmesg):



    [372734.412683] xhci_hcd 0000:00:14.0: Command completion event does not match command
    [372734.412686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
    [372739.622686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
    [372739.826432] usb 3-5: device not accepting address 21, error -62


    A lsusb -v gives:



    Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 3.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 3
    bMaxPacketSize0 9
    idVendor 0x1d6b Linux Foundation
    idProduct 0x0003 3.0 root hub
    bcdDevice 4.02
    iManufacturer 3 Linux 4.2.0-0.bpo.1-amd64 xhci-hcd
    iProduct 2 xHCI Host Controller
    iSerial 1 0000:00:14.0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 31
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xe0
    Self Powered
    Remote Wakeup
    MaxPower 0mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 9 Hub
    bInterfaceSubClass 0 Unused
    bInterfaceProtocol 0 Full speed (or root) hub
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0004 1x 4 bytes
    bInterval 12
    bMaxBurst 0
    Hub Descriptor:
    bLength 12
    bDescriptorType 42
    nNbrPorts 6
    wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    bPwrOn2PwrGood 10 * 2 milli seconds
    bHubContrCurrent 0 milli Ampere
    bHubDecLat 0.0 micro seconds
    wHubDelay 0 nano seconds
    DeviceRemovable 0x00
    Hub Port Status:
    Port 1: 0000.02a0 5Gbps power Rx.Detect
    Port 2: 0000.02a0 5Gbps power Rx.Detect
    Port 3: 0000.02a0 5Gbps power Rx.Detect
    Port 4: 0000.02a0 5Gbps power Rx.Detect
    Port 5: 0000.02e0 5Gbps power Polling
    Port 6: 0000.02a0 5Gbps power Rx.Detect


    so if I understand correctly there is some error within an internal usb hub.



    So I wonder if there is a way to simulate some kind of reset that would make the device to register again, without manipulating the usb cable.



    This could also be helpful to remotely mount the device for example.



    Thanks










    share|improve this question

























      2












      2








      2








      My external HDD dock require a frustrating sequence for mounting where plugging the usb cable must be the last step (ie insert HDD, power on, plug-in).



      When I do this it works perfectly, but the cable is not very accessible, and I fear that frequent plug/unplug will eventually damage it.



      So I tried to power-on the device while leaving the usb cable plugged. Sometimes it works and sometimes it doesn't.
      When it does not work I get this message (dmesg):



      [372734.412683] xhci_hcd 0000:00:14.0: Command completion event does not match command
      [372734.412686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
      [372739.622686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
      [372739.826432] usb 3-5: device not accepting address 21, error -62


      A lsusb -v gives:



      Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      Device Descriptor:
      bLength 18
      bDescriptorType 1
      bcdUSB 3.00
      bDeviceClass 9 Hub
      bDeviceSubClass 0 Unused
      bDeviceProtocol 3
      bMaxPacketSize0 9
      idVendor 0x1d6b Linux Foundation
      idProduct 0x0003 3.0 root hub
      bcdDevice 4.02
      iManufacturer 3 Linux 4.2.0-0.bpo.1-amd64 xhci-hcd
      iProduct 2 xHCI Host Controller
      iSerial 1 0000:00:14.0
      bNumConfigurations 1
      Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 31
      bNumInterfaces 1
      bConfigurationValue 1
      iConfiguration 0
      bmAttributes 0xe0
      Self Powered
      Remote Wakeup
      MaxPower 0mA
      Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 9 Hub
      bInterfaceSubClass 0 Unused
      bInterfaceProtocol 0 Full speed (or root) hub
      iInterface 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x81 EP 1 IN
      bmAttributes 3
      Transfer Type Interrupt
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0004 1x 4 bytes
      bInterval 12
      bMaxBurst 0
      Hub Descriptor:
      bLength 12
      bDescriptorType 42
      nNbrPorts 6
      wHubCharacteristic 0x000a
      No power switching (usb 1.0)
      Per-port overcurrent protection
      bPwrOn2PwrGood 10 * 2 milli seconds
      bHubContrCurrent 0 milli Ampere
      bHubDecLat 0.0 micro seconds
      wHubDelay 0 nano seconds
      DeviceRemovable 0x00
      Hub Port Status:
      Port 1: 0000.02a0 5Gbps power Rx.Detect
      Port 2: 0000.02a0 5Gbps power Rx.Detect
      Port 3: 0000.02a0 5Gbps power Rx.Detect
      Port 4: 0000.02a0 5Gbps power Rx.Detect
      Port 5: 0000.02e0 5Gbps power Polling
      Port 6: 0000.02a0 5Gbps power Rx.Detect


      so if I understand correctly there is some error within an internal usb hub.



      So I wonder if there is a way to simulate some kind of reset that would make the device to register again, without manipulating the usb cable.



      This could also be helpful to remotely mount the device for example.



      Thanks










      share|improve this question














      My external HDD dock require a frustrating sequence for mounting where plugging the usb cable must be the last step (ie insert HDD, power on, plug-in).



      When I do this it works perfectly, but the cable is not very accessible, and I fear that frequent plug/unplug will eventually damage it.



      So I tried to power-on the device while leaving the usb cable plugged. Sometimes it works and sometimes it doesn't.
      When it does not work I get this message (dmesg):



      [372734.412683] xhci_hcd 0000:00:14.0: Command completion event does not match command
      [372734.412686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
      [372739.622686] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
      [372739.826432] usb 3-5: device not accepting address 21, error -62


      A lsusb -v gives:



      Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      Device Descriptor:
      bLength 18
      bDescriptorType 1
      bcdUSB 3.00
      bDeviceClass 9 Hub
      bDeviceSubClass 0 Unused
      bDeviceProtocol 3
      bMaxPacketSize0 9
      idVendor 0x1d6b Linux Foundation
      idProduct 0x0003 3.0 root hub
      bcdDevice 4.02
      iManufacturer 3 Linux 4.2.0-0.bpo.1-amd64 xhci-hcd
      iProduct 2 xHCI Host Controller
      iSerial 1 0000:00:14.0
      bNumConfigurations 1
      Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 31
      bNumInterfaces 1
      bConfigurationValue 1
      iConfiguration 0
      bmAttributes 0xe0
      Self Powered
      Remote Wakeup
      MaxPower 0mA
      Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 1
      bInterfaceClass 9 Hub
      bInterfaceSubClass 0 Unused
      bInterfaceProtocol 0 Full speed (or root) hub
      iInterface 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x81 EP 1 IN
      bmAttributes 3
      Transfer Type Interrupt
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0004 1x 4 bytes
      bInterval 12
      bMaxBurst 0
      Hub Descriptor:
      bLength 12
      bDescriptorType 42
      nNbrPorts 6
      wHubCharacteristic 0x000a
      No power switching (usb 1.0)
      Per-port overcurrent protection
      bPwrOn2PwrGood 10 * 2 milli seconds
      bHubContrCurrent 0 milli Ampere
      bHubDecLat 0.0 micro seconds
      wHubDelay 0 nano seconds
      DeviceRemovable 0x00
      Hub Port Status:
      Port 1: 0000.02a0 5Gbps power Rx.Detect
      Port 2: 0000.02a0 5Gbps power Rx.Detect
      Port 3: 0000.02a0 5Gbps power Rx.Detect
      Port 4: 0000.02a0 5Gbps power Rx.Detect
      Port 5: 0000.02e0 5Gbps power Polling
      Port 6: 0000.02a0 5Gbps power Rx.Detect


      so if I understand correctly there is some error within an internal usb hub.



      So I wonder if there is a way to simulate some kind of reset that would make the device to register again, without manipulating the usb cable.



      This could also be helpful to remotely mount the device for example.



      Thanks







      usb udev






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 27 '17 at 17:56









      user2245644user2245644

      234




      234






















          1 Answer
          1






          active

          oldest

          votes


















          0














          This is a bit old, but I just needed the answer and found it elsewhere.



          First, copy your hub device name from error messages. In your case, 0000:00:14.0



          Then, as root, do the following:



          echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/unbind
          echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/bind


          And presto: The hub is reset and you can continue using.



          I've been dealing with this bug for some years now. I'm not sure if it is a kernel issue, or a hardware issue (my main suspicion). But at least now I don't need to reboot just to reset the USB hub.



          Hope this helps someone.






          share|improve this answer








          New contributor




          Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f340604%2fforce-usb-disconnect-reconnect%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This is a bit old, but I just needed the answer and found it elsewhere.



            First, copy your hub device name from error messages. In your case, 0000:00:14.0



            Then, as root, do the following:



            echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/unbind
            echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/bind


            And presto: The hub is reset and you can continue using.



            I've been dealing with this bug for some years now. I'm not sure if it is a kernel issue, or a hardware issue (my main suspicion). But at least now I don't need to reboot just to reset the USB hub.



            Hope this helps someone.






            share|improve this answer








            New contributor




            Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              This is a bit old, but I just needed the answer and found it elsewhere.



              First, copy your hub device name from error messages. In your case, 0000:00:14.0



              Then, as root, do the following:



              echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/unbind
              echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/bind


              And presto: The hub is reset and you can continue using.



              I've been dealing with this bug for some years now. I'm not sure if it is a kernel issue, or a hardware issue (my main suspicion). But at least now I don't need to reboot just to reset the USB hub.



              Hope this helps someone.






              share|improve this answer








              New contributor




              Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                This is a bit old, but I just needed the answer and found it elsewhere.



                First, copy your hub device name from error messages. In your case, 0000:00:14.0



                Then, as root, do the following:



                echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/unbind
                echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/bind


                And presto: The hub is reset and you can continue using.



                I've been dealing with this bug for some years now. I'm not sure if it is a kernel issue, or a hardware issue (my main suspicion). But at least now I don't need to reboot just to reset the USB hub.



                Hope this helps someone.






                share|improve this answer








                New contributor




                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                This is a bit old, but I just needed the answer and found it elsewhere.



                First, copy your hub device name from error messages. In your case, 0000:00:14.0



                Then, as root, do the following:



                echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/unbind
                echo 0000:00:14.0 >> /sys/bus/pci/drivers/xhci_hcd/bind


                And presto: The hub is reset and you can continue using.



                I've been dealing with this bug for some years now. I'm not sure if it is a kernel issue, or a hardware issue (my main suspicion). But at least now I don't need to reboot just to reset the USB hub.



                Hope this helps someone.







                share|improve this answer








                New contributor




                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 2 hours ago









                JonnyJonny

                11




                11




                New contributor




                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Jonny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f340604%2fforce-usb-disconnect-reconnect%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    CARDNET

                    Boot-repair Failure: Unable to locate package grub-common:i386

                    濃尾地震