<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/usb/misc/usbtest.c, branch v4.9.261</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.261</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.261'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-07-09T07:35:55Z</updated>
<entry>
<title>usb: usbtest: fix missing kfree(dev-&gt;buf) in usbtest_disconnect</title>
<updated>2020-07-09T07:35:55Z</updated>
<author>
<name>Zqiang</name>
<email>qiang.zhang@windriver.com</email>
</author>
<published>2020-06-12T03:52:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ea5c9091d62e9516819c7bcb7c09658bde85acc'/>
<id>urn:sha1:4ea5c9091d62e9516819c7bcb7c09658bde85acc</id>
<content type='text'>
[ Upstream commit 28ebeb8db77035e058a510ce9bd17c2b9a009dba ]

BUG: memory leak
unreferenced object 0xffff888055046e00 (size 256):
  comm "kworker/2:9", pid 2570, jiffies 4294942129 (age 1095.500s)
  hex dump (first 32 bytes):
    00 70 04 55 80 88 ff ff 18 bb 5a 81 ff ff ff ff  .p.U......Z.....
    f5 96 78 81 ff ff ff ff 37 de 8e 81 ff ff ff ff  ..x.....7.......
  backtrace:
    [&lt;00000000d121dccf&gt;] kmemleak_alloc_recursive
include/linux/kmemleak.h:43 [inline]
    [&lt;00000000d121dccf&gt;] slab_post_alloc_hook mm/slab.h:586 [inline]
    [&lt;00000000d121dccf&gt;] slab_alloc_node mm/slub.c:2786 [inline]
    [&lt;00000000d121dccf&gt;] slab_alloc mm/slub.c:2794 [inline]
    [&lt;00000000d121dccf&gt;] kmem_cache_alloc_trace+0x15e/0x2d0 mm/slub.c:2811
    [&lt;000000005c3c3381&gt;] kmalloc include/linux/slab.h:555 [inline]
    [&lt;000000005c3c3381&gt;] usbtest_probe+0x286/0x19d0
drivers/usb/misc/usbtest.c:2790
    [&lt;000000001cec6910&gt;] usb_probe_interface+0x2bd/0x870
drivers/usb/core/driver.c:361
    [&lt;000000007806c118&gt;] really_probe+0x48d/0x8f0 drivers/base/dd.c:551
    [&lt;00000000a3308c3e&gt;] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724
    [&lt;000000003ef66004&gt;] __device_attach_driver+0x1b6/0x240
drivers/base/dd.c:831
    [&lt;00000000eee53e97&gt;] bus_for_each_drv+0x14e/0x1e0 drivers/base/bus.c:431
    [&lt;00000000bb0648d0&gt;] __device_attach+0x1f9/0x350 drivers/base/dd.c:897
    [&lt;00000000838b324a&gt;] device_initial_probe+0x1a/0x20 drivers/base/dd.c:944
    [&lt;0000000030d501c1&gt;] bus_probe_device+0x1e1/0x280 drivers/base/bus.c:491
    [&lt;000000005bd7adef&gt;] device_add+0x131d/0x1c40 drivers/base/core.c:2504
    [&lt;00000000a0937814&gt;] usb_set_configuration+0xe84/0x1ab0
drivers/usb/core/message.c:2030
    [&lt;00000000e3934741&gt;] generic_probe+0x6a/0xe0 drivers/usb/core/generic.c:210
    [&lt;0000000098ade0f1&gt;] usb_probe_device+0x90/0xd0
drivers/usb/core/driver.c:266
    [&lt;000000007806c118&gt;] really_probe+0x48d/0x8f0 drivers/base/dd.c:551
    [&lt;00000000a3308c3e&gt;] driver_probe_device+0xfc/0x2a0 drivers/base/dd.c:724

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Kyungtae Kim &lt;kt0755@gmail.com&gt;
Signed-off-by: Zqiang &lt;qiang.zhang@windriver.com&gt;
Link: https://lore.kernel.org/r/20200612035210.20494-1-qiang.zhang@windriver.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: usbtest: fix NULL pointer dereference</title>
<updated>2017-11-18T10:22:24Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2017-09-29T14:54:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8cf061d919e2102d0de0379bafea6cce1405d786'/>
<id>urn:sha1:8cf061d919e2102d0de0379bafea6cce1405d786</id>
<content type='text'>
commit 7c80f9e4a588f1925b07134bb2e3689335f6c6d8 upstream.

If the usbtest driver encounters a device with an IN bulk endpoint but
no OUT bulk endpoint, it will try to dereference a NULL pointer
(out-&gt;desc.bEndpointAddress).  The problem can be solved by adding a
missing test.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Cc: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: misc: add missing continue in switch</title>
<updated>2017-05-20T12:28:35Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>garsilva@embeddedor.com</email>
</author>
<published>2017-04-04T03:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=af534bf9540e4684e95489f65eda1635932b8916'/>
<id>urn:sha1:af534bf9540e4684e95489f65eda1635932b8916</id>
<content type='text'>
commit 2c930e3d0aed1505e86e0928d323df5027817740 upstream.

