1. 14 6月, 2012 1 次提交
  2. 21 5月, 2012 1 次提交
  3. 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
  4. 15 5月, 2012 1 次提交
  5. 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
  6. 24 4月, 2012 1 次提交
  7. 20 4月, 2012 1 次提交
  8. 19 4月, 2012 2 次提交
  9. 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
  10. 10 4月, 2012 1 次提交
  11. 29 3月, 2012 1 次提交
  12. 16 3月, 2012 2 次提交
  13. 25 2月, 2012 1 次提交
  14. 25 1月, 2012 1 次提交
  15. 13 1月, 2012 1 次提交
  16. 20 12月, 2011 1 次提交
  17. 10 12月, 2011 1 次提交
  18. 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
  19. 19 11月, 2011 1 次提交
  20. 25 10月, 2011 1 次提交
  21. 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
  22. 27 9月, 2011 1 次提交
  23. 18 9月, 2011 1 次提交
  24. 23 8月, 2011 3 次提交
  25. 09 7月, 2011 3 次提交
    • 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
    • K
      USB: EHCI: Move sysfs related bits into ehci-sysfs.c · 4c67045b
      Kirill Smelkov 提交于
      The only sysfs attr implemented so far is "companion" from ehci-hub.c,
      but in the next patch we are going to add another sysfs file, so prior
      to that let's structure things and move already-in-there sysfs code to
      separate file.
      
      NOTE: All the code I'm moving into this new file was written by Alan
      Stern (in 57e06c11 "EHCI: force high-speed devices to run at full
      speed"; Jan 16 2007), that's why I'm putting
      
          Copyright (C) 2007 by Alan Stern
      
      there after explicit request from the author.
      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>
      4c67045b
  26. 16 6月, 2011 1 次提交
  27. 08 6月, 2011 1 次提交
  28. 20 5月, 2011 1 次提交
    • A
      USB: remove remaining usages of hcd->state from usbcore and fix regression · 69fff59d
      Alan Stern 提交于
      This patch (as1467) removes the last usages of hcd->state from
      usbcore.  We no longer check to see if an interrupt handler finds that
      a controller has died; instead we rely on host controller drivers to
      make an explicit call to usb_hc_died().
      
      This fixes a regression introduced by commit
      9b37596a (USB: move usbcore away from
      hcd->state).  It used to be that when a controller shared an IRQ with
      another device and an interrupt arrived while hcd->state was set to
      HC_STATE_HALT, the interrupt handler would be skipped.  The commit
      removed that test; as a result the current code doesn't skip calling
      the handler and ends up believing the controller has died, even though
      it's only temporarily stopped.  The solution is to ignore HC_STATE_HALT
      following the handler's return.
      
      As a consequence of this change, several of the host controller
      drivers need to be modified.  They can no longer implicitly rely on
      usbcore realizing that a controller has died because of hcd->state.
      The patch adds calls to usb_hc_died() in the appropriate places.
      
      The patch also changes a few of the interrupt handlers.  They don't
      expect to be called when hcd->state is equal to HC_STATE_HALT, even if
      the controller is still alive.  Early returns were added to avoid any
      confusion.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NManuel Lauss <manuel.lauss@googlemail.com>
      CC: Rodolfo Giometti <giometti@linux.it>
      CC: Olav Kongas <ok@artecdesign.ee>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      69fff59d
  29. 04 5月, 2011 2 次提交
  30. 14 4月, 2011 2 次提交
  31. 12 3月, 2011 1 次提交
    • B
      usb: host: Add EHCI driver for NVIDIA Tegra SoCs · 79ad3b5a
      Benoit Goby 提交于
      The Tegra 2 SoC has 3 EHCI compatible USB controllers. This patch adds
      the necessary glue to allow the ehci-hcd driver to work on Tegra 2
      SoCs.
      
      The platform data is used to configure board-specific phy settings and
      to configure the operating mode, as one of the ports may be used as a otg
      port. For additional power saving, the driver supports powering down the
      phy on bus suspend when it is used, for example, to connect an internal
      device that use an out-of-band remote wakeup mechanism (e.g. a gpio).
      Signed-off-by: NBenoit Goby <benoit@android.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      79ad3b5a