1. 08 Jul, 2011 8 commits
    • Alan Stern's avatar
      USB: EHCI: go back to using the system clock for QH unlinks · 004c1968
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@kernel.org>
      Tested-by: default avatarMatej Kenda <matejken@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      004c1968
    • Anisse Astier's avatar
      ehci: add pci quirk for Ordissimo and RM Slate 100 too · 0c42a4e8
      Anisse Astier authored
      Add another variant of the Pegatron tablet used by Ordissimo, and
      apparently RM Slate 100, to the list of models that should skip the
      negociation for the handoff of the EHCI controller.
      Signed-off-by: default avatarAnisse Astier <anisse@astier.eu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0c42a4e8
    • Anisse Astier's avatar
      ehci: refactor pci quirk to use standard dmi_check_system method · 03c75362
      Anisse Astier authored
      In commit 3610ea53 (ehci: workaround for pci
      quirk timeout on ExoPC), a workaround was added to skip the negociation for
      the handoff of the EHCI controller.
      
      Refactor the DMI detection code to use standard dmi_check_system function.
      Signed-off-by: default avatarAnisse Astier <anisse@astier.eu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      03c75362
    • Kirill Smelkov's avatar
      USB: EHCI: Allow users to override 80% max periodic bandwidth · cc62a7eb
      Kirill Smelkov authored
      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: default avatarKirill Smelkov <kirr@mns.spb.ru>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cc62a7eb
    • Kirill Smelkov's avatar
      USB: EHCI: Move sysfs related bits into ehci-sysfs.c · 4c67045b
      Kirill Smelkov authored
      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: default avatarKirill Smelkov <kirr@mns.spb.ru>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4c67045b
    • Chris Forbes's avatar
      drivers: usb: atm: ueagle-atm: Add missing const qualifier · 6f95b4b7
      Chris Forbes authored
      Added missing const qualifier as flagged by checkpatch.pl
      Signed-off-by: default avatarChris Forbes <chrisf@ijw.co.nz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6f95b4b7
    • Chris Forbes's avatar
      drivers: usb: atm: ueagle-atm: use __packed · 58607307
      Chris Forbes authored
      Replaced __attribute__ ((packed)) with __packed;
      Signed-off-by: default avatarChris Forbes <chrisf@ijw.co.nz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      58607307
    • Matthieu CASTET's avatar
  2. 01 Jul, 2011 32 commits