1. 14 10月, 2015 1 次提交
    • P
      usb: misc: usbtest: add bulk queue test · 145f48c5
      Peter Chen 提交于
      The bulk queue tests are used to show 'best performance' for bulk
      transfer, we are often asked this question by users. The implementation
      is the same with iso test, that is queue request at interrupt completion,
      so we reuse the iso structures, and rename them as common one.
      
      It's result should be very close to IC simulation, in order
      to get that, the device side should also need to prepare enough
      queue.
      
      We have got the 'best performance' (IN: 41MB, OUT: 39MB) at i.mx platform
      (USB2, ARM Cortex A9, stream mode need to enable) with below command:
      
      Host side:
      modprobe usbtest
      ./testusb -a -t 27 -g 64 -s 16384
      ./testusb -a -t 28 -g 64 -s 16384
      Gadget side:
      modprobe g_zero loopdefault=1 qlen=64 buflen=16384
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      145f48c5
  2. 27 9月, 2015 4 次提交
  3. 19 8月, 2015 1 次提交
  4. 24 9月, 2014 1 次提交
  5. 30 8月, 2014 1 次提交
    • A
      usbtest: Add interrupt EP testcases · 457a0955
      Amit Virdi 提交于
      Two simple test cases for interrupt endpoints are added to the usbtest.c file.
      These are simple non-queued interrupt IN and interrupt OUT transfers. Currently,
      only gadget zero is capable of executing the interrupt EP test cases. However,
      extending the same to other gadgets is extremely simple and can be done
      on-demand.
      
      The two new tests added are
        - Test 25: To verify Interrupt OUT transfer
        - Test 26: To verify Interrupt IN transfer
      
      Since the default value of wMaxPacketSize is set as 1024, so interrupt
      IN transfers must be specified with the size parameter = multiple of
      1024. Otherwise the default value (512) in the usbtest application fails
      the transfer. See [RUN 4] for sample logs
      
      The application logs (usbtest) and corresponding kernel logs are as
      following:
      
      [Run 1]
      ./testusb -a -c 10 -s 2048 -t 26 -v 511
      usbtest 7-1:3.0: TEST 26: read 2048 bytes 10 times
      
      [Run 2]
      ./testusb -a -c 10 -s 1024 -t 25 -v 511
      usbtest 7-1:3.0: TEST 25: write 1024 bytes 10 times
      
      [Run 3]
      ./testusb -a -c 10 -s 1098 -t 25 -v 511
      usbtest 7-1:3.0: TEST 25: write 1098 bytes 10 times
      
      [Run 4 - Failure case scenario]
      ./testusb -a  -t 26
      unknown speed   /dev/bus/usb/007/004    0
      /dev/bus/usb/007/004 test 26 --> 75 (Value too large for defined data type)
      
      usbtest 7-1:3.0: TEST 26: read 512 bytes 1000 times
      usb 7-1: test26 failed, iterations left 999, status -75 (not 0)
      Signed-off-by: NAmit Virdi <amit.virdi@st.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      457a0955
  6. 18 6月, 2014 1 次提交
  7. 28 5月, 2014 2 次提交
    • H
      usb: usbtest: add pattern check on pipe in phase of unlink read · a7683eb3
      Huang Rui 提交于
      TEST 11 unlinks the URB read request for N times. When host and gadget
      both initialize pattern 1 (mod 63) data series to do IN transfer, the
      host side function should check the data buffer if it is as mod 63
      series, because the data packet which host receivced will follow
      pattern 1. So this patch adds this checking action.
      Signed-off-by: NHuang Rui <ray.huang@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7683eb3
    • H
      usb: usbtest: fix unlink write error with pattern 1 · e4d58f5d
      Huang Rui 提交于
      TEST 12 and TEST 24 unlinks the URB write request for N times. When
      host and gadget both initialize pattern 1 (mod 63) data series to
      transfer, the gadget side will complain the wrong data which is not
      expected.  Because in host side, usbtest doesn't fill the data buffer
      as mod 63 and this patch fixed it.
      
      [20285.488974] dwc3 dwc3.0.auto: ep1out-bulk: Transfer Not Ready
      [20285.489181] dwc3 dwc3.0.auto: ep1out-bulk: reason Transfer Not Active
      [20285.489423] dwc3 dwc3.0.auto: ep1out-bulk: req ffff8800aa6cb480 dma aeb50800 length 512 last
      [20285.489727] dwc3 dwc3.0.auto: ep1out-bulk: cmd 'Start Transfer' params 00000000 a9eaf000 00000000
      [20285.490055] dwc3 dwc3.0.auto: Command Complete --> 0
      [20285.490281] dwc3 dwc3.0.auto: ep1out-bulk: Transfer Not Ready
      [20285.490492] dwc3 dwc3.0.auto: ep1out-bulk: reason Transfer Active
      [20285.490713] dwc3 dwc3.0.auto: ep1out-bulk: endpoint busy
      [20285.490909] dwc3 dwc3.0.auto: ep1out-bulk: Transfer Complete
      [20285.491117] dwc3 dwc3.0.auto: request ffff8800aa6cb480 from ep1out-bulk completed 512/512 ===> 0
      [20285.491431] zero gadget: bad OUT byte, buf[1] = 0
      [20285.491605] dwc3 dwc3.0.auto: ep1out-bulk: cmd 'Set Stall' params 00000000 00000000 00000000
      [20285.491915] dwc3 dwc3.0.auto: Command Complete --> 0
      [20285.492099] dwc3 dwc3.0.auto: queing request ffff8800aa6cb480 to ep1out-bulk length 512
      [20285.492387] dwc3 dwc3.0.auto: ep1out-bulk: Transfer Not Ready
      [20285.492595] dwc3 dwc3.0.auto: ep1out-bulk: reason Transfer Not Active
      [20285.492830] dwc3 dwc3.0.auto: ep1out-bulk: req ffff8800aa6cb480 dma aeb51000 length 512 last
      [20285.493135] dwc3 dwc3.0.auto: ep1out-bulk: cmd 'Start Transfer' params 00000000 a9eaf000 00000000
      [20285.493465] dwc3 dwc3.0.auto: Command Complete --> 0
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHuang Rui <ray.huang@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e4d58f5d
  8. 19 12月, 2013 2 次提交
  9. 18 12月, 2013 1 次提交
    • S
      usbtest: Fix BOS control test for USB 2.01 devices. · 8cf43285
      Sarah Sharp 提交于
      Commit c952a8ba "usb: usbtest: add a
      test case to support bos for queue control" will cause USB 2.01 and USB
      2.10 devices with a BOS descriptor to fail case 15 of the control test.
      
      The Link PM errata (released in 2007, updated in 2011) says:
      
      "The value of the bcdUSB field in the standard USB 2.0 Device Descriptor
      is used to indicate that the device supports the request to read the BOS
      Descriptor (i.e.  GetDescriptor(BOS)). Devices that support the BOS
      descriptor must have a bcdUSB value of 0201H or larger."
      
      The current code says that non-SuperSpeed devices *must* return -EPIPE,
      as this comment shows:
      
                      /* sign of this variable means:
                       *  -: tested code must return this (negative) error code
                       *  +: tested code may return this (negative too) error code
                       */
                      int                     expected = 0;
      
      This means the test will fail with USB 2.01 and USB 2.10 devices that
      provide a BOS descriptor.  Change it to only require a stall response if
      the USB device bcdUSB is less than 2.01.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Acked-by: NHuang Rui <ray.huang@amd.com>
      8cf43285
  10. 09 12月, 2013 3 次提交
  11. 31 10月, 2013 3 次提交
  12. 30 10月, 2013 2 次提交
  13. 01 10月, 2013 1 次提交
  14. 26 9月, 2013 1 次提交
  15. 01 8月, 2013 1 次提交
  16. 31 1月, 2013 1 次提交
    • A
      USB: altsetting overrides for usbtest · d0b4652f
      Alan Stern 提交于
      The usbtest driver includes some rather simple-minded logic for
      selecting an altsetting to test.  It doesn't work well for the g_zero
      gadget, because it selects altsetting 0 (which doesn't have
      isochronous endpoints) rather than altsetting 1 (which does have them,
      if the gadget's hardware supports them).  This prevents usbtest's
      isochronous tests (15, 16, 22, and 23) from working with g_zero.
      
      Since g_zero is one of the most common gadget drivers used for USB
      testing, usbtest should do a better job of supporting it.  But since
      some programs may rely on the current scheme for selecting
      altsettings, I didn't want to change it.
      
      Instead, this patch (as1655) adds a module parameter to usbtest, which
      can be used to override the default altsetting.  Since usbtest is
      never used by normal users (most distributions probably don't even
      build it), the new module parameter won't inconvenience anybody.  In
      any case, it is entirely optional -- leaving it unset preserves the
      existing behavior.
      
      The patch also fixes a related bug in usbtest: After selecting an
      altsetting, the driver neglects to store its selection.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0b4652f
  17. 08 1月, 2013 1 次提交
  18. 22 11月, 2012 1 次提交
  19. 15 11月, 2012 1 次提交
  20. 02 5月, 2012 1 次提交
  21. 19 4月, 2012 1 次提交
  22. 18 4月, 2012 2 次提交
  23. 27 11月, 2011 1 次提交
  24. 18 9月, 2011 1 次提交
    • M
      usb: Provide usb_speed_string() function · e538dfda
      Michal Nazarewicz 提交于
      In a few places in the kernel, the code prints
      a human-readable USB device speed (eg. "high speed").
      This involves a switch statement sometimes wrapped
      around in ({ ... }) block leading to code repetition.
      
      To mitigate this issue, this commit introduces
      usb_speed_string() function, which returns
      a human-readable name of provided speed.
      
      It also changes a few places switch was used to use
      this new function.  This changes a bit the way the
      speed is printed in few instances at the same time
      standardising it.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e538dfda
  25. 24 8月, 2011 2 次提交
    • K
      USB: use usb_endpoint_maxp() instead of le16_to_cpu() · 29cc8897
      Kuninori Morimoto 提交于
      Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
      instead of le16_to_cpu(desc->wMaxPacketSize).
      This patch fix it up
      
      Cc: Armin Fuerst <fuerst@in.tum.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Johannes Erdfelt <johannes@erdfelt.com>
      Cc: Vojtech Pavlik <vojtech@suse.cz>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: David Kubicek <dave@awk.cz>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Brad Hards <bhards@bigpond.net.au>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: David Lopo <dlopo@chipidea.mips.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
      Cc: Xie Xiaobo <X.Xie@freescale.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Jiang Bo <tanya.jiang@freescale.com>
      Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
      Cc: Darius Augulis <augulis.darius@gmail.com>
      Cc: Xiaochen Shen <xiaochen.shen@intel.com>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Ben Dooks <ben@simtec.co.uk>
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Herbert Pötzl <herbert@13thfloor.at>
      Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
      Cc: Roman Weissgaerber <weissg@vienna.at>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: Florian Floe Echtler <echtler@fs.tum.de>
      Cc: Christian Lucht <lucht@codemercs.com>
      Cc: Juergen Stuber <starblue@sourceforge.net>
      Cc: Georges Toth <g.toth@e-biz.lu>
      Cc: Bill Ryder <bryder@sgi.com>
      Cc: Kuba Ober <kuba@mareimbrium.org>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      29cc8897
    • S
      USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers · 7c79d094
      Sebastian Andrzej Siewior 提交于
      Executing
      | testusb -a -c 1 -t 3 -v 421 -s 2048
      
      does not complete on the gadget side.
      g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which
      is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is
      done with sending data but the gadget waits for more.
      Since the protocol does not include transfer-length-field sending a
      terminating zero packet seems the only way out.
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7c79d094
  26. 11 5月, 2011 1 次提交
  27. 10 5月, 2011 1 次提交
  28. 03 5月, 2011 1 次提交
    • S
      usb/usbtest: fix test10 on superpseed · 67e7d64b
      Sebastian Andrzej Siewior 提交于
      dummy_hcd + g_zero:
      
      |./testusb -a -s 1024 -v 1024 -t 10
      | usbtest 2-1:3.0: subtest 14 error, status 0
      
      with patch:
        ./testusb -a -t 10
      |unknown speed   /proc/bus/usb/001/002
      | dummy_udc dummy_udc: disabled ep-a
      | dummy_udc dummy_udc: disabled ep-b
      | dummy_udc dummy_udc: enabled ep-a (ep1in-bulk) maxpacket 1024
      | dummy_udc dummy_udc: enabled ep-b (ep2out-bulk) maxpacket 1024
      | zero gadget: source/sink enabled
      | usbtest 1-1:3.0: TEST 10:  queue 32 control calls, 1000 times
      | dummy_hcd dummy_hcd: timer fired with no URBs pending?
      |/proc/bus/usb/001/002 test 10,    0.022370 secs
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      67e7d64b