1. 15 11月, 2011 1 次提交
  2. 18 9月, 2011 3 次提交
  3. 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
  4. 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
  5. 09 7月, 2011 1 次提交
    • 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
  6. 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
  7. 14 4月, 2011 2 次提交
    • 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
    • A
      USB: EHCI: unlink unused QHs when the controller is stopped · 94ae4976
      Alan Stern 提交于
      This patch (as1458) fixes a problem affecting ultra-reliable systems:
      When hardware failover of an EHCI controller occurs, the data
      structures do not get released correctly.  This is because the routine
      responsible for removing unused QHs from the async schedule assumes
      the controller is running properly (the frame counter is used in
      determining how long the QH has been idle) -- but when a failover
      causes the controller to be electronically disconnected from the PCI
      bus, obviously it stops running.
      
      The solution is simple: Allow scan_async() to remove a QH from the
      async schedule if it has been idle for long enough _or_ if the
      controller is stopped.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-Tested-by: NDan Duval <dan.duval@stratus.com>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      94ae4976
  8. 24 3月, 2011 1 次提交
    • A
      ehci-hcd: Bug fix: don't set a QH's Halt bit · b5a3b3d9
      Alan Stern 提交于
      This patch (as1453) fixes a long-standing bug in the ehci-hcd driver.
      
      There is no need to set the Halt bit in the overlay region for an
      unlinked or blocked QH.  Contrary to what the comment says, setting
      the Halt bit does not cause the QH to be patched later; that decision
      (made in qh_refresh()) depends only on whether the QH is currently
      pointing to a valid qTD.  Likewise, setting the Halt bit does not
      prevent completions from activating the QH while it is "stopped"; they
      are prevented by the fact that qh_completions() temporarily changes
      qh->qh_state to QH_STATE_COMPLETING.
      
      On the other hand, there are circumstances in which the QH will be
      reactivated _without_ being patched; this happens after an URB beyond
      the head of the queue is unlinked.  Setting the Halt bit will then
      cause the hardware to see the QH with both the Active and Halt bits
      set, an invalid combination that will prevent the queue from
      advancing and may even crash some controllers.
      
      Apparently the only reason this hasn't been reported before is that
      unlinking URBs from the middle of a running queue is quite uncommon.
      However Test 17, recently added to the usbtest driver, does exactly
      this, and it confirms the presence of the bug.
      
      In short, there is no reason to set the Halt bit for an unlinked or
      blocked QH, and there is a very good reason not to set it.  Therefore
      the code that sets it is removed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NAndiry Xu <andiry.xu@amd.com>
      CC: David Brownell <david-b@pacbell.net>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b5a3b3d9
  9. 05 2月, 2011 1 次提交
  10. 11 8月, 2010 1 次提交
    • A
      USB: convert usb_hcd bitfields into atomic flags · 541c7d43
      Alan Stern 提交于
      This patch (as1393) converts several of the single-bit fields in
      struct usb_hcd to atomic flags.  This is for safety's sake; not all
      CPUs can update bitfield values atomically, and these flags are used
      in multiple contexts.
      
      The flag fields that are set only during registration or removal can
      remain as they are, since non-atomic accesses at those times will not
      cause any problems.
      
      (Strictly speaking, the authorized_default flag should become atomic
      as well.  I didn't bother with it because it gets changed only via
      sysfs.  It can be done later, if anyone wants.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      541c7d43
  11. 21 5月, 2010 1 次提交
  12. 21 1月, 2010 1 次提交
    • A
      USB: EHCI: fix handling of unusual interrupt intervals · 1b9a38bf
      Alan Stern 提交于
      This patch (as1320) fixes two problems related to interrupt-URB
      scheduling in ehci-hcd.
      
      	URBs with an interval of 2 or 4 microframes aren't handled.
      	For the time being, the patch reduces to interval to 1 uframe.
      
      	URBs are constrained to have an interval no larger than 1024
      	frames by usb_submit_urb().  But some EHCI controllers allow
      	use of a schedule as short as 256 frames; for these
      	controllers we may have to decrease the interval to the
      	actual schedule length.
      
      The second problem isn't very significant since few devices expose
      interrupt endpoints with an interval larger than 256 frames.  But the
      first problem is critical; it will prevent the kernel from working
      with devices having interrupt intervals of 2 or 4 uframes.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Tested-by: NGlynn Farrow <farrowg@sg.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1b9a38bf
  13. 12 12月, 2009 1 次提交
  14. 01 12月, 2009 1 次提交
    • A
      USB: EHCI: don't send Clear-TT-Buffer following a STALL · c2f6595f
      Alan Stern 提交于
      This patch (as1304) fixes a regression in ehci-hcd.  Evidently some
      hubs don't handle Clear-TT-Buffer requests correctly, so we should
      avoid sending them when they don't appear to be absolutely necessary.
      The reported symptom is that output on a downstream audio device cuts
      out because the hub stops relaying isochronous packets.
      
      The patch prevents Clear-TT-Buffer requests from being sent following
      a STALL handshake.  In theory a STALL indicates either that the
      downstream device sent a STALL or that no matching TT buffer could be
      found.  In either case, the transfer is completed and the TT buffer
      does not remain busy, so it doesn't need to be cleared.
      
      Also, the patch fixes a minor flaw in the code that actually sends the
      Clear-TT-Buffer requests.  Although the pipe direction isn't really
      used for control transfers, it should be a Send rather than a Receive.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NJavier Kohen <jkohen@users.sourceforge.net>
      CC: David Brownell <david-b@pacbell.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c2f6595f
  15. 23 9月, 2009 3 次提交
    • A
      USB: EHCI: change deschedule logic for interrupt QHs · a448c9d8
      Alan Stern 提交于
      This patch (as1281) changes the way ehci-hcd deschedules interrupt
      QHs, copying the approach used for async QHs.  The caller is no longer
      responsible for rescheduling the QH if its queue is non-empty; instead
      the reschedule is done directly by intr_deschedule(), after calling
      qh_completions().  This is exactly the same as how end_unlink_async()
      works.
      
      ehci_urb_dequeue() and intr_deschedule() now correctly handle the case
      where they are called while another interrupt URB for the same QH is
      being given back.  This was a surprisingly large blind spot.  And
      scan_periodic() now respects the new needs_rescan flag.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a448c9d8
    • A
      USB: EHCI: rescan the queue after an unlink · 3a44494e
      Alan Stern 提交于
      This patch (as1280) fixes an obscure bug in ehci-hcd's dequeuing logic
      for async URBs.  If a later URB is unlinked and the completion
      routine unlinks an earlier URB, then the earlier URB won't be given
      back in a timely manner because the endpoint queue isn't rescanned as
      it should be.
      
      Similar bugs occur if an endpoint is reset or a halt is cleared while
      a completion routine is running, because the subroutines don't test
      for the COMPLETING state.
      
      All these problems are solved by adding a new needs_rescan flag to the
      ehci_qh structure.  If the flag is set while scanning through an idle
      QH, the scan will be repeated.  If the QH isn't idle then an unlink
      cycle will be initiated, and the proper action will be taken when it
      becomes idle.
      
      Also, an unnecessary test is removed from qh_link_async(): That
      routine is never called if the QH's state isn't IDLE.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3a44494e
    • A
      USB: EHCI: split ehci_qh into hw and sw parts · 3807e26d
      Alek Du 提交于
      The ehci_qh structure merged hw and sw together which is not good:
      1. More and more items are being added into ehci_qh, the ehci_qh software
         part are unnecessary to be allocated in DMA qh_pool.
      2. If HCD has local SRAM, the sw part will consume it too, and it won't
         bring any benefit.
      3. For non-cache-coherence system, the entire ehci_qh is uncachable, actually
         we only need the hw part to be uncacheable. Spliting them will let the sw
         part to be cacheable.
      Signed-off-by: NAlek Du <alek.du@intel.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      CC: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3807e26d
  16. 08 8月, 2009 2 次提交
  17. 13 7月, 2009 4 次提交
    • A
      USB: EHCI: check for STALL before other errors · ba516de3
      Alan Stern 提交于
      This patch (as1257) revises the way ehci-hcd detects STALLs.  The
      logic is a little peculiar because there's no hardware status bit
      specifically meant to indicate a STALL.  You just have to guess that a
      STALL was received if the BABBLE bit (which is fatal) isn't set and
      the transfer stopped before all its retries were used up.
      
      The existing code doesn't do this properly, because it tests for MMF
      (Missed MicroFrame) and DBE (Data Buffer Error) before testing the
      retry counter.  Thus, if a transaction gets either MMF or DBE the
      corresponding flag is set and the transaction is retried.  If the
      second attempt receives a STALL then -EPIPE is the correct return
      value.  But the existing code would see the MMF or DBE flag instead
      and return -EPROTO, -ENOSR, or -ECOMM.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ba516de3
    • A
      USB: EHCI: use the new clear_tt_buffer interface · 914b7012
      Alan Stern 提交于
      This patch (as1256) changes ehci-hcd and all the other drivers in the
      EHCI family to make use of the new clear_tt_buffer callbacks.  When a
      Clear-TT-Buffer request is in progress for a QH, the QH is not allowed
      to be linked into the async schedule until the request is finished.
      At that time, if there are any URBs queued for the QH, it is linked
      into the async schedule.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      914b7012
    • A
      USB: fix the clear_tt_buffer interface · cb88a1b8
      Alan Stern 提交于
      This patch (as1255) updates the interface for calling
      usb_hub_clear_tt_buffer().  Even the name of the function is changed!
      
      When an async URB (i.e., Control or Bulk) going through a high-speed
      hub to a non-high-speed device is cancelled or fails, the hub's
      Transaction Translator buffer may be left busy still trying to
      complete the transaction.  The buffer has to be cleared; that's what
      usb_hub_clear_tt_buffer() does.
      
      It isn't safe to send any more URBs to the same endpoint until the TT
      buffer is fully clear.  Therefore the HCD needs to be told when the
      Clear-TT-Buffer request has finished.  This patch adds a callback
      method to struct hc_driver for that purpose, and makes the hub driver
      invoke the callback at the proper time.
      
      The patch also changes a couple of names; "hub_tt_kevent" and
      "tt.kevent" now look rather antiquated.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cb88a1b8
    • A
      USB: EHCI: update toggle state for linked QHs · a455212d
      Alan Stern 提交于
      This is an update to the "usb-ehci-update-toggle-state-for-linked-qhs"
      patch.  Since an HCD's endpoint_reset method can be called in
      interrupt context, it mustn't assume that interrupts are enabled or
      that it can sleep.
      
      So we revert to the original way of refreshing QHs' toggle bits.  Now
      the endpoint_reset method merely clears the toggle flag in the device
      structure (as was done before) and starts an async QH unlink.  When the
      QH is linked again, after the unlink finishes and an URB is queued,
      the qh_refresh() routine will update the QH's toggle bit.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NDavid <david@unsolicited.net>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      a455212d
  18. 16 6月, 2009 1 次提交
    • A
      USB: EHCI: update toggle state for linked QHs · b18ffd49
      Alan Stern 提交于
      This patch (as1245) fixes a bug in ehci-hcd.  When an URB is queued
      for an endpoint whose QH is already in the LINKED state, the QH
      doesn't get refreshed.  As a result, if usb_clear_halt() was called
      during the time that the QH was linked but idle, the data toggle value
      in the QH doesn't get reset.
      
      The symptom is that after a clear_halt, data gets lost and transfers
      time out.  This problem is starting to show up now because the
      "ehci-hcd unlink speedups" patch causes QHs with no queued URBs to
      remain linked for a suitable time.
      
      The patch utilizes the new endpoint_reset mechanism to fix the
      problem.  When an endpoint is reset, the new method forcibly unlinks
      the QH (if necessary) and safely updates the toggle value.  This
      allows qh_update() to be simplified and avoids using usb_device's
      toggle bits in a rather unintuitive way.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Tested-by: NDavid <david@unsolicited.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b18ffd49
  19. 25 3月, 2009 2 次提交
    • R
      USB: fix ehci printk formats · d0626808
      Randy Dunlap 提交于
      Fix ehci printk formats:
      
      drivers/usb/host/ehci-q.c:351: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
      drivers/usb/host/ehci-q.c:351: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d0626808
    • A
      USB: EHCI: add software retry for transaction errors · a2c2706e
      Alan Stern 提交于
      This patch (as1204) adds a software retry mechanism to ehci-hcd.  It
      gets invoked when the driver encounters transaction errors on an
      asynchronous endpoint.  On many systems, hardware deficiencies cause
      such errors to occur if one device is unplugged while the host is
      communicating with another device.  With the patch, the failed
      transactions are retried and generally succeed the second or third
      time through.
      
      This is based on code originally written by Koichiro Saito.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested by: Koichiro Saito <Saito.Koichiro@adniss.jp>
      CC: David Brownell <david-b@pacbell.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a2c2706e
  20. 18 3月, 2009 1 次提交
  21. 07 8月, 2008 1 次提交
  22. 22 7月, 2008 1 次提交
    • D
      USB: ehci-hcd unlink speedups · b9638011
      David Brownell 提交于
      This patch fixes some performance bugs observed with some workloads
      when unlinking EHCI queue header (QH) descriptors from the async ring
      (control/bulk schedule).
      
      The mechanism intended to defer unlinking an empty QH (so there is no
      penalty in common cases where it's quickly reused) was not working as
      intended.  Sometimes the unlink was scheduled:
      
       - too quickly ... which can be a *strong* negative effect, since
         that QH becomes unavailable for immediate re-use;
      
       - too slowly ... wasting DMA cycles, usually a minor issue except
         for increased bus contention and power usage;
      
      Plus there was an extreme case of "too slowly":  a logical error in the
      IAA watchdog-timer conversion meant that sometimes the unlink never
      got scheduled.
      
      The fix replaces a simple counter with a timestamp derived from the
      controller's 8 KHz microframe counter, and adjusts the timer usage
      for some issues associated with HZ being less than 8K.
      
      (Based on a patch originally by Alan Stern, and good troubleshooting
      from  Leonid.)
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Leonid <leonidv11@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b9638011
  23. 30 5月, 2008 2 次提交
    • G
      Revert "USB: EHCI: fix performance regression" · bb7e6984
      Greg Kroah-Hartman 提交于
      This reverts commit fa38dfcc.
      
      It wasn't really a regression and David and Alan are still working
      through the issues reported.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bb7e6984
    • A
      USB: EHCI: fix performance regression · fa38dfcc
      Alan Stern 提交于
      This patch (as1099) fixes a performance regression in ehci-hcd.  The
      fundamental problem is that queue headers get removed from the
      schedule too quickly, since the code checks for a counter advancing
      rather than making an actual time-based check.  The latency involved
      in removing the queue header and then relinking it can severely
      degrade certain kinds of workloads.
      
      The patch replaces a simple counter with a timestamp derived from the
      controller's uframe value.  In addition, the delay for unlinking an
      idle queue header is increased from 5 ms to 10 ms; since some
      controllers (nVidia) have a latency of up to 1 ms for unlinking, this
      reduces the relative impact from 20% to 10%.
      
      Finally, a logical error left over from the IAA watchdog-timer
      conversion is corrected.  Now the driver will always either unlink an
      idle queue header or set up a timer to unlink it later.  The old code
      would sometimes fail to do either.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Leonid <leonidv11@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fa38dfcc
  24. 29 4月, 2008 1 次提交
  25. 25 4月, 2008 4 次提交
    • H
      USB: replace remaining __FUNCTION__ occurrences · 441b62c1
      Harvey Harrison 提交于
      __FUNCTION__ is gcc-specific, use __func__
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      441b62c1
    • D
      USB: ehci: qh_completions cleanup and bugfix · 4f667627
      David Brownell 提交于
      Simplify processing of completed qtds, and correct handling of short
      reads, by removing two state variables:
      
       - "qtd_status" wasn't needed.  The current URB's status is either
         OK (-EINPROGRESS) or some fault status.  Once a fault appears,
         the queue halts and any later QTDs are immediately removed, so
         no temporary status is needed.  (Or for typical short reads,
         it's not treated as a fault, so no queue halt is needed.)
      
       - "do_status" was erroneous.  Because of how the queue is set up,
         short control reads can (and should!) be treated like full size
         reads, and cleaned up the usual way.  The status stage will be
         executed transparently, and usbcore handles the choice of whether
         to report this status as unexected.
       
      The "do_status" problem caused a rather perplexing timing-dependent
      problem with usbtest case 10.  Sometimes it would make the controller
      skip a dozen transactions while (wrongly) trying to clean up after a
      short transfer.  Fortunately, removing a dcache contention issue made
      this become trivial to reproduce (on one test rig), so enough clues
      finally presented themselves ... I think this has been around for a
      very long time, but was worsened by recent urb->status changes.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f667627
    • D
      USB: ehci: qh/qtd cleanup comments · a082b5c7
      David Brownell 提交于
      Provide better comments about qh_completions() and QTD handling.
      That code can be *VERY* confusing, since it's evolved over a few
      years to cope with both hardware races and silicon quirks.
      
      Remove two unlikely() annotations that match the GCC defaults
      (and are thus pointless); add an "else" to highlight code flow.
      
      This patch doesn't change driver behavior.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a082b5c7
    • D
      USB: ehci tolerates some buggy devices · caa9ef67
      David Brownell 提交于
      This teaches EHCI how to to work around bugs in certain high speed
      devices, by accomodating "bulk" packets that exceed the 512 byte
      constant value required by the USB 2.0 specification.  (Have a
      look at section 5.8.3, paragraphs 1 and 3.)
      
      It also makes the descriptor parsing code warn when it encounters
      such bugs.  (We've had reports of maybe two or three such devices,
      all pretty recent.)
      
      Such devices are nonconformant.  The proper fix is have the vendors
      of those devices do the simple, obvious, and correct thing ... which
      will let them be used with USB hosts that don't have workarounds for
      this particular vendor bug.  But unless/until they do, we can at least
      have one of the high speed HCDs work with such buggy devices.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      caa9ef67
  26. 05 3月, 2008 1 次提交