<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/usb/usbnet.c, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-06-30T13:05:05Z</updated>
<entry>
<title>usbnet: Stop RX Q on MTU change</title>
<updated>2016-06-30T13:05:05Z</updated>
<author>
<name>Soohoon Lee</name>
</author>
<published>2016-06-29T19:07:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=43daa96b166c3cf5ff30dfac0c5efa2620e4beab'/>
<id>urn:sha1:43daa96b166c3cf5ff30dfac0c5efa2620e4beab</id>
<content type='text'>
When MTU is changed unlink_urbs() flushes RX Q but mean while usbnet_bh()
can fill up the Q at the same time.
Depends on which HCD is down there unlink takes long time then the flush
never ends.

Signed-off-by: Soohoon Lee &lt;soohoon.lee@f5.com&gt;
Reviewed-by: Kimball Murray &lt;kmurray@f5.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>treewide: replace dev-&gt;trans_start update with helper</title>
<updated>2016-05-04T18:16:49Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2016-05-03T14:33:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=860e9538a9482bb84589f7d0718a7e6d0a944d58'/>
<id>urn:sha1:860e9538a9482bb84589f7d0718a7e6d0a944d58</id>
<content type='text'>
Replace all trans_start updates with netif_trans_update helper.
change was done via spatch:

struct net_device *d;
@@
- d-&gt;trans_start = jiffies
+ netif_trans_update(d)

Compile tested only.

Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-xtensa@linux-xtensa.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-rdma@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-can@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Acked-by: Mugunthan V N &lt;mugunthanvnm@ti.com&gt;
Acked-by: Antonio Quartulli &lt;a@unstable.cc&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: correct speed testing</title>
<updated>2016-05-03T19:49:34Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2016-05-02T11:06:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea0798423c60a1d34c75e5fedae009aee0a8de5f'/>
<id>urn:sha1:ea0798423c60a1d34c75e5fedae009aee0a8de5f</id>
<content type='text'>
Allow for SS+ USB

Signed-off-by: Oliver Neukum &lt;ONeukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: cleanup after bind() in probe()</title>
<updated>2016-03-07T16:40:16Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2016-03-07T10:31:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1666984c8625b3db19a9abc298931d35ab7bc64b'/>
<id>urn:sha1:1666984c8625b3db19a9abc298931d35ab7bc64b</id>
<content type='text'>
In case bind() works, but a later error forces bailing
in probe() in error cases work and a timer may be scheduled.
They must be killed. This fixes an error case related to
the double free reported in
http://www.spinics.net/lists/netdev/msg367669.html
and needs to go on top of Linus' fix to cdc-ncm.

Signed-off-by: Oliver Neukum &lt;ONeukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: allow mini-drivers to consume L2 headers</title>
<updated>2015-12-04T21:56:23Z</updated>
<author>
<name>Bjørn Mork</name>
</author>
<published>2015-12-03T18:24:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81e0ce79f2919dbd5f025894d29aa806af8695c7'/>
<id>urn:sha1:81e0ce79f2919dbd5f025894d29aa806af8695c7</id>
<content type='text'>
Assume the minidriver has taken care of all L2 header parsing
if it sets skb-&gt;protocol.  This allows the minidriver to
support non-ethernet L2 headers, and even operate without
any L2 header at all.

Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: remove ifdefed out call to dma_supported</title>
<updated>2015-11-11T00:32:11Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2015-11-10T22:45:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=704c16db0e055e9a2acd4a5353e92b1ae4408a90'/>
<id>urn:sha1:704c16db0e055e9a2acd4a5353e92b1ae4408a90</id>
<content type='text'>
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>CDC: common parser for extra headers</title>
<updated>2015-09-15T19:43:11Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2015-09-07T14:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c40a2c8817e42273a4627c48c884b805475a733f'/>
<id>urn:sha1:c40a2c8817e42273a4627c48c884b805475a733f</id>
<content type='text'>
CDC drivers all implement their own parser for the extra headers.
This patch fixes the code duplication introducing a single common
parser in usbnet.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: Fix a race between usbnet_stop() and the BH</title>
<updated>2015-09-08T20:17:43Z</updated>
<author>
<name>Eugene Shatokhin</name>
</author>
<published>2015-09-01T14:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fcb0bb6aab256288a4e0a8650d26e4096ec30319'/>
<id>urn:sha1:fcb0bb6aab256288a4e0a8650d26e4096ec30319</id>
<content type='text'>
The race may happen when a device (e.g. YOTA 4G LTE Modem) is
unplugged while the system is downloading a large file from the Net.

