Skip to content

Commit 56f7861

Browse files
jtornosmkuba-moo
authored andcommitted
net: usb: ax88179_178a: avoid writing the mac address before first reading
After the commit d2689b6 ("net: usb: ax88179_178a: avoid two consecutive device resets"), reset operation, in which the default mac address from the device is read, is not executed from bind operation and the random address, that is pregenerated just in case, is direclty written the first time in the device, so the default one from the device is not even read. This writing is not dangerous because is volatile and the default mac address is not missed. In order to avoid this and keep the simplification to have only one reset and reduce the delays, restore the reset from bind operation and remove the reset that is commanded from open operation. The behavior is the same but everything is ready for usbnet_probe. Tested with ASIX AX88179 USB Gigabit Ethernet devices. Restore the old behavior for the rest of possible devices because I don't have the hardware to test. cc: [email protected] # 6.6+ Fixes: d2689b6 ("net: usb: ax88179_178a: avoid two consecutive device resets") Reported-by: Jarkko Palviainen <[email protected]> Signed-off-by: Jose Ignacio Tornos Martinez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ac1a21d commit 56f7861

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/usb/ax88179_178a.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
13171317

13181318
netif_set_tso_max_size(dev->net, 16384);
13191319

1320+
ax88179_reset(dev);
1321+
13201322
return 0;
13211323
}
13221324

@@ -1695,7 +1697,6 @@ static const struct driver_info ax88179_info = {
16951697
.unbind = ax88179_unbind,
16961698
.status = ax88179_status,
16971699
.link_reset = ax88179_link_reset,
1698-
.reset = ax88179_reset,
16991700
.stop = ax88179_stop,
17001701
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
17011702
.rx_fixup = ax88179_rx_fixup,
@@ -1708,7 +1709,6 @@ static const struct driver_info ax88178a_info = {
17081709
.unbind = ax88179_unbind,
17091710
.status = ax88179_status,
17101711
.link_reset = ax88179_link_reset,
1711-
.reset = ax88179_reset,
17121712
.stop = ax88179_stop,
17131713
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
17141714
.rx_fixup = ax88179_rx_fixup,

0 commit comments

Comments
 (0)