1. 05 12月, 2016 1 次提交
    • C
      fsl/usb: Workarourd for USB erratum-A005697 · 9d4b8270
      Changming Huang 提交于
      The EHCI specification states the following in the SUSP bit description:
      In the Suspend state, the port is sensitive to resume detection.
      Note that the bit status does not change until the port is suspended and
      that there may be a delay in suspending a port if there is a transaction
      currently in progress on the USB.
      
      However, in NXP USBDR controller, the PORTSCx[SUSP] bit changes immediately
      when the application sets it and not when the port is actually suspended.
      
      So the application must wait for at least 10 milliseconds after a port
      indicates that it is suspended, to make sure this port has entered
      suspended state before initiating this port resume using the Force Port
      Resume bit. This bit is for NXP controller, not EHCI compatible.
      Signed-off-by: NChangming Huang <jerry.huang@nxp.com>
      Signed-off-by: NRamneek Mehresh <ramneek.mehresh@nxp.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d4b8270
  2. 04 3月, 2016 1 次提交
  3. 04 2月, 2016 12 次提交
  4. 02 12月, 2015 1 次提交
    • A
      USB: EHCI: warn on unexpectedly active QH · fc0855f2
      Alan Stern 提交于
      This patch adds a new warning message to ehci-hcd.  The warning is
      triggered whenever the driver finds that the hardware has set the
      Active bit in a QH at a time when the driver expects the QH to be
      completely idle.  Such bugs have been observed by users in the past,
      and since they can lead to serious problems (such as inability to
      unlink an URB that never completes), it would be good to know about
      them when they occur.
      
      This won't fix these bugs; that's a bigger job for a later patch.  But
      success isn't guaranteed, since this depends on aspects of the
      hardware which are not documented in the EHCI spec or for which the
      spec's recommendations are clearly unworkable.  It therefore seems
      worthwhile to check for these bugs proactively.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NMichael Reutman <mreutman@epiqsolutions.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc0855f2
  5. 15 8月, 2015 1 次提交
  6. 31 5月, 2015 1 次提交
  7. 10 1月, 2015 1 次提交
  8. 04 11月, 2014 1 次提交
  9. 25 4月, 2014 1 次提交
  10. 14 1月, 2014 1 次提交
  11. 04 12月, 2013 1 次提交
  12. 15 10月, 2013 1 次提交
    • A
      USB: EHCI: create per-TT bandwidth tables · b35c5009
      Alan Stern 提交于
      This patch continues the scheduling changes in ehci-hcd by adding a
      table to store the bandwidth allocation below each TT.  This will
      speed up the scheduling code, as it will no longer need to read
      through the entire schedule to compute the bandwidth currently in use.
      
      Properly speaking, the FS/LS budget calculations should be done in
      terms of full-speed bytes per microframe, as described in the USB-2
      spec.  However the driver currently uses microseconds per microframe,
      and the scheduling code isn't robust enough at this point to change
      over.  For the time being, we leave the calculations as they are.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b35c5009
  13. 12 10月, 2013 3 次提交
    • A
      USB: EHCI: use a bandwidth-allocation table · d0ce5c6b
      Alan Stern 提交于
      This patch significantly changes the scheduling code in ehci-hcd.
      Instead of calculating the current bandwidth utilization by trudging
      through the schedule and adding up the times used by the existing
      transfers, we will now maintain a table holding the time used for each
      of 64 microframes.  This will drastically speed up the bandwidth
      computations.
      
      In addition, it eliminates a theoretical bug.  An isochronous endpoint
      may have bandwidth reserved even at times when it has no transfers
      listed in the schedule.  The table will keep track of the reserved
      bandwidth, whereas adding up entries in the schedule would miss it.
      
      As a corollary, we can keep bandwidth reserved for endpoints even
      when they aren't in active use.  Eventually the bandwidth will be
      reserved when a new alternate setting is installed; for now the
      endpoint's reservation takes place when its first URB is submitted.
      
      A drawback of this approach is that transfers with an interval larger
      than 64 microframes will have to be charged for bandwidth as though
      the interval was 64.  In practice this shouldn't matter much;
      transfers with longer intervals tend to be rather short anyway (things
      like hubs or HID devices).
      
      Another minor drawback is that we will keep track of two different
      period and phase values: the actual ones and the ones used for
      bandwidth allocation (which are limited to 64).  This adds only a
      small amount of overhead: 3 bytes for each endpoint.
      
      The patch also adds a new debugfs file named "bandwidth" to display
      the information stored in the new table.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0ce5c6b
    • A
      USB: EHCI: create a "periodic schedule info" struct · ffa0248e
      Alan Stern 提交于
      This patch begins the process of unifying the scheduling parameters
      that ehci-hcd uses for interrupt and isochronous transfers.  It
      creates an ehci_per_sched structure, which will be stored in both
      ehci_qh and ehci_iso_stream structures, and will contain the common
      scheduling information needed for both.
      
      Initially we merely create the new structure and move some existing
      fields into it.  Later patches will add more fields and utilize these
      structures in improved scheduling algorithms.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ffa0248e
    • A
      USB: EHCI: use consistent NO_FRAME value · 91a99b5e
      Alan Stern 提交于
      ehci-hcd is inconsistent in the sentinel values it uses to indicate
      that no frame number has been assigned for a periodic transfer.  Some
      places it uses NO_FRAME (defined as 65535), other places it uses -1,
      and elsewhere it uses 9999.
      
      This patch defines a value for NO_FRAME which can fit in a 16-bit
      signed integer, and changes the code to use it everywhere.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      91a99b5e
  14. 18 9月, 2013 1 次提交
    • A
      USB: EHCI: handle isochronous underruns with tasklets · 46c73d1d
      Alan Stern 提交于
      This patch updates the iso_stream_schedule() routine in ehci-sched.c
      to handle cases where an underrun causes an isochronous endpoint's
      queue to empty out, but the client driver wants to maintain
      synchronization with the device (i.e., the URB_ISO_ASAP flag is not
      set).  This could not happen until recently, when ehci-hcd switched
      over to completing URBs in a tasklet.
      
      (This may seem like an unlikely case to worry about, but underruns are
      all too common with the snd-usb-audio driver, which doesn't use
      URB_ISO_ASAP.)
      
      As part of the fix, some URBs may need to be given back when they are
      submitted.  This is necessary when the URB's scheduled slots all fall
      before the current value of ehci->last_iso_frame, and as an
      optimization we do it also when the slots all fall before the current
      frame number.
      
      As a second part of the fix, we may need to skip some but not all of
      an URB's packets.  This is necessary when some of the URB's scheduled
      slots fall before the current value of ehci->last_iso_frame and some
      of them fall after the current frame number.  A new field
      (first_packet) is added to struct ehci_iso_sched, to indicate how many
      packets should be skipped.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Ming Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46c73d1d
  15. 31 8月, 2013 2 次提交
  16. 13 8月, 2013 2 次提交
  17. 18 6月, 2013 1 次提交
  18. 04 4月, 2013 1 次提交
  19. 26 3月, 2013 3 次提交
    • A
      USB: EHCI: improve end_unlink_async() · 214ac7a0
      Alan Stern 提交于
      This patch (as1665) changes the way ehci-hcd's end_unlink_async()
      routine works in order to avoid recursive execution and to be more
      efficient:
      
      	Now when an IAA cycle ends, a new one gets started up right
      	away (if it is needed) instead of waiting until the
      	just-unlinked QH has been processed.
      
      	The async_iaa list is renamed to async_idle, which better
      	expresses its new purpose: It is now the list of QHs which are
      	now completely idle and are waiting to be processed by
      	end_unlink_async().
      
      	A new flag is added to track whether an IAA cycle is in
      	progress, because the list formerly known as async_iaa no
      	longer stores the QHs waiting for the IAA to finish.
      
      	The decision about how many QHs to process when an IAA cycle
      	ends is now made at the end of the cycle, when we know the
      	current state of the hardware, rather than at the beginning.
      	This means a bunch of logic got moved from start_iaa_cycle()
      	to end_unlink_async().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      214ac7a0
    • A
      USB: EHCI: convert singly-linked lists to list_heads · 6e018751
      Alan Stern 提交于
      This patch (as1664) converts ehci-hcd's async_unlink, async_iaa, and
      intr_unlink from singly-linked lists to standard doubly-linked
      list_heads.  Originally it didn't seem necessary to use list_heads,
      because items are always added to and removed from these lists in FIFO
      order.  But now with more list processing going on, it's easier to use
      the standard routines than continue with a roll-your-own approach.
      
      I don't know if the code ends up being notably shorter, but the
      patterns will be more familiar to any kernel hacker.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e018751
    • A
      USB: EHCI: split needs_rescan into two flags · 7bc782d7
      Alan Stern 提交于
      This patch (as1662) does some more QH-related cleanup in ehci-hcd.
      The qh->needs_rescan flag is currently used for two different
      purposes; the patch replaces it with two separate flags for greater
      clarity: qh->dequeue_during_giveback indicates that a completion
      handler dequeued an URB (implying that a rescan is needed), and
      qh->exception indicates that the QH is in an exceptional state
      requiring an unlink (either it encountered an I/O error or an unlink
      was requested).
      
      The new flags get set where the dequeue, exception, or unlink request
      occurred, rather than where the unlink is started.  This is so that in
      the future, if we need to, we will be able to tell apart unlinks that
      truly were required from those that were carried out merely because
      the QH wasn't being used.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7bc782d7
  20. 23 1月, 2013 2 次提交
  21. 12 11月, 2012 1 次提交
  22. 01 11月, 2012 1 次提交
    • 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