<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/usb/usbnet.h, branch v3.10.65</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.65</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.65'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-04-14T13:42:18Z</updated>
<entry>
<title>usbnet: include wait queue head in device structure</title>
<updated>2014-04-14T13:42:18Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.de</email>
</author>
<published>2014-03-26T13:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2d4cf3d6f36d88d30ce2186179fe2aa7e5c06c2e'/>
<id>urn:sha1:2d4cf3d6f36d88d30ce2186179fe2aa7e5c06c2e</id>
<content type='text'>
[ Upstream commit 14a0d635d18d0fb552dcc979d6d25106e6541f2e ]

This fixes a race which happens by freeing an object on the stack.
Quoting Julius:
&gt; The issue is
&gt; that it calls usbnet_terminate_urbs() before that, which temporarily
&gt; installs a waitqueue in dev-&gt;wait in order to be able to wait on the
&gt; tasklet to run and finish up some queues. The waiting itself looks
&gt; okay, but the access to 'dev-&gt;wait' is totally unprotected and can
&gt; race arbitrarily. I think in this case usbnet_bh() managed to succeed
&gt; it's dev-&gt;wait check just before usbnet_terminate_urbs() sets it back
&gt; to NULL. The latter then finishes and the waitqueue_t structure on its
&gt; stack gets overwritten by other functions halfway through the
&gt; wake_up() call in usbnet_bh().

The fix is to just not allocate the data structure on the stack.
As dev-&gt;wait is abused as a flag it also takes a runtime PM change
to fix this bug.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Reported-by: Grant Grundler &lt;grundler@google.com&gt;
Tested-by: Grant Grundler &lt;grundler@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbnet: allow status interrupt URB to always be active</title>
<updated>2013-05-08T20:13:29Z</updated>
<author>
<name>Dan Williams</name>
<email>dcbw@redhat.com</email>
</author>
<published>2013-05-06T11:29:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6eecdc5f95a393cb558503123eae9a9a6642e835'/>
<id>urn:sha1:6eecdc5f95a393cb558503123eae9a9a6642e835</id>
<content type='text'>
Some drivers (sierra_net) need the status interrupt URB
active even when the device is closed, because they receive
custom indications from firmware.  Add functions to refcount
the status interrupt URB submit/kill operation so that
sub-drivers and the generic driver don't fight over whether
the status interrupt URB is active or not.

A sub-driver can call usbnet_status_start() at any time, but
the URB is only submitted the first time the function is
called.  Likewise, when the sub-driver is done with the URB,
it calls usbnet_status_stop() but the URB is only killed when
all users have stopped it.  The URB is still killed and
re-submitted for suspend/resume, as before, with the same
refcount it had at suspend.

Signed-off-by: Dan Williams &lt;dcbw@redhat.com&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: handle link change</title>
<updated>2013-04-11T19:57:32Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-04-11T04:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4b49f58fff00e6e9b24eaa31d4c6324393d76b0a'/>
<id>urn:sha1:4b49f58fff00e6e9b24eaa31d4c6324393d76b0a</id>
<content type='text'>
The link change is detected via the interrupt pipe, and bulk
pipes are responsible for transfering packets, so it is reasonable
to stop bulk transfer after link is reported as off.

Two adavantages may be obtained with stopping bulk transfer
after link becomes off:

- USB bus bandwidth is saved(USB bus is shared bus except for
USB3.0), for example, lots of 'IN' token packets and 'NYET'
handshake packets is transfered on 2.0 bus.

- probabaly power might be saved for usb host controller since
cancelling bulk transfer may disable the asynchronous schedule of
host controller.

With this patch, when link becomes off, about ~10% performance
boost can be found on bulk transfer of anther usb device which
is attached to same bus with the usbnet device, see below
test on next-20130410:

- read from usb mass storage(Sandisk Extreme USB 3.0) on pandaboard
with below command after unplugging ethernet cable:

	dd if=/dev/sda iflag=direct of=/dev/null bs=1M count=800

- without the patch
1, 838860800 bytes (839 MB) copied, 36.2216 s, 23.2 MB/s
2, 838860800 bytes (839 MB) copied, 35.8368 s, 23.4 MB/s
3, 838860800 bytes (839 MB) copied, 35.823 s, 23.4 MB/s
4, 838860800 bytes (839 MB) copied, 35.937 s, 23.3 MB/s
5, 838860800 bytes (839 MB) copied, 35.7365 s, 23.5 MB/s
average: 23.6MB/s

