1. 15 8月, 2015 2 次提交
  2. 09 8月, 2015 1 次提交
  3. 23 7月, 2015 2 次提交
  4. 31 5月, 2015 1 次提交
    • R
      usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset · fb6d1f7d
      Robert Schlabbach 提交于
      Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset.
      
      Dissolve the function hub_port_finish_reset() completely and divide the
      actions to be taken into those which need to be done after each reset
      attempt and those which need to be done after the full procedure is
      complete, and place them in the appropriate places in hub_port_reset().
      Also, remove an unneeded forward declaration of hub_port_reset().
      
      Verbose Problem Description:
      
      USB 3.0 devices may be "lost for good" during a hub port reset.
      This makes Linux unable to boot from USB 3.0 devices in certain
      constellations of host controllers and devices, because the USB device is
      lost during initialization, preventing the rootfs from being mounted.
      
      The underlying problem is that in the affected constellations, during the
      processing inside hub_port_reset(), the hub link state goes from 0 to
      SS.inactive after the initial reset, and back to 0 again only after the
      following "warm" reset.
      
      However, hub_port_finish_reset() is called after each reset attempt and
      sets the state the connected USB device based on the "preliminary" status
      of the hot reset to USB_STATE_NOTATTACHED due to SS.inactive, yet when
      the following warm reset is complete and hub_port_finish_reset() is
      called again, its call to set the device to USB_STATE_DEFAULT is blocked
      by usb_set_device_state() which does not allow taking USB devices out of
      USB_STATE_NOTATTACHED state.
      
      Thanks to Alan Stern for guiding me to the proper solution and how to
      submit it.
      
      Link: http://lkml.kernel.org/r/trinity-25981484-72a9-4d46-bf17-9c1cf9301a31-1432073240136%20()%203capp-gmx-bs27Signed-off-by: NRobert Schlabbach <robert_s@gmx.net>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb6d1f7d
  5. 10 5月, 2015 1 次提交
  6. 08 5月, 2015 3 次提交
  7. 08 4月, 2015 1 次提交
  8. 09 2月, 2015 1 次提交
  9. 04 2月, 2015 2 次提交
  10. 25 1月, 2015 2 次提交
    • D
      usb: core: hub: modify hub reset logic in hub driver · fbaecff0
      Deepak Das 提交于
      Currently if port power is turned off by user on hub port
      using USBDEVFS then port power is turned back ON
      by hub driver.
      This commit modifies hub reset logic in hub_port_connect() to prevent
      hub driver from turning back the port power ON if port is not owned
      by kernel.
      Signed-off-by: NDeepak Das <deepakdas.linux@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fbaecff0
    • A
      USB: don't cancel queued resets when unbinding drivers · 524134d4
      Alan Stern 提交于
      The USB stack provides a mechanism for drivers to request an
      asynchronous device reset (usb_queue_reset_device()).  The mechanism
      uses a work item (reset_ws) embedded in the usb_interface structure
      used by the driver, and the reset is carried out by a work queue
      routine.
      
      The asynchronous reset can race with driver unbinding.  When this
      happens, we try to cancel the queued reset before unbinding the
      driver, on the theory that the driver won't care about any resets once
      it is unbound.
      
      However, thanks to the fact that lockdep now tracks work queue
      accesses, this can provoke a lockdep warning in situations where the
      device reset causes another interface's driver to be unbound; see
      
      	http://marc.info/?l=linux-usb&m=141893165203776&w=2
      
      for an example.  The reason is that the work routine for reset_ws in
      one interface calls cancel_queued_work() for the reset_ws in another
      interface.  Lockdep thinks this might lead to a work routine trying to
      cancel itself.  The simplest solution is not to cancel queued resets
      when unbinding drivers.
      
      This means we now need to acquire a reference to the usb_interface
      when queuing a reset_ws work item and to drop the reference when the
      work routine finishes.  We also need to make sure that the
      usb_interface structure doesn't outlive its parent usb_device; this
      means acquiring and dropping a reference when the interface is created
      and destroyed.
      
      In addition, cancelling a queued reset can fail (if the device is in
      the middle of an earlier reset), and this can cause usb_reset_device()
      to try to rebind an interface that has been deallocated (see
      http://marc.info/?l=linux-usb&m=142175717016628&w=2 for details).
      Acquiring the extra references prevents this failure.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NRussell King - ARM Linux <linux@arm.linux.org.uk>
      Reported-by: NOlivier Sobrie <olivier@sobrie.be>
      Tested-by: NOlivier Sobrie <olivier@sobrie.be>
      Cc: stable <stable@vger.kernel.org> # 3.19
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      524134d4
  11. 04 12月, 2014 1 次提交
  12. 04 11月, 2014 4 次提交
  13. 29 9月, 2014 2 次提交
  14. 24 9月, 2014 9 次提交
  15. 11 9月, 2014 1 次提交
  16. 28 8月, 2014 1 次提交
  17. 27 8月, 2014 1 次提交
  18. 20 8月, 2014 2 次提交
  19. 19 7月, 2014 2 次提交
    • P
      USB: Fix persist resume of some SS USB devices · a40178b2
      Pratyush Anand 提交于
      Problem Summary: Problem has been observed generally with PM states
      where VBUS goes off during suspend. There are some SS USB devices which
      take longer time for link training compared to many others.  Such
      devices fail to reconnect with same old address which was associated
      with it before suspend.
      
      When system resumes, at some point of time (dpm_run_callback->
      usb_dev_resume->usb_resume->usb_resume_both->usb_resume_device->
      usb_port_resume) SW reads hub status. If device is present,
      then it finishes port resume and re-enumerates device with same
      address. If device is not present then, SW thinks that device was
      removed during suspend and therefore does logical disconnection
      and removes all the resource allocated for this device.
      
      Now, if I put sufficient delay just before root hub status read in
      usb_resume_device then, SW sees always that device is present. In normal
      course(without any delay) SW sees that no device is present and then SW
      removes all resource associated with the device at this port.  In the
      latter case, after sometime, device says that hey I am here, now host
      enumerates it, but with new address.
      
      Problem had been reproduced when I connect verbatim USB3.0 hard disc
      with my STiH407 XHCI host running with 3.10 kernel.
      
      I see that similar problem has been reported here.
      https://bugzilla.kernel.org/show_bug.cgi?id=53211
      Reading above it seems that bug was not in 3.6.6 and was present in 3.8
      and again it was not present for some in 3.12.6, while it was present
      for few others. I tested with 3.13-FC19 running at i686 desktop, problem
      was still there. However, I was failed to reproduce it with 3.16-RC4
      running at same i686 machine. I would say it is just a random
      observation. Problem for few devices is always there, as I am unable to
      find a proper fix for the issue.
      
      So, now question is what should be the amount of delay so that host is
      always able to recognize suspended device after resume.
      
      XHCI specs 4.19.4 says that when Link training is successful, port sets
      CSC bit to 1. So if SW reads port status before successful link
      training, then it will not find device to be present.  USB Analyzer log
      with such buggy devices show that in some cases device switch on the
      RX termination after long delay of host enabling the VBUS. In few other
      cases it has been seen that device fails to negotiate link training in
      first attempt. It has been reported till now that few devices take as
      long as 2000 ms to train the link after host enabling its VBUS and
      RX termination. This patch implements a 2000 ms timeout for CSC bit to set
      ie for link training. If in a case link trains before timeout, loop will
      exit earlier.
      
      This patch implements above delay, but only for SS device and when
      persist is enabled.
      
      So, for the good device overhead is almost none. While for the bad
      devices penalty could be the time which it take for link training.
      But, If a device was connected before suspend, and was removed
      while system was asleep, then the penalty would be the timeout ie
      2000 ms.
      
      Results:
      
      Verbatim USB SS hard disk connected with STiH407 USB host running 3.10
      Kernel resumes in 461 msecs without this patch, but hard disk is
      assigned a new device address. Same system resumes in 790 msecs with
      this patch, but with old device address.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NPratyush Anand <pratyush.anand@st.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a40178b2
    • O
      usbcore: don't log on consecutive debounce failures of the same port · 5ee0f803
      Oliver Neukum 提交于
      Some laptops have an internal port for a BT device which picks
      up noise when the kill switch is used, but not enough to trigger
      printk_rlimit(). So we shouldn't log consecutive faults of this kind.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ee0f803
  20. 18 7月, 2014 1 次提交
    • G
      usb: Check if port status is equal to RxDetect · bb86cf56
      Gavin Guo 提交于
      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: NGavin Guo <gavin.guo@canonical.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bb86cf56