Hardware breakpoints and Kprobes with delays were used to confirm that
the race does actually happen.

The race is on skb_queue ('next' pointer) between usbnet_stop()
and rx_complete(), which, in turn, calls usbnet_bh().

Here is a part of the call stack with the code where the changes to the
queue happen. The line numbers are for the kernel 4.1.0:

*0 __skb_unlink (skbuff.h:1517)
    prev-&gt;next = next;
*1 defer_bh (usbnet.c:430)
    spin_lock_irqsave(&amp;list-&gt;lock, flags);
    old_state = entry-&gt;state;
    entry-&gt;state = state;
    __skb_unlink(skb, list);
    spin_unlock(&amp;list-&gt;lock);
    spin_lock(&amp;dev-&gt;done.lock);
    __skb_queue_tail(&amp;dev-&gt;done, skb);
    if (dev-&gt;done.qlen == 1)
        tasklet_schedule(&amp;dev-&gt;bh);
    spin_unlock_irqrestore(&amp;dev-&gt;done.lock, flags);
*2 rx_complete (usbnet.c:640)
    state = defer_bh(dev, skb, &amp;dev-&gt;rxq, state);

At the same time, the following code repeatedly checks if the queue is
empty and reads these values concurrently with the above changes:

*0  usbnet_terminate_urbs (usbnet.c:765)
    /* maybe wait for deletions to finish. */
    while (!skb_queue_empty(&amp;dev-&gt;rxq)
        &amp;&amp; !skb_queue_empty(&amp;dev-&gt;txq)
        &amp;&amp; !skb_queue_empty(&amp;dev-&gt;done)) {
            schedule_timeout(msecs_to_jiffies(UNLINK_TIMEOUT_MS));
            set_current_state(TASK_UNINTERRUPTIBLE);
            netif_dbg(dev, ifdown, dev-&gt;net,
                  "waited for %d urb completions\n", temp);
    }
*1  usbnet_stop (usbnet.c:806)
    if (!(info-&gt;flags &amp; FLAG_AVOID_UNLINK_URBS))
        usbnet_terminate_urbs(dev);

As a result, it is possible, for example, that the skb is removed from
dev-&gt;rxq by __skb_unlink() before the check
"!skb_queue_empty(&amp;dev-&gt;rxq)" in usbnet_terminate_urbs() is made. It is
also possible in this case that the skb is added to dev-&gt;done queue
after "!skb_queue_empty(&amp;dev-&gt;done)" is checked. So
usbnet_terminate_urbs() may stop waiting and return while dev-&gt;done
queue still has an item.

Locking in defer_bh() and usbnet_terminate_urbs() was revisited to avoid
this race.

Signed-off-by: Eugene Shatokhin &lt;eugene.shatokhin@rosalab.ru&gt;
Reviewed-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared</title>
<updated>2015-08-26T02:44:13Z</updated>
<author>
<name>Eugene Shatokhin</name>
</author>
<published>2015-08-24T20:13:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f50791ac1aca1ac1b0370d62397b43e9f831421a'/>
<id>urn:sha1:f50791ac1aca1ac1b0370d62397b43e9f831421a</id>
<content type='text'>
It is needed to check EVENT_NO_RUNTIME_PM bit of dev-&gt;flags in
usbnet_stop(), but its value should be read before it is cleared
when dev-&gt;flags is set to 0.

The problem was spotted and the fix was provided by
Oliver Neukum &lt;oneukum@suse.de&gt;.

Signed-off-by: Eugene Shatokhin &lt;eugene.shatokhin@rosalab.ru&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>usbnet: avoid integer overflow in start_xmit</title>
<updated>2015-05-09T20:46:18Z</updated>
<author>
<name>Jason A. Donenfeld</name>
</author>
<published>2015-05-06T13:09:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e4336a65ab6b45cbac10b8347c8f8951fec515d'/>
<id>urn:sha1:3e4336a65ab6b45cbac10b8347c8f8951fec515d</id>
<content type='text'>
transfer_buffer_length is of type u32. It's therefore wrong to assign it
to a signed integer. This patch avoids the overflow.

It's worth noting that entry-&gt;length here is a long; perhaps it would be
beneficial at somepoint to change this to be unsigned as well, if
nothing else relies on its signedness for error conditions or the like.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
