1. 19 7月, 2014 3 次提交
    • A
      USB: OHCI: make URB completions single-threaded · cdb4dd15
      Alan Stern 提交于
      URBs for a particular endpoint should complete sequentially.  That is,
      we shouldn't call the completion handler for one URB until the handler
      for the previous URB has returned.
      
      When the OHCI watchdog routine is added, there will be two paths for
      completing URBs: interrupt handler and watchdog routine.  Their
      activities have to be synchronized so that completions don't occur in
      multiple threads concurrently.
      
      For that purpose, this patch creates an ohci_work() routine which will
      be responsible for calling process_done_list() and finish_unlinks(),
      the two routines that detect when an URB is complete.  Everything will
      funnel through ohci_work(), and it will be careful not to run in more
      than one thread at a time.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cdb4dd15
    • A
      USB: OHCI: redesign the TD done list · c6fcb85e
      Alan Stern 提交于
      This patch changes the way ohci-hcd handles the TD done list.  In
      addition to relying on the TD pointers stored by the controller
      hardware, we need to handle TDs that the hardware has forgotten about.
      
      This means the list has to exist even while the dl_done_list() routine
      isn't running.  That function essentially gets split in two:
      update_done_list() reads the TD pointers stored by the hardware and
      adds the TDs to the done list, and process_done_list() scans through
      the list to handle URB completions.  When we detect a TD that the
      hardware forgot about, we will be able to add it to the done list
      manually and then process it normally.
      
      Since the list is really a queue, and because there can be a lot of
      TDs, keep the existing singly linked implementation.  To insure that
      URBs are given back in order of submission, whenever a TD is added to
      the done list, all the preceding TDs for the same endpoint must be
      added as well (going back to the first one that isn't already on the
      done list).
      
      The done list manipulations must all be protected by the private
      lock.  The scope of the lock is expanded in preparation for the
      watchdog routine to be added in a later patch.
      
      We have to be more careful about giving back unlinked URBs.  Since TDs
      may be added to the done list by the watchdog routine and not in
      response to a controller interrupt, we have to check explicitly to
      make sure all the URB's TDs that were added to the done list have been
      processed before giving back the URB.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6fcb85e
    • A
      USB: OHCI: revert the ZF Micro orphan-TD quirk · 95d9a01d
      Alan Stern 提交于
      This patch reverts the important parts of commit 89a0fd18 (USB:
      OHCI handles more ZFMicro quirks), namely, the parts related to
      handling orphan TDs for interrupt endpoints.  A later patch in this
      series will introduce a more general mechanism that applies to all
      endpoint types and all controllers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95d9a01d
  2. 04 5月, 2014 1 次提交
    • A
      USB: OHCI: fix problem with global suspend on ATI controllers · c1db30a2
      Alan Stern 提交于
      Some OHCI controllers from ATI/AMD seem to have difficulty with
      "global" USB suspend, that is, suspending an entire USB bus without
      setting the suspend feature for each port connected to a device.  When
      we try to resume the child devices, the controller gives timeout
      errors on the unsuspended ports, requiring resets, and can even cause
      ohci-hcd to hang; see
      
      	http://marc.info/?l=linux-usb&m=139514332820398&w=2
      
      and the following messages.
      
      This patch fixes the problem by adding a new quirk flag to ohci-hcd.
      The flag causes the ohci_rh_suspend() routine to suspend each
      unsuspended, enabled port before suspending the root hub.  This
      effectively converts the "global" suspend to an ordinary root-hub
      suspend.  There is no need to unsuspend these ports when the root hub
      is resumed, because the child devices will be resumed anyway in the
      course of a normal system resume ("global" suspend is never used for
      runtime PM).
      
      This patch should be applied to all stable kernels which include
      commit 0aa2832d (USB: use "global suspend" for system sleep on
      USB-2 buses) or a backported version thereof.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NPeter Münster <pmlists@free.fr>
      Tested-by: NPeter Münster <pmlists@free.fr>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1db30a2
  3. 25 4月, 2014 1 次提交
  4. 04 12月, 2013 2 次提交
  5. 04 6月, 2013 1 次提交
  6. 30 5月, 2013 1 次提交
    • M
      USB: OHCI: prepare to make ohci-hcd a library module · 95e44d44
      Manjunath Goudar 提交于
      This patch prepares ohci-hcd for being split up into a core
      library and separate platform driver modules.  A generic
      ohci_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
      ohci_restart(),ohci_suspend() and ohci_resume() routines need
      to be EXPORTed for use by the drivers.
      
      Added ohci_setip(() and ohci_start() routine for to start the generic
      controller rather than each having its own idiosyncratic approach.
      This allow to clean duplicated code in most of SOC driver
      
      In V2:
       -ohci_hcd_init() ohci_run() and ohci_stop() are not made non-static.
       -Adds the ohci_setup() and ohci_start() routine.
      
      In V3:
       -purpose of ohci_setup() and ohci_start() function description written in the patch
        description.
       -ohci_init() are not made non-static but now called beginning of the ohci_restart().
       -ohci_run() signature change reverted back.
       -unrelated changes removed.
       -duplicate comment line removed.
       -inline ohci_suspend() and ohci_resume() is not needed so removed from ohci.h file.
      
      In V4:
       -ohci-init() EXPORTed because it is called by all bus glue modules.
       -ohci-setup() removed from 1/2 added into 2/2 patch.
      
      In V5:
       -Again ohci_setup() is added and EXPORTed because to replace the ohci_init() from
        all bus glues.
       -ohci_init() is not made non-static function.
      
      In V6:
        -ohci_init() call is removed from ohci_quirk_nec_worker(), because it is already called in ohci_restart().
      
      In V8:
        -ohci_hcd_init() is called by ohci_setup() to make generic ohci initialization in all ohci drivers.
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95e44d44
  7. 14 6月, 2012 1 次提交
  8. 13 2月, 2012 1 次提交
  9. 19 11月, 2011 2 次提交
    • A
      OHCI: final fix for NVIDIA problems (I hope) · c6187597
      Alan Stern 提交于
      Problems with NVIDIA's OHCI host controllers persist.  After looking
      carefully through the spec, I finally realized that when a controller
      is reset it then automatically goes into a SUSPEND state in which it
      is completely quiescent (no DMA and no IRQs) and from which it will
      not awaken until the system puts it into the OPERATIONAL state.
      
      Therefore there's no need to worry about controllers being in the
      RESET state for extended periods, or remaining in the OPERATIONAL
      state during system shutdown.  The proper action for device
      initialization is to put the controller into the RESET state (if it's
      not there already) and then to issue a software reset.  Similarly, the
      proper action for device shutdown is simply to do a software reset.
      
      This patch (as1499) implements such an approach.  It simplifies
      initialization and shutdown, and allows the NVIDIA shutdown-quirk code
      to be removed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NAndre "Osku" Schmidt <andre.osku.schmidt@googlemail.com>
      Tested-by: NArno Augustin <Arno.Augustin@web.de>
      Cc: stable <stable@vger.kernel.org> [after tested in 3.2 for a while]
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c6187597
    • A
      OHCI: remove uses of hcd->state · b7463c71
      Alan Stern 提交于
      This patch (as1500) removes all uses of the objectionable hcd->state
      variable from the ohci-hcd family of drivers.  It is replaced by a
      private ohci->rh_state field, just as in uhci-hcd and ehci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b7463c71
  10. 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
  11. 18 2月, 2011 1 次提交
  12. 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
  13. 25 1月, 2011 1 次提交
  14. 23 10月, 2010 1 次提交
    • A
      OHCI: work around for nVidia shutdown problem · 3df7169e
      Alan Stern 提交于
      This patch (as1417) fixes a problem affecting some (or all) nVidia
      chipsets.  When the computer is shut down, the OHCI controllers
      continue to power the USB buses and evidently they drive a Reset
      signal out all their ports.  This prevents attached devices from going
      to low power.  Mouse LEDs stay on, for example, which is disconcerting
      for users and a drain on laptop batteries.
      
      The fix involves leaving each OHCI controller in the OPERATIONAL state
      during system shutdown rather than putting it in the RESET state.
      Although this nominally means the controller is running, in fact it's
      not doing very much since all the schedules are all disabled.  However
      there is ongoing DMA to the Host Controller Communications Area, so
      the patch also disables the bus-master capability of all PCI USB
      controllers after the shutdown routine runs.
      
      The fix is applied only to nVidia-based PCI OHCI controllers, so it
      shouldn't cause problems on systems using other hardware.  As an added
      safety measure, in case the kernel encounters one of these running
      controllers during boot, the patch changes quirk_usb_handoff_ohci()
      (which runs early on during PCI discovery) to reset the controller
      before anything bad can happen.
      Reported-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      CC: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3df7169e
  15. 18 11月, 2009 1 次提交
  16. 18 10月, 2008 1 次提交
  17. 14 8月, 2008 3 次提交
  18. 02 2月, 2008 1 次提交
  19. 13 10月, 2007 2 次提交
    • V
      USB: add runtime frame_no quirk for big-endian OHCI · 4f45426c
      Valentine Barshak 提交于
      Add OHCI big endian frame_no quirk.  The frame_no value stored in the
      HCCA is a 16 bit field at a specific offset, but since not all CPUs can
      do 16-bit memory accesses it's used as a 32 bit field.  And that's why
      big-endian OHCI must shift 16 bits ... unless the spec is not followed.
      
      Currently there's one MPC52xx platform that doesn't need the shift. This
      patch adds a new "big endian frame_no" quirk to control that at runtime.
      Signed-off-by: NValentine Barshak <vbarshak@ru.mvista.com>
      Acked-by: NDale Farnsworth <dale@farnsworth.org>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f45426c
    • M
      USB: OHCI handles more ZFMicro quirks · 89a0fd18
      Mike Nuss 提交于
      The ZF Micro OHCI controller exhibits unexpected behavior that seems to be
      related to high load.  Under certain conditions, the controller will
      complete a TD, remove it from the endpoint's queue, and fail to add it to
      the donelist. This causes the endpoint to appear to stop responding. Worse,
      if the device is removed while in that state, OHCI will hang while waiting
      for the orphaned TD to complete.  The situation is not recoverable without
      rebooting.
      
      This fix enhances the scope of the existing OHCI_QUIRK_ZFMICRO flag:
      
       1. A watchdog routine periodically scans the OHCI structures to check
          for orphaned TDs. In these cases the TD is taken back from the
          controller and completed normally.
      
       2. If a device is removed while the endpoint is hung but before the
          watchdog catches the situation, any outstanding TDs are taken back
          from the controller in the 'sanitize' phase.
      
      The ohci-hcd driver used to print "INTR_SF lossage" in this situation;
      this changes it to the universally accurate "ED unlink timeout".  Other
      instances of this message presumably have different root causes.
      
      Both this Compaq quirk and a NEC quirk are now properly compiled out for
      non-PCI builds of this driver.
      Signed-off-by: NMike Nuss <mike@terascala.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      89a0fd18
  20. 13 7月, 2007 1 次提交
    • M
      USB: Fix NEC OHCI chip silicon bug · d576bb9f
      Michael Hanselmann 提交于
      This patch fixes a silicon bug in some NEC OHCI chips. The bug appears
      at random times and is very, very difficult to reproduce. Without the
      following patch, Linux would shut the chip and its associated devices
      down. In Apple PowerBooks this leads to an unusable keyboard and mouse
      (SSH still working). The idea of restarting the chip is taken from
      public Darwin code.
      Signed-off-by: NMichael Hanselmann <linux-kernel@hansmi.ch>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d576bb9f
  21. 10 2月, 2007 1 次提交
  22. 08 2月, 2007 2 次提交
  23. 21 12月, 2006 2 次提交
  24. 29 9月, 2006 1 次提交
  25. 28 9月, 2006 2 次提交
    • P
      USB: Dealias -110 code (more complete) · 38e2bfc9
      Pete Zaitcev 提交于
      The purpose of this patch is to split off the case when a device does
      not reply on the lower level (which is reported by HC hardware), and
      a case when the device accepted the request, but does not reply at
      upper level. This redefinition allows to diagnose issues easier,
      without asking the user if the -110 happened "immediately".
      
      The usbmon splits such cases already thanks to its timestamp, but
      it's not always available.
      
      I adjusted all drivers which I found affected (by searching for "urb").
      Out of tree drivers may suffer a little bit, but I do not expect much
      breakage. At worst they may print a few messages.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      38e2bfc9
    • A
      USB: Properly unregister reboot notifier in case of failure in ehci hcd · 64a21d02
      Aleksey Gorelov 提交于
      If some problem occurs during ehci startup, for instance, request_irq fails,
      echi hcd driver tries it best to cleanup, but fails to unregister reboot
      notifier, which in turn leads to crash on reboot/poweroff.
      
      The following patch resolves this problem by not using reboot notifiers
      anymore, but instead making ehci/ohci driver get its own shutdown method.  For
      PCI, it is done through pci glue, for everything else through platform driver
      glue.
      
      One downside: sa1111 does not use platform driver stuff, and does not have its
      own shutdown hook, so no 'shutdown' is called for it now.  I'm not sure if it
      is really necessary on that platform, though.
      Signed-off-by: NAleks Gorelov <dared1st@yahoo.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      64a21d02
  26. 29 10月, 2005 1 次提交
    • D
      [PATCH] OHCI PM updates · f197b2c5
      David Brownell 提交于
      This simplifies the OHCI root hub suspend logic:
      
       - Uses new usbcore root hub calls to make autosuspend work again:
      	* Uses a newish usbcore root hub wakeup mechanism,
      	  making requests to khubd not keventd.
      	* Uses an even newer sibling suspend hook.
      
       - Expect someone always made usbcore call ohci_hub_suspend() before bus
         glue fires; and that ohci_hub_resume() is only called after that bus
         glue ran.  Previously, only CONFIG_USB_SUSPEND promised those things.
         (Includes updates to PCI and OMAP bus glue.)
      
       - Handle a not-noticed-before special case during resume from one of
         the swsusp snapshots when using "usb-handoff":  the controller isn't
         left in RESET state.  (A bug to fix in the usb-handoff code...)
      
      Also cleans up a minor debug printk glitch, and switches an mdelay over
      to an msleep (how did that stick around for so long?).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/host/ohci-dbg.c  |    4 ----
       drivers/usb/host/ohci-hcd.c  |    2 +-
       drivers/usb/host/ohci-hub.c  |   42 ++++++++++++------------------------------
       drivers/usb/host/ohci-mem.c  |    1 -
       drivers/usb/host/ohci-omap.c |   36 ++++++++++++------------------------
       drivers/usb/host/ohci-pci.c  |   40 ++++++++--------------------------------
       drivers/usb/host/ohci.h      |    1 -
       7 files changed, 33 insertions(+), 93 deletions(-)
      f197b2c5
  27. 13 9月, 2005 1 次提交
  28. 28 6月, 2005 2 次提交
  29. 19 4月, 2005 1 次提交