<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/usb/asix_common.c, branch v4.9.331</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-09-12T09:47:39+00:00</updated>
<entry>
<title>net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()</title>
<updated>2020-09-12T09:47:39+00:00</updated>
<author>
<name>Himadri Pandya</name>
<email>himadrispandya@gmail.com</email>
</author>
<published>2020-08-27T06:53:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=968ec616e7074b379954e7d93fc22a6ecb631e37'/>
<id>urn:sha1:968ec616e7074b379954e7d93fc22a6ecb631e37</id>
<content type='text'>
commit a092b7233f0e000cc6f2c71a49e2ecc6f917a5fc upstream.

The buffer size is 2 Bytes and we expect to receive the same amount of
data. But sometimes we receive less data and run into uninit-was-stored
issue upon read. Hence modify the error check on the return value to match
with the buffer size as a prevention.

Reported-and-tested by: syzbot+a7e220df5a81d1ab400e@syzkaller.appspotmail.com
Signed-off-by: Himadri Pandya &lt;himadrispandya@gmail.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>asix: Check for supported Wake-on-LAN modes</title>
<updated>2018-11-10T15:42:43+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2018-09-28T23:18:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0da7461884057f8876cf4bd448415af6ebaf7e97'/>
<id>urn:sha1:0da7461884057f8876cf4bd448415af6ebaf7e97</id>
<content type='text'>
[ Upstream commit c4ce446e33d7a0e978256ac6fea4c80e59d9de5f ]

