Skip to content
Commit f08e079b authored by Jose Ignacio Tornos Martinez's avatar Jose Ignacio Tornos Martinez Committed by Greg Kroah-Hartman
Browse files

net: usb: ax88179_178a: improve reset check



commit 7be4cb71 upstream.

After ecf848eb ("net: usb: ax88179_178a: fix link status when link is
set to down/up") to not reset from usbnet_open after the reset from
usbnet_probe at initialization stage to speed up this, some issues have
been reported.

It seems to happen that if the initialization is slower, and some time
passes between the probe operation and the open operation, the second reset
from open is necessary too to have the device working. The reason is that
if there is no activity with the phy, this is "disconnected".

In order to improve this, the solution is to detect when the phy is
"disconnected", and we can use the phy status register for this. So we will
only reset the device from reset operation in this situation, that is, only
if necessary.

The same bahavior is happening when the device is stopped (link set to
down) and later is restarted (link set to up), so if the phy keeps working
we only need to enable the mac again, but if enough time passes between the
device stop and restart, reset is necessary, and we can detect the
situation checking the phy status register too.

cc: stable@vger.kernel.org # 6.6+
Fixes: ecf848eb ("net: usb: ax88179_178a: fix link status when link is set to down/up")
Reported-by: default avatarYongqin Liu <yongqin.liu@linaro.org>
Reported-by: default avatarAntje Miederhöfer <a.miederhoefer@gmx.de>
Reported-by: default avatarArne Fitzenreiter <arne_f@ipfire.org>
Tested-by: default avatarYongqin Liu <yongqin.liu@linaro.org>
Tested-by: default avatarAntje Miederhöfer <a.miederhoefer@gmx.de>
Signed-off-by: default avatarJose Ignacio Tornos Martinez <jtornosm@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78a6136e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment