1. 17 7月, 2012 19 次提交
    • A
      USB: EHCI: simplify isochronous scanning · f4289078
      Alan Stern 提交于
      This patch (as1587) simplifies ehci-hcd's scan_isoc() routine by
      eliminating some local variables, declaring boolean-valued values as
      bool rather than unsigned, changing variable names to make more sense,
      and so on.
      
      The logic at the end of the routine is cut down significantly.  The
      scanning doesn't have to catch up all the way to where the hardware
      is; it merely has to catch up to where the hardware was when the last
      interrupt occurred.  If the hardware has made more progress since then
      and issued another interrupt, a rescan will catch up to it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4289078
    • 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: always scan each interrupt QH · 569b394f
      Alan Stern 提交于
      This patch (as1585) fixes a bug in ehci-hcd's scheme for scanning
      interrupt QHs.
      
      Currently a single routine takes care of scanning everything on the
      periodic schedule.  Whenever an interrupt occurs, it scans all
      isochronous and interrupt URBs scheduled for frames that have elapsed
      since the last scan.
      
      This has two disadvantages.  The first is relatively minor: An
      interrupt QH is likely to end up getting scanned multiple times,
      particularly if the last scan was not fairly recent.  (The current
      code avoids this by maintaining a periodic_stamp in each interrupt
      QH.)
      
      The second is more serious.  The periodic schedule wraps around.  If
      the last scan occurred during frame N, and the next scan occurs when
      the schedule has gone through an entire cycle and is back at frame N,
      the scanning code won't look at any frames other than N.  Consequently
      it won't see any QHs that completed during frame N-1 or earlier.
      
      The patch replaces the entire frame-based approach for scanning
      interrupt QHs with a new routine using a list-based approach, the same
      as for async QHs.  This has a slight disadvantage, because it means
      that all interrupt QHs have to be scanned every time.  But it is more
      robust than the current approach.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      569b394f
    • A
      USB: EHCI: don't lose events during a scan · 361aabf3
      Alan Stern 提交于
      This patch (as1584) fixes a minor bug that has been present in
      ehci-hcd since the beginning.
      
      Scanning the schedules for URB completions is single-threaded.  If a
      completion interrupt occurs while an URB is being given back, the
      interrupt handler realizes that a scan is in progress on another CPU
      and avoids starting a new one.
      
      This means that completion events can be lost.  If an URB completes
      after it has been scanned but while a scan is still in progress, the
      driver won't notice and won't rescan the completed URB.
      
      The patch fixes the problem by adding a new flag to indicate that
      another scan is needed after the current scan is done.  The flag gets
      set whenever a completion interrupt occurs while a scan is in
      progress.  The rescan will see the completion, thus preventing it from
      getting lost.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      361aabf3
    • 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: don't refcount iso_stream structures · 8c5bf7be
      Alan Stern 提交于
      This patch (as1580) makes ehci_iso_stream structures behave more like
      QHs, in that they will remain allocated until their isochronous
      endpoint is disabled.  This will come in useful in the future, when
      periodic bandwidth gets allocated as an altsetting is installed rather
      than on-the-fly.
      
      For now, the change to the ehci_iso_stream lifetimes means that each
      structure is always deallocated at exactly one spot in
      ehci_endpoint_disable() and never used again.  As a result, it is no
      longer necessary to use reference counting on these things, and the
      patch removes it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c5bf7be
    • 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 controller death · bf6387bc
      Alan Stern 提交于
      This patch (as1578) adds an hrtimer event to handle the death of an
      EHCI controller.  When a controller dies, it doesn't necessarily stop
      running right away.  The new event polls at 1-ms intervals to see when
      all activity has safely stopped.  This replaces a busy-wait polling
      loop in the current code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bf6387bc
    • 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: use hrtimer for async schedule · 31446610
      Alan Stern 提交于
      This patch (as1576) adds hrtimer support for managing ehci-hcd's
      async schedule.  Just as with the earlier change to the periodic
      schedule management, two new hrtimer events take care of everything.
      
      One event polls at 1-ms intervals to see when the Asynchronous
      Schedule Status (ASS) flag matches the Asynchronous Schedule Enable
      (ASE) value; the schedule's state must not be changed until it does.
      The other event delays for 15 ms after the async schedule becomes
      empty before turning it off.
      
      The new events replace a busy-wait poll and a kernel timer usage.
      They also replace the rather illogical method currently used for
      indicating the async schedule should be turned off: attempting to
      unlink the dedicated QH at the head of the async list.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      31446610
    • A
      USB: EHCI: use hrtimer for the periodic schedule · 3ca9aeba
      Alan Stern 提交于
      This patch (as1573) adds hrtimer support for managing ehci-hcd's
      periodic schedule.  There are two issues to deal with.
      
      First, the schedule's state (on or off) must not be changed until the
      hardware status has caught up with the current command.  This is
      handled by an hrtimer event that polls at 1-ms intervals to see when
      the Periodic Schedule Status (PSS) flag matches the Periodic Schedule
      Enable (PSE) value.
      
      Second, the schedule should not be turned off as soon as it becomes
      empty.  Turning the schedule on and off takes time, so we want to wait
      until the schedule has been empty for a suitable period before turning
      it off.  This is handled by an hrtimer event that gets set to expire
      10 ms after the periodic schedule becomes empty.
      
      The existing code polls (for up to 1125 us and with interrupts
      disabled!) to check the status, and doesn't implement a delay before
      turning off the schedule.  Furthermore, if the polling fails then the
      driver decides that the controller has died.  This has caused problems
      for several people; some controllers can take 10 ms or more to turn
      off their periodic schedules.
      
      This patch fixes these issues.  It also makes the "broken_periodic"
      workaround unnecessary; there is no longer any danger of turning off
      the periodic schedule after it has been on for less than 1 ms.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ca9aeba
    • 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: add pointer to end of async-unlink list · 2f5bb665
      Alan Stern 提交于
      This patch (as1570) adds a pointer for the end of ehci-hcd's
      async-unlink list.  The list (which is actually a queue) is singly
      linked, so having a pointer to its end makes adding new entries easier
      -- there's no longer any need to scan through the whole list.
      
      In principle it could be changed to a standard doubly-linked list.  It
      turns out that doing so actually makes the code less clear, so I'm
      leaving it as is.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f5bb665
    • 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: add symbolic constants for QHs · 4c53de72
      Alan Stern 提交于
      This patch (as1568) introduces symbolic constants for some of the
      less-frequently used bitfields in the QH structure.  This makes the
      code a little easier to read and understand.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c53de72
    • A
      USB: EHCI: don't refcount QHs · c83e1a9f
      Alan Stern 提交于
      This patch (as1567) removes ehci-hcd's reference counting of QH
      structures.  It's not necessary to refcount these things because they
      always get deallocated at exactly one spot in ehci_endpoint_disable()
      (except for two special QHs, ehci->async and ehci->dummy) and are
      never used again.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c83e1a9f
  2. 14 6月, 2012 1 次提交
  3. 21 5月, 2012 1 次提交
  4. 15 5月, 2012 1 次提交
  5. 10 4月, 2012 1 次提交
  6. 13 2月, 2012 1 次提交
  7. 19 10月, 2011 1 次提交
    • A
      EHCI: workaround for MosChip controller bug · 68aa95d5
      Alan Stern 提交于
      This patch (as1489) works around a hardware bug in MosChip EHCI
      controllers.  Evidently when one of these controllers increments the
      frame-index register, it changes the three low-order bits (the
      microframe counter) before changing the higher order bits (the frame
      counter).  If the register is read at just the wrong time, the value
      obtained is too low by 8.
      
      When the appropriate quirk flag is set, we work around this problem by
      reading the frame-index register a second time if the first value's
      three low-order bits are all 0.  This gives the hardware a chance to
      finish updating the register, yielding the correct value.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NJason N Pitt <jpitt@fhcrc.org>
      CC: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      68aa95d5
  8. 23 8月, 2011 1 次提交
    • A
      USB: EHCI: remove usages of hcd->state · e8799906
      Alan Stern 提交于
      This patch (as1483) improves the ehci-hcd driver family by getting rid
      of the reliance on the hcd->state variable.  It has no clear owner and
      it isn't protected by the usual HCD locks.  In its place, the patch
      adds a new, private ehci->rh_state field to record the state of the
      root hub.
      
      Along the way, the patch removes a couple of lines containing
      redundant assignments to the state variable.  Also, the QUIESCING
      state simply gets changed to the RUNNING state, because the driver
      doesn't make any distinction between them.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e8799906
  9. 20 7月, 2011 1 次提交
    • A
      EHCI: fix direction handling for interrupt data toggles · e04f5f7e
      Alan Stern 提交于
      This patch (as1480) fixes a rather obscure bug in ehci-hcd.  The
      qh_update() routine needs to know the number and direction of the
      endpoint corresponding to its QH argument.  The number can be taken
      directly from the QH data structure, but the direction isn't stored
      there.  The direction is taken instead from the first qTD linked to
      the QH.
      
      However, it turns out that for interrupt transfers, qh_update() gets
      called before the qTDs are linked to the QH.  As a result, qh_update()
      computes a bogus direction value, which messes up the endpoint toggle
      handling.  Under the right combination of circumstances this causes
      usb_reset_endpoint() not to work correctly, which causes packets to be
      dropped and communications to fail.
      
      Now, it's silly for the QH structure not to have direct access to all
      the descriptor information for the corresponding endpoint.  Ultimately
      it may get a pointer to the usb_host_endpoint structure; for now,
      adding a copy of the direction flag solves the immediate problem.
      
      This allows the Spyder2 color-calibration system (a low-speed USB
      device that sends all its interrupt data packets with the toggle set
      to 0 and hance requires constant use of usb_reset_endpoint) to work
      when connected through a high-speed hub.  Thanks to Graeme Gill for
      supplying the hardware that allowed me to track down this bug.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NGraeme Gill <graeme@argyllcms.com>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e04f5f7e
  10. 09 7月, 2011 2 次提交
    • A
      USB: EHCI: go back to using the system clock for QH unlinks · 004c1968
      Alan Stern 提交于
      This patch (as1477) fixes a problem affecting a few types of EHCI
      controller.  Contrary to what one might expect, these controllers
      automatically stop their internal frame counter when no ports are
      enabled.  Since ehci-hcd currently relies on the frame counter for
      determining when it should unlink QHs from the async schedule, those
      controllers run into trouble: The frame counter stops and the QHs
      never get unlinked.
      
      Some systems have also experienced other problems traced back to
      commit b9638011 (USB: ehci-hcd unlink
      speedups), which made the original switch from using the system clock
      to using the frame counter.  It never became clear what the reason was
      for these problems, but evidently it is related to use of the frame
      counter.
      
      To fix all these problems, this patch more or less reverts that commit
      and goes back to using the system clock.  But this can't be done
      cleanly because other changes have since been made to the scan_async()
      subroutine.  One of these changes involved the tricky logic that tries
      to avoid rescanning QHs that have already been seen when the scanning
      loop is restarted, which happens whenever an URB is given back.
      Switching back to clock-based unlinks would make this logic even more
      complicated.
      
      Therefore the new code doesn't rescan the entire async list whenever a
      giveback occurs.  Instead it rescans only the current QH and continues
      on from there.  This requires the use of a separate pointer to keep
      track of the next QH to scan, since the current QH may be unlinked
      while the scanning is in progress.  That new pointer must be global,
      so that it can be adjusted forward whenever the _next_ QH gets
      unlinked.  (uhci-hcd uses this same trick.)
      
      Simplification of the scanning loop removes a level of indentation,
      which accounts for the size of the patch.  The amount of code changed
      is relatively small, and it isn't exactly a reversion of the
      b9638011 commit.
      
      This fixes Bugzilla #32432.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@kernel.org>
      Tested-by: NMatej Kenda <matejken@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      004c1968
    • K
      USB: EHCI: Allow users to override 80% max periodic bandwidth · cc62a7eb
      Kirill Smelkov 提交于
      There are cases, when 80% max isochronous bandwidth is too limiting.
      
      For example I have two USB video capture cards which stream uncompressed
      video, and to stream full NTSC + PAL videos we'd need
      
          NTSC 640x480 YUV422 @30fps      ~17.6 MB/s
          PAL  720x576 YUV422 @25fps      ~19.7 MB/s
      
      isoc bandwidth.
      
      Now, due to limited alt settings in capture devices NTSC one ends up
      streaming with max_pkt_size=2688  and  PAL with max_pkt_size=2892, both
      with interval=1. In terms of microframe time allocation this gives
      
          NTSC    ~53us
          PAL     ~57us
      
      and together
      
          ~110us  >  100us == 80% of 125us uframe time.
      
      So those two devices can't work together simultaneously because the'd
      over allocate isochronous bandwidth.
      
      80% seemed a bit arbitrary to me, and I've tried to raise it to 90% and
      both devices started to work together, so I though sometimes it would be
      a good idea for users to override hardcoded default of max 80% isoc
      bandwidth.
      
      After all, isn't it a user who should decide how to load the bus? If I
      can live with 10% or even 5% bulk bandwidth that should be ok. I'm a USB
      newcomer, but that 80% set in stone by USB 2.0 specification seems to be
      chosen pretty arbitrary to me, just to serve as a reasonable default.
      
      NOTE 1
      ~~~~~~
      
      for two streams with max_pkt_size=3072 (worst case) both time
      allocation would be 60us+60us=120us which is 96% periodic bandwidth
      leaving 4% for bulk and control.  Alan Stern suggested that bulk then
      would be problematic (less than 300*8 bittimes left per microframe), but
      I think that is still enough for control traffic.
      
      NOTE 2
      ~~~~~~
      
      Sarah Sharp expressed concern that maxing out periodic bandwidth
      could lead to vendor-specific hardware bugs on host controllers, because
      
      > It's entirely possible that you'll run into
      > vendor-specific bugs if you try to pack the schedule with isochronous
      > transfers.  I don't think any hardware designer would seriously test or
      > validate their hardware with a schedule that is basically a violation of
      > the USB bus spec (more than 80% for periodic transfers).
      
      So far I've only tested this patch on my HP Mini 5103 with N10 chipset
      
          kirr@mini:~$ lspci
          00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
          00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller
          00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller
          00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
          00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
          00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02)
          00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
          00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)
          00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)
          00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)
          00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)
          00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
          00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)
          00:1f.2 SATA controller: Intel Corporation N10/ICH7 Family SATA AHCI Controller (rev 02)
          01:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
          02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8059 PCI-E Gigabit Ethernet Controller (rev 11)
      
      and the system works stable with 110us/uframe (~88%) isoc bandwith allocated for
      above-mentioned isochronous transfers.
      
      NOTE 3
      ~~~~~~
      
      This feature is off by default. I mean max periodic bandwidth is set to
      100us/uframe by default exactly as it was before the patch. So only those of us
      who need the extreme settings are taking the risk - normal users who do not
      alter uframe_periodic_max sysfs attribute should not see any change at all.
      
      NOTE 4
      ~~~~~~
      
      I've tried to update documentation in Documentation/ABI/ thoroughly, but
      only "TBD" was put into Documentation/usb/ehci.txt -- the text there seems
      to be outdated and much needing refreshing, before it could be amended.
      
      Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NKirill Smelkov <kirr@mns.spb.ru>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cc62a7eb
  11. 20 5月, 2011 1 次提交
  12. 18 5月, 2011 1 次提交
    • A
      EHCI: don't rescan interrupt QHs needlessly · 1e12c910
      Alan Stern 提交于
      This patch (as1466) speeds up processing of ehci-hcd's periodic list.
      The existing code will pointlessly rescan an interrupt endpoint queue
      each time it encounters the queue's QH in the periodic list, which can
      happen quite a few times if the endpoint's period is low.  On some
      embedded systems, this useless overhead can waste so much time that
      the driver falls hopelessly behind and loses events.
      
      The patch introduces a "periodic_stamp" variable, which gets
      incremented each time scan_periodic() runs and each time the scan
      advances to a new frame.  If the corresponding stamp in an interrupt
      QH is equal to the current periodic_stamp, we assume the QH has
      already been scanned and skip over it.  Otherwise we scan the QH as
      usual, and if none of its URBs have completed then we store the
      current periodic_stamp in the QH's stamp, preventing it from being
      scanned again.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1e12c910
  13. 04 5月, 2011 2 次提交
  14. 03 5月, 2011 1 次提交
  15. 14 4月, 2011 1 次提交
    • G
      USB: ehci: add workaround for Synopsys HC bug · 2f7ac6c1
      Gabor Juhos 提交于
      A Synopsys USB core used in various SoCs has a bug which might cause
      that the host controller not issuing ping.
      
      When software uses the Doorbell mechanism to remove queue heads, the
      host controller still has references to the removed queue head even
      after indicating an Interrupt on Async Advance. This happens if the last
      executed queue head's Next Link queue head is removed.
      
      Consequences of the defect:
      The Host controller fetches the removed queue head, using memory that
      would otherwise be deallocated.This results in incorrect transactions on
      both the USB and system memory. This may result in undefined behavior.
      
      Workarounds:
      
      1) If no queue head is active (no Status field's Active bit is set)
      after removing the queue heads, the software can write one of the valid
      queue head addresses to the ASYNCLISTADDR register and deallocate the
      removed queue head's memory after 2 microframes.
      
      If one or more of the queue heads is active (the Active bit is set in
      the Status field) after removing the queue heads, the software can delay
      memory deallocation after time X, where X is the time required for the
      Host Controller to go through all the queue heads once. X varies with
      the number of queue heads and the time required to process periodic
      transactions: if more periodic transactions must be performed, the Host
      Controller has less time to process asynchronous transaction processing.
      
      2) Do not use the Doorbell mechanism to remove the queue heads. Disable
      the Asynchronous Schedule Enable bit instead.
      
      The bug has been discussed on the linux-usb-devel mailing-list
      four years ago, the original thread can be found here:
      http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg45345.html
      
      This patch implements the first workaround as suggested by David Brownell.
      
      The built-in USB host controller of the Atheros AR7130/AR7141/AR7161 SoCs
      requires this to work properly.
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2f7ac6c1
  16. 31 3月, 2011 1 次提交
  17. 02 3月, 2011 1 次提交
    • A
      USB host: Move AMD PLL quirk to pci-quirks.c · ad93562b
      Andiry Xu 提交于
      This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
      and exports the functions to be used by xHCI driver later.
      
      AMD PLL quirk disable the optional PM feature inside specific
      SB700/SB800/Hudson-2/3 platforms under the following conditions:
      
      1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
      2. Optional PM feature that powers down the internal Bus PLL when the link is
         in low power state is enabled.
      
      Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
      occasionally, which greatly impair the performance of audio/video streams.
      
      Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
      added to xHCI driver too. They are doing similar things actually, so move
      the quirk code to pci-quirks.c, which has several advantages:
      
      1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
         make them cleaner;
      2. AMD chipset information will be probed only once and then stored.
         Currently they're probed during every OHCI/EHCI initialization, move
         the detect code to pci-quirks.c saves the repeat detect cost;
      3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
         code, every host controller enable/disable PLL only according to
         its own status, and may enable PLL while there is still isoc transfer on
         other HCs. Move the quirk to pci-quirks.c prevents this issue.
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Alex He <alex.he@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad93562b
  18. 18 2月, 2011 1 次提交
  19. 05 2月, 2011 1 次提交
    • A
      USB host: Move AMD PLL quirk to pci-quirks.c · b7d5b439
      Andiry Xu 提交于
      This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
      and exports the functions to be used by xHCI driver later.
      
      AMD PLL quirk disable the optional PM feature inside specific
      SB700/SB800/Hudson-2/3 platforms under the following conditions:
      
      1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
      2. Optional PM feature that powers down the internal Bus PLL when the link is
         in low power state is enabled.
      
      Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
      occasionally, which greatly impair the performance of audio/video streams.
      
      Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
      added to xHCI driver too. They are doing similar things actually, so move
      the quirk code to pci-quirks.c, which has several advantages:
      
      1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
         make them cleaner;
      2. AMD chipset information will be probed only once and then stored.
         Currently they're probed during every OHCI/EHCI initialization, move
         the detect code to pci-quirks.c saves the repeat detect cost;
      3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
         code, every host controller enable/disable PLL only according to
         its own status, and may enable PLL while there is still isoc transfer on
         other HCs. Move the quirk to pci-quirks.c prevents this issue.
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Alex He <alex.he@amd.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b7d5b439
  20. 11 12月, 2010 1 次提交
    • A
      USB: EHCI: ASPM quirk of ISOC on AMD SB800 · 05570297
      Alex He 提交于
      When ASPM PM Feature is enabled on UMI link, devices that use ISOC stream of
      data transfer may be exposed to longer latency causing less than optimal per-
      formance of the device. The longer latencies are normal and are due to link
      wake time coming out of low power state which happens frequently to save
      power when the link is not active.
      The following code will make exception for certain features of ASPM to be by
      passed and keep the logic normal state only when the ISOC device is connected
      and active. This change will allow the device to run at optimal performance
      yet minimize the impact on overall power savings.
      Signed-off-by: NAlex He <alex.he@amd.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      05570297