- with the patch
1, 838860800 bytes (839 MB) copied, 32.3817 s, 25.9 MB/s
2, 838860800 bytes (839 MB) copied, 31.7389 s, 26.4 MB/s
3, 838860800 bytes (839 MB) copied, 32.438 s, 25.9 MB/s
4, 838860800 bytes (839 MB) copied, 32.5492 s, 25.8 MB/s
5, 838860800 bytes (839 MB) copied, 31.6178 s, 26.5 MB/s
average: 26.1MB/s

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: introduce usbnet_link_change API</title>
<updated>2013-04-11T19:57:16Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-04-11T04:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ac64995da872c8ae6f74a5556fdad565829985b0'/>
<id>urn:sha1:ac64995da872c8ae6f74a5556fdad565829985b0</id>
<content type='text'>
This patch introduces the API of usbnet_link_change, so that
usbnet can handle link change centrally, which may help to
implement killing traffic URBs for saving USB bus bandwidth
and host controller power.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: usb: fix regression from FLAG_NOARP code</title>
<updated>2013-02-08T06:49:49Z</updated>
<author>
<name>Lucas Stach</name>
<email>dev@lynxeye.de</email>
</author>
<published>2013-02-07T16:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9c79330d930b5774aed8eb323daebecedce2e245'/>
<id>urn:sha1:9c79330d930b5774aed8eb323daebecedce2e245</id>
<content type='text'>
In commit 6509141f9c2ba74df6cc72ec35cd1865276ae3a4 ("usbnet: add new
flag FLAG_NOARP for usb net devices"), the newly added flag NOARP was
using an already defined value, which broke drivers using flag
MULTI_PACKET.

Signed-off-by: Lucas Stach &lt;dev@lynxeye.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: usbnet: prevent buggy devices from killing us</title>
<updated>2013-01-30T22:35:44Z</updated>
<author>
<name>Bjørn Mork</name>
<email>bjorn@mork.no</email>
</author>
<published>2013-01-28T23:51:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=70c37bf97f2a91accba76080db69144f3b69f736'/>
<id>urn:sha1:70c37bf97f2a91accba76080db69144f3b69f736</id>
<content type='text'>
A device sending 0 length frames as fast as it can has been
observed killing the host system due to the resulting memory
pressure.

Temporarily disable RX skb allocation and URB submission when
the current error ratio is high, preventing us from trying to
allocate an infinite number of skbs.  Reenable as soon as we
are finished processing the done queue, allowing the device
to continue working after short error bursts.

Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: add new flag FLAG_NOARP for usb net devices</title>
<updated>2013-01-21T19:24:37Z</updated>
<author>
<name>Wei Shuai</name>
<email>cpuwolf@gmail.com</email>
</author>
<published>2013-01-21T06:00:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6509141f9c2ba74df6cc72ec35cd1865276ae3a4'/>
<id>urn:sha1:6509141f9c2ba74df6cc72ec35cd1865276ae3a4</id>
<content type='text'>
We do have some USB net devices, which cannot do ARP.
so we can introduce a new flag FLAG_NOARP, then client drivers
can easily handle this kind of devices

Signed-off-by: Wei Shuai &lt;cpuwolf@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: generic manage_power()</title>
<updated>2012-12-19T20:46:40Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2012-12-18T04:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2dd7c8cf29769f6b66f26b501db2364640c2c9d0'/>
<id>urn:sha1:2dd7c8cf29769f6b66f26b501db2364640c2c9d0</id>
<content type='text'>
Centralise common code for manage_power() in usbnet
by making a generic simple implementation

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: handle PM failure gracefully</title>
<updated>2012-12-19T20:46:40Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2012-12-18T04:45:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a1c088e01b71d90852b0df5a77cdae46bd0e0c05'/>
<id>urn:sha1:a1c088e01b71d90852b0df5a77cdae46bd0e0c05</id>
<content type='text'>
If a device fails to do remote wakeup, this is no reason
to abort an open totally. This patch just continues without
runtime PM.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: introduce usbnet_{read|write}_cmd_nopm</title>
<updated>2012-11-07T08:53:38Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2012-11-06T04:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0547fad2dd7ccaaf3c914ba49073fa37e4e241eb'/>
<id>urn:sha1:0547fad2dd7ccaaf3c914ba49073fa37e4e241eb</id>
<content type='text'>
This patch introduces the below two helpers to prepare for solving
the usbnet runtime PM problem, which may cause some network utilities
(ifconfig, ethtool,...) touch a suspended device.

	usbnet_read_cmd_nopm()
	usbnet_write_cmd_nopm()

The above two helpers should be called by usbnet resume/suspend
callback to avoid deadlock.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