The driver currently silently accepts unsupported Wake-on-LAN modes
(other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user,
which is confusing.

Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: asix: Avoid looping when the device does not respond</title>
<updated>2016-10-14T20:06:54+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-10-13T23:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=610df1d2342d639ec87a8fb5290ca4799d91d59b'/>
<id>urn:sha1:610df1d2342d639ec87a8fb5290ca4799d91d59b</id>
<content type='text'>
Check answers from USB stack and avoid re-sending the request
multiple times if the device does not respond.

This fixes the following problem, observed with a probably flaky adapter.

[62108.732707] usb 1-3: new high-speed USB device number 5 using xhci_hcd
[62108.914421] usb 1-3: New USB device found, idVendor=0b95, idProduct=7720
[62108.914463] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[62108.914476] usb 1-3: Product: AX88x72A
[62108.914486] usb 1-3: Manufacturer: ASIX Elec. Corp.
[62108.914495] usb 1-3: SerialNumber: 000001
[62114.109109] asix 1-3:1.0 (unnamed net_device) (uninitialized):
	Failed to write reg index 0x0000: -110
[62114.109139] asix 1-3:1.0 (unnamed net_device) (uninitialized):
	Failed to send software reset: ffffff92
[62119.109048] asix 1-3:1.0 (unnamed net_device) (uninitialized):
	Failed to write reg index 0x0000: -110
...

Since the USB timeout is 5 seconds, and the operation is retried 30 times,
this results in

[62278.180353] INFO: task mtpd:1725 blocked for more than 120 seconds.
[62278.180373]       Tainted: G        W      3.18.0-13298-g94ace9e #1
[62278.180383] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
...
[62278.180957] kworker/2:0     D 0000000000000000     0  5744      2 0x00000000
[62278.180978] Workqueue: usb_hub_wq hub_event
[62278.181029]  ffff880177f833b8 0000000000000046 ffff88017fd00000 ffff88017b126d80
[62278.181048]  ffff880177f83fd8 ffff880065a71b60 0000000000013340 ffff880065a71b60
[62278.181065]  0000000000000286 0000000103b1c199 0000000000001388 0000000000000002
[62278.181081] Call Trace:
[62278.181092]  [&lt;ffffffff8e0971fd&gt;] ? console_conditional_schedule+0x2c/0x2c
[62278.181105]  [&lt;ffffffff8e094f7b&gt;] schedule+0x69/0x6b
[62278.181117]  [&lt;ffffffff8e0972e0&gt;] schedule_timeout+0xe3/0x11d
[62278.181133]  [&lt;ffffffff8daadb1b&gt;] ? trace_timer_start+0x51/0x51
[62278.181146]  [&lt;ffffffff8e095a05&gt;] do_wait_for_common+0x12f/0x16c
[62278.181162]  [&lt;ffffffff8da856a7&gt;] ? wake_up_process+0x39/0x39
[62278.181174]  [&lt;ffffffff8e095aee&gt;] wait_for_common+0x52/0x6d
[62278.181187]  [&lt;ffffffff8e095b3b&gt;] wait_for_completion_timeout+0x13/0x15
[62278.181201]  [&lt;ffffffff8de676ce&gt;] usb_start_wait_urb+0x93/0xf1
[62278.181214]  [&lt;ffffffff8de6780d&gt;] usb_control_msg+0xe1/0x11d
[62278.181230]  [&lt;ffffffffc037d629&gt;] usbnet_write_cmd+0x9c/0xc6 [usbnet]
[62278.181286]  [&lt;ffffffffc03af793&gt;] asix_write_cmd+0x4e/0x7e [asix]
[62278.181300]  [&lt;ffffffffc03afb41&gt;] asix_set_sw_mii+0x25/0x4e [asix]
[62278.181314]  [&lt;ffffffffc03b001d&gt;] asix_mdio_read+0x51/0x109 [asix]
...

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: asix: Avoid looping when the device is disconnected</title>
<updated>2016-09-01T04:07:05+00:00</updated>
<author>
<name>Robert Foss</name>
<email>robert.foss@collabora.com</email>
</author>
<published>2016-08-29T13:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a46f665833a2085e402bd0827be380f161f09ef'/>
<id>urn:sha1:8a46f665833a2085e402bd0827be380f161f09ef</id>
<content type='text'>
From: Vincent Palatin &lt;vpalatin@chromium.org&gt;

Check the answers from the USB stack and avoid re-sending multiple times
the request if the device has disappeared.

Signed-off-by: Vincent Palatin &lt;vpalatin@chromium.org&gt;
Signed-off-by: Robert Foss &lt;robert.foss@collabora.com&gt;
Tested-by: Robert Foss &lt;robert.foss@collabora.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: asix: Add in_pm parameter</title>
<updated>2016-09-01T04:07:05+00:00</updated>
<author>
<name>Robert Foss</name>
<email>robert.foss@collabora.com</email>
</author>
<published>2016-08-29T13:32:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d9fe64e511144c1ee7d7555b4111f09dde9692ef'/>
<id>urn:sha1:d9fe64e511144c1ee7d7555b4111f09dde9692ef</id>
<content type='text'>
From: Freddy Xin &lt;freddy@asix.com.tw&gt;

In order to R/W registers in suspend/resume functions, in_pm flags are
added to some functions to determine whether the nopm version of usb
functions is called.

Save BMCR and ANAR PHY registers in suspend function and restore them
in resume function.

Reset HW in resume function to ensure the PHY works correctly.

Signed-off-by: Freddy Xin &lt;freddy@asix.com.tw&gt;
Signed-off-by: Robert Foss &lt;robert.foss@collabora.com&gt;
Tested-by: Robert Foss &lt;robert.foss@collabora.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions</title>
<updated>2016-05-17T18:02:33+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2016-05-17T03:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cd9e2e5d3ff148be9ea210f622ce3e8e8292fcd6'/>
<id>urn:sha1:cd9e2e5d3ff148be9ea210f622ce3e8e8292fcd6</id>
<content type='text'>
In testing with HiKey, we found that since
commit 3f30b158eba5 ("asix: On RX avoid creating bad Ethernet
frames"),
we're seeing lots of noise during network transfers:

[  239.027993] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
[  239.037310] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x54ebb5ec, offset 4
[  239.045519] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0xcdffe7a2, offset 4
[  239.275044] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
[  239.284355] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x1d36f59d, offset 4
[  239.292541] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0xaef3c1e9, offset 4
[  239.518996] asix 1-1.1:1.0 eth0: asix_rx_fixup() Data Header synchronisation was lost, remaining 988
[  239.528300] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x2881912, offset 4
[  239.536413] asix 1-1.1:1.0 eth0: asix_rx_fixup() Bad Header Length 0x5638f7e2, offset 4

And network throughput ends up being pretty bursty and slow with
a overall throughput of at best ~30kB/s (where as previously we
got 1.1MB/s with the slower USB1.1 "full speed" host).

We found the issue also was reproducible on a x86_64 system,
using a "high-speed" USB2.0 port but the throughput did not
measurably drop (possibly due to the scp transfer being cpu
bound on my slow test hardware).

After lots of debugging, I found the check added in the
problematic commit seems to be calculating the offset
incorrectly.

In the normal case, in the main loop of the function, we do:
(where offset is zero, or set to "offset += (copy_length + 1) &amp;
0xfffe" in the previous loop)
    rx-&gt;header = get_unaligned_le32(skb-&gt;data +
                                    offset);
    offset += sizeof(u32);

But the problematic patch calculates:
    offset = ((rx-&gt;remaining + 1) &amp; 0xfffe) + sizeof(u32);
    rx-&gt;header = get_unaligned_le32(skb-&gt;data + offset);

Adding some debug logic to check those offset calculation used
to find rx-&gt;header, the one in problematic code is always too
large by sizeof(u32).

Thus, this patch removes the incorrect " + sizeof(u32)" addition
in the problematic calculation, and resolves the issue.

Cc: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Cc: "David B. Robins" &lt;linux@davidrobins.net&gt;
Cc: Mark Craske &lt;Mark_Craske@mentor.com&gt;
Cc: Emil Goode &lt;emilgoode@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: YongQin Liu &lt;yongqin.liu@linaro.org&gt;
Cc: Guodong Xu &lt;guodong.xu@linaro.org&gt;
Cc: Ivan Vecera &lt;ivecera@redhat.com&gt;
Cc: linux-usb@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: stable &lt;stable@vger.kernel.org&gt; #4.4+
Reported-by: Yongqin Liu &lt;yongqin.liu@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>asix: silence log message from oversize packet</title>
<updated>2015-12-18T21:08:35+00:00</updated>
<author>
<name>stephen hemminger</name>
<email>stephen@networkplumber.org</email>
</author>
<published>2015-12-18T01:51:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b70183db83552cf63cac51406aaf76a2cf5fca73'/>
<id>urn:sha1:b70183db83552cf63cac51406aaf76a2cf5fca73</id>
<content type='text'>
Since it is possible for an external system to send oversize packets
at anytime, it is best for driver not to print a message and spam
the log (potential external DoS).

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=109471

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>drivers/net: get rid of unnecessary initializations in .get_drvinfo()</title>
<updated>2015-10-16T07:24:10+00:00</updated>
<author>
<name>Ivan Vecera</name>
<email>ivecera@redhat.com</email>
</author>
<published>2015-10-15T19:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47ea0325337b166c1c8695119aa6e83cdc035ef5'/>
<id>urn:sha1:47ea0325337b166c1c8695119aa6e83cdc035ef5</id>
<content type='text'>
Many drivers initialize uselessly n_priv_flags, n_stats, testinfo_len,
eedump_len &amp; regdump_len fields in their .get_drvinfo() ethtool op.
It's not necessary as these fields is filled in ethtool_get_drvinfo().

v2: removed unused variable
v3: removed another unused variable

Signed-off-by: Ivan Vecera &lt;ivecera@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>asix: Continue processing URB if no RX netdev buffer</title>
<updated>2015-10-05T13:58:43+00:00</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2015-10-02T13:29:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a570814cd430fa5ef4f278e8046dcf12ee63f13'/>
<id>urn:sha1:6a570814cd430fa5ef4f278e8046dcf12ee63f13</id>
<content type='text'>
Avoid a loss of synchronisation of the Ethernet Data header 32-bit
word due to a failure to get a netdev socket buffer.

The ASIX RX handling algorithm returned 0 upon a failure to get
an allocation of a netdev socket buffer. This causes the URB
processing to stop which potentially causes a loss of synchronisation
with the Ethernet Data header 32-bit word. Therefore, subsequent
processing of URBs may be rejected due to a loss of synchronisation.
This may cause additional good Ethernet frames to be discarded
along with outputting of synchronisation error messages.

Implement a solution which checks whether a netdev socket buffer
has been allocated before trying to copy the Ethernet frame into
the netdev socket buffer. But continue to process the URB so that
synchronisation is maintained. Therefore, only a single Ethernet
frame is discarded when no netdev socket buffer is available.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Mark Craske &lt;Mark_Craske@mentor.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>asix: On RX avoid creating bad Ethernet frames</title>
<updated>2015-10-05T13:58:43+00:00</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2015-10-02T13:29:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3f30b158eba5c604b6e0870027eef5d19fc9271d'/>
<id>urn:sha1:3f30b158eba5c604b6e0870027eef5d19fc9271d</id>
<content type='text'>
When RX Ethernet frames span multiple URB socket buffers,
the data stream may suffer a discontinuity which will cause
the current Ethernet frame in the netdev socket buffer
to be incomplete. This frame needs to be discarded instead
of appending unrelated data from the current URB socket buffer
to the Ethernet frame in the netdev socket buffer. This avoids
creating a corrupted Ethernet frame in the netdev socket buffer.

A discontinuity can occur when the previous URB socket buffer
held an incomplete Ethernet frame due to truncation or a
URB socket buffer containing the end of the Ethernet frame
was missing.

Therefore, add a sanity test for when an Ethernet frame
spans multiple URB socket buffers to check that the remaining
bytes of the currently received Ethernet frame point to
a good Data header 32-bit word of the next Ethernet
frame. Upon error, reset the remaining bytes variable to
zero and discard the current netdev socket buffer.
Assume that the Data header is located at the start of
the current socket buffer and attempt to process the next
Ethernet frame from there. This avoids unnecessarily
discarding a good URB socket buffer that contains a new
Ethernet frame.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Signed-off-by: Mark Craske &lt;Mark_Craske@mentor.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
