]> git.itanic.dy.fi Git - linux-stable/commit
net: usb: ax88179_178a: avoid writing the mac address before first reading
authorJose Ignacio Tornos Martinez <jtornosm@redhat.com>
Wed, 17 Apr 2024 08:55:13 +0000 (10:55 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Apr 2024 16:53:55 +0000 (09:53 -0700)
commit56f78615bcb1c3ba58a5d9911bad3d9185cf141b
tree778732de62a4652991dc3f6cee149ef6605d81d9
parentac1a21db32eda8a09076bad025d7b848dd086d28
net: usb: ax88179_178a: avoid writing the mac address before first reading

After the commit d2689b6a86b9 ("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: stable@vger.kernel.org # 6.6+
Fixes: d2689b6a86b9 ("net: usb: ax88179_178a: avoid two consecutive device resets")
Reported-by: Jarkko Palviainen <jarkko.palviainen@gmail.com>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Link: https://lore.kernel.org/r/20240417085524.219532-1-jtornosm@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/ax88179_178a.c