]> www.infradead.org Git - users/willy/pagecache.git/commit
net: usb: ax88179_178a: fix link status when link is set to down/up
authorJose Ignacio Tornos Martinez <jtornosm@redhat.com>
Fri, 10 May 2024 09:08:28 +0000 (11:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 13 May 2024 22:47:15 +0000 (15:47 -0700)
commitecf848eb934b03959918f5269f64c0e52bc23998
treeb6e8bb02f95b49f4a16fda25d8c7528244c38e8f
parent5eefb477d21a26183bc3499aeefa991198315a2d
net: usb: ax88179_178a: fix link status when link is set to down/up

The idea was to keep only one reset at initialization stage in order to
reduce the total delay, or the reset from usbnet_probe or the reset from
usbnet_open.

I have seen that restarting from usbnet_probe is necessary to avoid doing
too complex things. But when the link is set to down/up (for example to
configure a different mac address) the link is not correctly recovered
unless a reset is commanded from usbnet_open.

So, detect the initialization stage (first call) to not reset from
usbnet_open after the reset from usbnet_probe and after this stage, always
reset from usbnet_open too (when the link needs to be rechecked).

Apply to all the possible devices, the behavior now is going to be the same.

cc: stable@vger.kernel.org # 6.6+
Fixes: 56f78615bcb1 ("net: usb: ax88179_178a: avoid writing the mac address before first reading")
Reported-by: Isaac Ganoung <inventor500@vivaldi.net>
Reported-by: Yongqin Liu <yongqin.liu@linaro.org>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240510090846.328201-1-jtornosm@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/ax88179_178a.c