Add missing continue in switch.

Addresses-Coverity-ID: 1248733
Signed-off-by: Gustavo A. R. Silva &lt;garsilva@embeddedor.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: misc: usbtest: add fix for driver hang</title>
<updated>2016-08-11T16:31:51Z</updated>
<author>
<name>Lu Baolu</name>
<email>baolu.lu@linux.intel.com</email>
</author>
<published>2016-08-11T02:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=539587511835ea12d8daa444cbed766cf2bc3612'/>
<id>urn:sha1:539587511835ea12d8daa444cbed766cf2bc3612</id>
<content type='text'>
In sg_timeout(), req-&gt;status is set to "-ETIMEDOUT" before calling
into usb_sg_cancel(). usb_sg_cancel() will do nothing and return
directly if req-&gt;status has been set to a non-zero value. This will
cause driver hang whenever transfer time out is triggered.

This patch fixes this issue. It could be backported to stable kernel
with version later than v3.15.

Cc: stable@vger.kernel.org # 3.15+
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Lu Baolu &lt;baolu.lu@linux.intel.com&gt;
Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: usbtest_do_ioctl may return positive integer</title>
<updated>2016-08-09T13:45:59Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2016-07-26T08:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=28324936f3d672bbf83472fece8f36a158a52276'/>
<id>urn:sha1:28324936f3d672bbf83472fece8f36a158a52276</id>
<content type='text'>
For case 14 and case 21, their correct return value is the number
of bytes transferred, so it is a positive integer. But in usbtest_ioctl,
it takes non-zero as false return value for usbtest_do_ioctl, so
it will treat the correct test as wrong test, then the time on
tests will be the minus value.

Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Fixes: 18fc4ebdc705 ("usb: misc: usbtest: Remove timeval usage")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: fix pattern tests for scatterlists.</title>
<updated>2016-05-03T21:32:07Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2016-05-02T08:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc'/>
<id>urn:sha1:cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc</id>
<content type='text'>
The current implemenentation restart the sent pattern for each entry in
the sg list. The receiving end expects a continuous pattern, and test
will fail unless scatterilst entries happen to be aligned with the
pattern

Fix this by calculating the pattern byte based on total sent size
instead of just the current sg entry.

Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Fixes: 8b5249019352 ("[PATCH] USB: usbtest: scatterlist OUT data pattern testing")
Cc: &lt;stable@vger.kernel.org&gt; # v2.6.18+
Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: fix error of urb allocation</title>
<updated>2016-04-28T19:35:36Z</updated>
<author>
<name>Chunfeng Yun</name>
<email>chunfeng.yun@mediatek.com</email>
</author>
<published>2016-04-28T03:42:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=26186e5f2c1a6d1c244a3052f02e46ae29d823f2'/>
<id>urn:sha1:26186e5f2c1a6d1c244a3052f02e46ae29d823f2</id>
<content type='text'>
urb allocation will fail when usbtest_alloc_urb() tries to
allocate zero length buffer, but it doesn't need it in fact,
so just skips buffer allocation in the case.

Signed-off-by: Chunfeng Yun &lt;chunfeng.yun@mediatek.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: Remove timeval usage</title>
<updated>2015-12-01T22:52:58Z</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2015-11-04T23:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=18fc4ebdc7057478497682047db5acfb25b35c49'/>
<id>urn:sha1:18fc4ebdc7057478497682047db5acfb25b35c49</id>
<content type='text'>
timeval is deprecated and not y2038 safe.  Its size also changes according
to 32 bit/ 64 bit compilation.  Replace it with 32 and 64 bit versions of
its individual fields, giving two ioctls with different code values.
The two ioctls are necessary to maintain the 32 bit and 64 bit userspace
compatibility with a 64/32 bit kernel.

Change unsigned to __u32 types for a definitive userspace interface.
This is in accordance with the psABI that the unsigned type is always
32 bits.

Also use motonic timer instead of real time to ensure positive delta
values.

Refactor usbtest_ioctl for readability to isolate the handling of the
testing timing measurement.

The official testusb userspace tool can be changed in a separate patch
to reflect the __u32 changes as well. It can use the usbtest_param_32
struct, since 32 bit seconds is long enough for test durations.

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: improve the description for error message</title>
<updated>2015-12-01T22:36:29Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-11-18T09:40:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c7c7806700e15ca9c48d880f8c65071f041cd890'/>
<id>urn:sha1:c7c7806700e15ca9c48d880f8c65071f041cd890</id>
<content type='text'>
Now the function of complicated_callback is not only used for iso
transfer, improve the error message to reflect it.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: add bulk queue test</title>
<updated>2015-10-13T18:19:49Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-10-13T07:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=145f48c518edb945ea5b689a1d21052597f9d64b'/>
<id>urn:sha1:145f48c518edb945ea5b689a1d21052597f9d64b</id>
<content type='text'>
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: Peter Chen &lt;peter.chen@freescale.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
