1. 04 12月, 2013 1 次提交
  2. 31 8月, 2013 1 次提交
  3. 15 8月, 2013 1 次提交
  4. 13 8月, 2013 3 次提交
    • M
      usb: ehci: Add support for SINGLE_STEP_SET_FEATURE test of EHSET · 9841f37a
      Manu Gautam 提交于
      The USB Embedded High-speed Host Electrical Test (EHSET) defines the
      SINGLE_STEP_SET_FEATURE test as follows:
      
      1) The host enumerates the test device with VID:0x1A0A, PID:0x0108
      2) The host sends the SETUP stage of a GetDescriptor(Device)
      3) The device ACKs the request
      4) The host issues SOFs for 15 seconds allowing the test operator to
         raise the scope trigger just above the SOF voltage level
      5) The host sends the IN packet
      6) The device sends data in response, triggering the scope
      7) The host sends an ACK in response to the data
      
      This patch adds additional handling to the EHCI hub driver and allows
      the EHSET driver to initiate this test mode by issuing a a SetFeature
      request to the root hub with a Test Selector value of 0x06. From there
      it mimics ehci_urb_enqueue() but separately submits QTDs for the
      SETUP and DATA/STATUS stages in order to insert a delay in between.
      Signed-off-by: NManu Gautam <mgautam@codeaurora.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      [jackp@codeaurora.org: imported from commit c2084930 on codeaurora.org;
       minor cleanup and updated author email]
      Signed-off-by: NJack Pham <jackp@codeaurora.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9841f37a
    • M
      USB: EHCI: improve interrupt qh unlink · 9118f9eb
      Ming Lei 提交于
      ehci-hcd currently unlinks an interrupt QH when it becomes empty, that
      is, after its last URB completes.  This works well because in almost
      all cases, the completion handler for an interrupt URB resubmits the
      URB; therefore the QH doesn't become empty and doesn't get unlinked.
      
      When we start using tasklets for URB completion, this scheme won't work
      as well.  The resubmission won't occur until the tasklet runs, which
      will be some time after the completion is queued with the tasklet.
      During that delay, the QH will be empty and so will be unlinked
      unnecessarily.
      
      To prevent this problem, this patch adds a 5-ms time delay before empty
      interrupt QHs are unlinked.  Most often, during that time the interrupt
      URB will be resubmitted and thus we can avoid unlinking the QH.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9118f9eb
    • T
      usb: host: add has_tdi_phy_lpm capability bit · 2cdcec4f
      Tuomas Tynkkynen 提交于
      The has_hostpc capability bit indicates that the host controller has the
      HOSTPC register extensions, but at the same time enables clock disabling
      power saving features with the PHY Low Power Clock Disable (PHCD) bit.
      
      However, some host controllers have the HOSTPC extensions but don't
      support the low-power feature, so the PHCD bit must not be set on those
      controllers. Add a separate capability bit for the low-power feature
      instead, and change all existing users of has_hostpc to use this new
      capability bit.
      
      The idea for this commit is taken from an old 2012 commit that never got
      merged ("disociate chipidea PHY low power suspend control from hostpc")
      Inspired-by: NMatthieu CASTET <matthieu.castet@parrot.com>
      Signed-off-by: NTuomas Tynkkynen <ttynkkynen@nvidia.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      2cdcec4f
  5. 02 8月, 2013 2 次提交
    • A
      USB: EHCI: don't depend on hardware for tracking port resets and resumes · 6753f4cf
      Alan Stern 提交于
      In theory, an EHCI controller can turn off the PORT_RESUME or
      PORT_RESET bits in a port status register all by itself (and some
      controllers actually do this).  We shouldn't depend on these bits
      being set correctly.
      
      This patch rearranges the code in ehci-hcd that handles completion of
      port resets and resumes.  We guarantee that ehci->reset_done[portnum]
      is nonzero if a reset or resume is in progress, and that the portnum
      bit is set in ehci->resuming_ports if the operation is a resume.  (To
      help enforce this guarantee, the patch prevents suspended ports from
      being reset.)  Therefore it's not necessary to look at the port status
      bits to learn what's going on.
      
      The patch looks bigger than it really is, because it changes the
      indentation level of a sizeable region of code.  Most of what it
      actually does is interchange some tests.  The only functional changes
      are testing reset_done and resuming_ports rather than PORT_RESUME and
      PORT_RESET, removing a now-unnecessary check for spontaneous
      resets of the PORT_RESUME and PORT_RESET bits, and preventing a
      suspended or resuming port from being reset.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6753f4cf
    • A
      USB: EHCI: keep better track of resuming ports · 3a20446f
      Alan Stern 提交于
      The ehci-hcd driver isn't as careful as it should be about the way it
      uses ehci->resuming_ports.  One of the omissions was fixed recently by
      commit 47a64a13 (USB: EHCI: Fix resume signalling on remote
      wakeup), but there are other places that need attention:
      
      	When a port's suspend feature is explicitly cleared, the
      	corresponding bit in resuming_ports should be set and the core
      	should be notified about the port resume.
      
      	We don't need to clear a resuming_ports bit when a reset
      	completes.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a20446f
  6. 23 7月, 2013 1 次提交
  7. 18 6月, 2013 1 次提交
  8. 21 5月, 2013 1 次提交
    • J
      usb: ehci: Only sleep for post-resume handover if devices use persist · 9b790915
      Julius Werner 提交于
      The current EHCI code sleeps a flat 110ms in the resume path if there
      was a USB 1.1 device connected to its companion controller during
      suspend, waiting for the device to reappear and reset so that it can be
      handed back to the companion. This is necessary if the device uses
      persist, so that the companion controller can actually see it during its
      own resume path.
      
      However, if the device doesn't use persist, this is entirely
      unnecessary. We might just as well ignore it and have the normal device
      detection/reset/handoff code handle it asynchronously when it eventually
      shows up. As USB 1.1 devices are almost exclusively HIDs these days (for
      which persist has no value), this can allow distros to shave another
      tenth of a second off their resume time.
      
      In order to enable this optimization, the patch also adds a new
      usb_for_each_dev() iterator that is exported by the USB core and wraps
      bus_for_each_dev() with the logic to differentiate between struct
      usb_device and struct usb_interface on the usb_bus_type bus.
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b790915
  9. 04 4月, 2013 1 次提交
  10. 19 3月, 2013 2 次提交
  11. 16 3月, 2013 1 次提交
    • A
      USB: EHCI: fix regression during bus resume · 2a40f324
      Alan Stern 提交于
      This patch (as1663) fixes a regression caused by commit
      6e0c3339 (USB: EHCI: unlink one async
      QH at a time).  In order to avoid keeping multiple QHs in an unusable
      intermediate state, that commit changed unlink_empty_async() so that
      it unlinks only one empty QH at a time.
      
      However, when the EHCI root hub is suspended, _all_ async QHs need to
      be unlinked.  ehci_bus_suspend() used to do this by calling
      unlink_empty_async(), but now this only unlinks one of the QHs, not
      all of them.
      
      The symptom is that when the root hub is resumed, USB communications
      don't work for some period of time.  This is because ehci-hcd doesn't
      realize it needs to restart the async schedule; it assumes that
      because some QHs are already on the schedule, the schedule must be
      running.
      
      The easiest way to fix the problem is add a new function that unlinks
      all the async QHs when the root hub is suspended.
      
      This patch should be applied to all kernels that have the 6e0c3339
      commit.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NAdrian Bassett <adrian.bassett@hotmail.co.uk>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a40f324
  12. 26 1月, 2013 2 次提交
  13. 01 11月, 2012 3 次提交
    • A
      USB: EHCI: prepare to make ehci-hcd a library module · 3e023203
      Alan Stern 提交于
      This patch (as1624) prepares ehci-hcd for being split up into a core
      library and separate platform driver modules.  A generic
      ehci_hc_driver structure is created, containing all the "standard"
      values, and a new mechanism is added whereby a driver module can
      specify a set of overrides to those values.  In addition the
      ehci_setup(), ehci_suspend(), and ehci_resume() routines need to be
      EXPORTed for use by the drivers.
      
      As a side effect of this change, a few routines no longer need to be
      marked __maybe_unused.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e023203
    • A
      USB: EHCI: remove ehci_port_power() routine · c73cee71
      Alan Stern 提交于
      This patch (as1623) removes the ehci_port_power() routine and all the
      places that call it.  There's no reason for ehci-hcd to change the
      port power settings; the hub driver takes care of all that stuff.
      
      There is one exception: When the controller is resumed from
      hibernation or following a loss of power, the ports that are supposed
      to be handed over to a companion controller must be powered on first.
      Otherwise the handover won't work.  This process is not visible to the
      hub driver, so it has to be handled in ehci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c73cee71
    • A
      USB: EHCI: remove unused Link Power Management code · 4968f951
      Alan Stern 提交于
      This patch (as1622) removes the USB-2.1 Link Power Management code
      from the ehci-hcd driver.  This code was never integrated with
      usbcore, it is full of bugs, and it was not getting used by anybody.
      
      However, the debugging code for dumping the LPM-related fields in the
      EHCI registers is left in place.  In theory it might be useful to see
      these values, even though we don't use them.
      
      This essentially amounts to a partial revert of commit
      aa4d8342 (USB: EHCI: EHCI 1.1
      addendum: preparation) and an almost full revert of commit
      48f24970 (USB: EHCI: EHCI 1.1
      addendum: Basic LPM feature support) plus its follow-ons.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4968f951
  14. 25 10月, 2012 1 次提交
  15. 19 9月, 2012 1 次提交
  16. 17 7月, 2012 12 次提交
    • A
      USB: EHCI: resolve some unlikely races · 43fe3a99
      Alan Stern 提交于
      This patch (as1589) resolves some unlikely races involving system
      shutdown or controller death in ehci-hcd:
      
      	Shutdown races with both root-hub resume and controller
      	resume.
      
      	Controller death races with root-hub suspend.
      
      A new bitflag is added to indicate that the controller has been shut
      down (whether for system shutdown or because it died).  Tests are
      added in the suspend and resume pathways to avoid reactivating the
      controller after any sort of shutdown.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      43fe3a99
    • A
      USB: EHCI: fix up locking · c4f34764
      Alan Stern 提交于
      This patch (as1588) adjusts the locking in ehci-hcd's various halt,
      shutdown, and suspend/resume pathways.  We want to hold the spinlock
      while writing device registers and accessing shared variables, but not
      while polling in a loop.
      
      In addition, there's no need to call ehci_work() at times when no URBs
      can be active, i.e., in ehci_stop() and ehci_bus_suspend().
      
      Finally, ehci_adjust_port_wakeup_flags() is called only in situations
      where interrupts are enabled; therefore it can use spin_lock_irq
      rather than spin_lock_irqsave.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4f34764
    • A
      USB: EHCI: use hrtimer for the I/O watchdog · 18aafe64
      Alan Stern 提交于
      This patch (as1586) replaces the kernel timer used by ehci-hcd as an
      I/O watchdog with an hrtimer event.
      
      Unlike in the current code, the watchdog event is now always enabled
      whenever any isochronous URBs are active.  This will prevent bugs
      caused by the periodic schedule wrapping around with no completion
      interrupts; the watchdog handler is guaranteed to scan the isochronous
      transfers at least once during each iteration of the schedule.  The
      extra overhead will be negligible: one timer interrupt every 100 ms.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      18aafe64
    • A
      USB: EHCI: use hrtimer for unlinking empty async QHs · 32830f20
      Alan Stern 提交于
      This patch (as1583) changes ehci-hcd to use an hrtimer event for
      unlinking empty (unused) async QHs instead of using a kernel timer.
      
      The check for empty QHs is moved to a new routine, where it doesn't
      require going through an entire scan of both the async and periodic
      schedules.  And it can unlink multiple QHs at once, unlike the current
      code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      32830f20
    • A
      USB: EHCI: unlink multiple async QHs together · 3c273a05
      Alan Stern 提交于
      This patch (as1582) changes ehci-hcd's strategy for unlinking async
      QHs.  Currently the driver never unlinks more than one QH at a time.
      This can be inefficient and cause unnecessary delays, since a QH
      cannot be reused while it is waiting to be unlinked.
      
      The new strategy unlinks all the waiting QHs at once.  In practice the
      improvement won't be very big, because it's somewhat uncommon to have
      two or more QHs waiting to be unlinked at any time.  But it does
      happen, and in any case, doing things this way makes more sense IMO.
      
      The change requires the async unlinking code to be refactored
      slightly.  Now in addition to the routines for starting and ending an
      unlink, there are new routines for unlinking a single QH and starting
      an IAA cycle.  This approach is needed because there are two separate
      paths for unlinking async QHs:
      
      	When a transfer error occurs or an URB is cancelled, the QH
      	must be unlinked right away;
      
      	When a QH has been idle sufficiently long, it is unlinked
      	to avoid consuming DMA bandwidth uselessly.
      
      In the first case we want the unlink to proceed as quickly as
      possible, whereas in the second case we can afford to batch several
      QHs together and unlink them all at once.  Hence the division of
      labor.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c273a05
    • A
      USB: EHCI: use hrtimer for the IAA watchdog · 9d938747
      Alan Stern 提交于
      This patch (as1581) replaces the iaa_watchdog kernel timer used by
      ehci-hcd with an hrtimer event, in keeping with the general conversion
      to high-res timers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d938747
    • A
      USB: EHCI: use hrtimer for (s)iTD deallocation · 55934eb3
      Alan Stern 提交于
      This patch (as1579) adds an hrtimer event to handle deallocation of
      iTDs and siTDs in ehci-hcd.
      
      Because of the frame-oriented approach used by the EHCI periodic
      schedule, the hardware can continue to access the Transfer Descriptor
      for isochronous (or split-isochronous) transactions for up to a
      millisecond after the transaction completes.  The iTD (or siTD) must
      not be reused before then.
      
      The strategy currently used involves putting completed iTDs on a list
      of cached entries and every so often returning them to the endpoint's
      free list.  The new strategy reduces overhead by putting completed
      iTDs back on the free list immediately, although they are not reused
      until it is safe to do so.
      
      When the isochronous endpoint stops (its queue becomes empty), the
      iTDs on its free list get moved to a global list, from which they will
      be deallocated after a minimum of 2 ms.  This delay is what the new
      hrtimer event is for.
      
      Overall this may not be a tremendous improvement over the current
      code, but to me it seems a lot more clear and logical.  In addition,
      it removes the need for each iTD to keep a reference to the
      ehci_iso_stream it belongs to, since the iTD never needs to be moved
      back to the stream's free list from the global list.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55934eb3
    • A
      USB: EHCI: use hrtimer for interrupt QH unlink · df202255
      Alan Stern 提交于
      This patch (as1577) adds hrtimer support for unlinking interrupt QHs
      in ehci-hcd.  The current code relies on a fixed delay of either 2 or
      55 us, which is not always adequate and in any case is totally bogus.
      Thanks to internal caching, the EHCI hardware may continue to access
      an interrupt QH for more than a millisecond after it has been unlinked.
      
      In fact, the EHCI spec doesn't say how long to wait before using an
      unlinked interrupt QH.  The patch sets the delay to 9 microframes
      minimum, which ought to be adequate.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df202255
    • A
      USB: EHCI: introduce high-res timer · d58b4bcc
      Alan Stern 提交于
      This patch (as1572) begins the conversion of ehci-hcd over to using
      high-resolution timers rather than old-fashioned low-resolution kernel
      timers.  This reduces overhead caused by timer roundoff on systems
      where HZ is smaller than 1000.  Also, the new timer framework
      introduced here is much more logical and easily extended than the
      ad-hoc approach ehci-hcd currently uses for timers.
      
      An hrtimer structure is added to ehci_hcd, along with a bitflag array
      and an array of ktime_t values, to keep track of which timing events
      are pending and what their expiration times are.
      
      Only the infrastructure for the timing operations is added in this
      patch.  Later patches will add routines for handling each of the
      various timing events the driver needs.  In some cases the new hrtimer
      handlers will replace the existing handlers for ehci-hcd's kernel
      timers; as this happens the old timers will be removed.  In other
      cases the new timing events will replace busy-wait loops.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d58b4bcc
    • A
      USB: EHCI: add new root-hub state: STOPPING · c0c53dbc
      Alan Stern 提交于
      This patch (as1571) adds a new state for ehci-hcd's root hubs:
      EHCI_RH_STOPPING.  This value is used at times when the root hub is
      being stopped and we don't know whether or not the hardware has
      finished all its DMA yet.
      
      Although the purpose may not be apparent, this distinction will come
      in useful later on.  Future patches will avoid actions that depend on
      the root hub being operational (like turning on the async or periodic
      schedules) when they see the state is EHCI_RH_STOPPING.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0c53dbc
    • A
      USB: EHCI: rename "reclaim" · 99ac5b1e
      Alan Stern 提交于
      This patch (as1569) renames the ehci->reclaim list in ehci-hcd.  The
      word "reclaim" is used in the EHCI specification to mean something
      quite different, and "unlink_next" is more descriptive of the list's
      purpose anyway.
      
      Similarly, the "reclaim" field in the ehci_stats structure is renamed
      "iaa", which is more meaningful (to experts, anyway) and is a better
      match for the "lost_iaa" field.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      99ac5b1e
    • A
      USB: EHCI: remove unneeded suspend/resume code · 15be105b
      Alan Stern 提交于
      This patch (as1566) removes the code in ehci-hcd's resume routines
      which tries to restart or cancel any transfers left active while the
      root hub or controller was asleep.  This code isn't necessary, because
      all URBs are terminated before the root hub is suspended.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      15be105b
  17. 09 7月, 2012 1 次提交
    • A
      EHCI: centralize controller suspend/resume · c5cf9212
      Alan Stern 提交于
      This patch (as1563) removes a lot of duplicated code by moving the
      EHCI controller suspend/resume routines into the core driver, where
      the various platform drivers can invoke them as needed.
      
      Not only does this simplify these platform drivers, this also makes it
      easier for other platform drivers to add suspend/resume support in the
      future.
      
      Note: The patch does not touch the ehci-fsl.c file, because its
      approach to suspend and resume is so different from all the others.
      It will have to be handled specially by its maintainer.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5cf9212
  18. 27 6月, 2012 1 次提交
  19. 14 6月, 2012 1 次提交
  20. 24 4月, 2012 1 次提交
  21. 20 4月, 2012 1 次提交
  22. 19 4月, 2012 1 次提交