1. 17 7月, 2012 13 次提交
    • 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: remove PS3 status polling · 9671cd7a
      Alan Stern 提交于
      This patch (as1575) removes special code added for status polling of
      the EHCI controller in PS3 systems.  While the controller is running,
      the polling is now carried out by an hrtimer handler.  When the
      controller is suspending or stopping, we use the same polling routine
      as the old code -- but in neither case do we need to conclude that the
      controller has died if the polling goes on for too long.
      
      As a result the entire handshake_on_error_set_halt() routine is now
      unused, so it is removed from the driver.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9671cd7a
    • 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
    • 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
    • A
      USB: EHCI: initialize data before resetting hardware · 631fe9d9
      Alan Stern 提交于
      Currently, EHCI initialization turns off the controller (in case it
      was left running by the firmware) before setting up the ehci_hcd data
      structure.  This patch (as1565) reverses that order.
      
      Although it doesn't matter now, it will matter later on when future
      additions to ehci_halt() will want to acquire a spinlock that gets
      initialized by ehci_init().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      631fe9d9
  2. 10 7月, 2012 1 次提交
    • A
      EHCI: centralize controller initialization · 1a49e2ac
      Alan Stern 提交于
      This patch (as1564c) converts the EHCI platform drivers to use the
      central ehci_setup() routine for generic controller initialization
      rather than each having its own idiosyncratic approach.
      
      The major point of difficulty lies in ehci-pci's many vendor- and
      device-specific workarounds.  Some of them have to be applied before
      calling ehci_setup() and some after, which necessitates a fair amount
      of code motion.  The other platform drivers require much smaller
      changes.
      
      One point not addressed by the patch is whether ports should be
      powered on or off following initialization.  The different drivers
      appear to handle this pretty much at random.  In fact it shouldn't
      matter, because the hub driver turns on power to all ports when it
      binds to the root hub.  Straightening that out will be left for
      another day.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1a49e2ac
  3. 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
  4. 27 6月, 2012 1 次提交
  5. 14 6月, 2012 1 次提交
  6. 21 5月, 2012 1 次提交
  7. 20 5月, 2012 1 次提交
    • M
      USB: EHCI: fix command register configuration lost problem · 1c01f1d9
      Ming Lei 提交于
      The 3d9545cc(EHCI: maintain the
      ehci->command value properly) introducs one command register
      configuration lost problem by the below line in ehci_reset:
      
      	ehci->command = ehci_readl(ehci, &ehci->regs->command);
      
      After writting RESET into command register, it is restored to
      its default value per EHCI spec[1], so the previous configuration
      will be lost, and may introduce some problems reported recently:
      	- imx51 Babbage board detect usb hub failed[2], reported
      	by Richard Zhao.
      	- mouse and keyboard hangs in linux-next found by
      	Dan Carpenter and Greg-KH.
      
      So this patch just removes the line to fix these problems, and
      keep configurating command register consistent as before the commit
      3d9545cc(EHCI: maintain the ehci->command value properly).
      
      [1], 4.1 Host Controller Initialization of EHCI Specification 1.0
      [2], failed dmesg log:
      	usb 1-1: new high-speed USB device number 2 using mxc-ehci
      	hub 1-1:1.0: USB hub found
      	hub 1-1:1.0: 7 ports detected
      	mxc-ehci mxc-ehci.1: fatal error
      	mxc-ehci mxc-ehci.1: HC died; cleaning up
      	mxc-ehci mxc-ehci.1: force halt; handshake f5780344 00004000 00004000 -> -110
      	mxc-ehci mxc-ehci.1: HC died; cleaning up
      	usb 1-1: USB disconnect, device number 2
      Reported-by: NRichard Zhao <richard.zhao@freescale.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reported-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Chen Peter-B29397 <B29397@freescale.com>
      Acked-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>
      1c01f1d9
  8. 15 5月, 2012 1 次提交
  9. 12 5月, 2012 1 次提交
    • A
      usb: chipidea: add host role · eb70e5ab
      Alexander Shishkin 提交于
      This adds EHCI host support to the chipidea driver. We want it to be
      part of the hdrc driver and not a standalone (sub-)driver module, as
      the structure of ehci-hcd.c suggests, so for chipidea controller we
      hack it to not provide platform-related code, but only the ehci hcd.
      
      The ehci-platform driver won't work for us here too, because the
      controller uses the same registers for both device and host mode and
      also otg-related bits, so it's not really possible to put ehci registers
      into a separate resource.
      
      This is not a pretty solution, but the alternative is exporting symbols
      from the chipidea driver to a ehci-chipidea driver and doing all the
      module refcounting.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb70e5ab
  10. 24 4月, 2012 1 次提交
  11. 20 4月, 2012 1 次提交
  12. 19 4月, 2012 2 次提交
  13. 18 4月, 2012 1 次提交
    • A
      EHCI: fix criterion for resuming the root hub · dc75ce9d
      Alan Stern 提交于
      This patch (as1542) changes the criterion ehci-hcd uses to tell when
      it needs to resume the controller's root hub.  A resume is needed when
      a port status change is detected, obviously, but only if the root hub
      is currently suspended.
      
      Right now the driver tests whether the root hub is running, and that
      is not the correct test.  In particular, if the controller has died
      then the root hub should not be restarted.  In addition, some buggy
      hardware occasionally requires the root hub to be running and
      sending out SOF packets even while it is nominally supposed to be
      suspended.
      
      In the end, the test needs to be changed.  Rather than checking whether
      the root hub is currently running, the driver will now check whether
      the root hub is currently suspended.  This will yield the correct
      behavior in all cases.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Peter Chen <B29397@freescale.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc75ce9d
  14. 10 4月, 2012 1 次提交
  15. 29 3月, 2012 1 次提交
  16. 16 3月, 2012 2 次提交
  17. 25 2月, 2012 1 次提交
  18. 25 1月, 2012 1 次提交
  19. 13 1月, 2012 1 次提交
  20. 20 12月, 2011 1 次提交
  21. 10 12月, 2011 1 次提交
  22. 09 12月, 2011 2 次提交
    • G
      usb: Fix PS3 EHCI suspend · df7c1ca2
      Geoff Levand 提交于
      The EHCI USB controller of the Cell Super Companion Chip used in the PS3
      will stop the root hub after all root hub ports are suspended.  When in
      this condition the ehci-hcd handshake routine will return -ETIMEDOUT and
      the USB runtime suspend sequence will fail.  The STS_HLT bit will not be
      set, so inspection of the frame index is used to test for the condition.
      
      Add a new routine handshake_for_broken_root_hub() that is called after
      an unsuccessful -ETIMEDOUT handshake.  On PS3 handshake_for_broken_root_hub()
      will test for the condition, and if found will return success to allow the
      USB suspend to complete.  For all other platforms
      handshake_for_broken_root_hub() will return -ETIMEDOUT
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      df7c1ca2
    • G
      usb: Remove ehci_reset call from ehci_run · 876e0df9
      Geoff Levand 提交于
      Remove the ehci_reset() call done in the ehci_run() routine of the
      USB EHCI host controller driver and add an ehci_reset() call to the
      probe processing of all EHCI platform drivers that do not already call
      ehci_reset().
      
      The call to ehci_reset() from ehci_run() was problematic for several
      platform drivers, and unnecessary for others.  This change moves the
      decision to call ehci_reset() at driver startup to the platform
      driver code.
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      876e0df9
  23. 19 11月, 2011 1 次提交
  24. 25 10月, 2011 1 次提交
  25. 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