OpenCloudOS-Kernel/drivers/net
Jose Ignacio Tornos Martinez f08e079bdd net: usb: ax88179_178a: improve reset check
commit 7be4cb7189f747b4e5b6977d0e4387bde3204e62 upstream.

After ecf848eb934b ("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: ecf848eb934b ("net: usb: ax88179_178a: fix link status when link is set to down/up")
Reported-by: Yongqin Liu <yongqin.liu@linaro.org>
Reported-by: Antje Miederhöfer <a.miederhoefer@gmx.de>
Reported-by: Arne Fitzenreiter <arne_f@ipfire.org>
Tested-by: Yongqin Liu <yongqin.liu@linaro.org>
Tested-by: Antje Miederhöfer <a.miederhoefer@gmx.de>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-27 13:49:11 +02:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:45:05 +01:00
bonding bonding: fix oops during rmmod 2024-06-16 13:47:43 +02:00
caif
can can: m_can: Start/Cancel polling timer together with interrupts 2024-03-26 18:19:29 -04:00
dsa net: dsa: realtek: keep default LED state in rtl8366rb 2024-06-27 13:49:02 +02:00
ethernet net: stmmac: Assign configured channel value to EXTTS event 2024-06-27 13:49:11 +02:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-01-31 16:19:05 -08:00
hamradio
hippi
hyperv hv_netvsc: Don't free decrypted memory 2024-05-17 12:02:17 +02:00
ieee802154
ipa net: ipa: don't overrun IPA suspend interrupt registers 2024-03-01 13:35:08 +01:00
ipvlan ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-06-12 11:12:59 +02:00
mctp
mdio
netdevsim netdevsim: avoid potential loop in nsim_dev_trap_report_work() 2024-02-16 19:10:47 +01:00
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:07:31 +02:00
phy net: phy: mxl-gpy: Remove interrupt mask clearing from config_init 2024-06-27 13:49:07 +02:00
plip
ppp ppp_async: limit MRU to 64K 2024-02-16 19:10:50 +01:00
pse-pd
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 17:02:02 +01:00
thunderbolt
usb net: usb: ax88179_178a: improve reset check 2024-06-27 13:49:11 +02:00
vmxnet3 vmxnet3: disable rx data ring on dma allocation failure 2024-06-21 14:38:15 +02:00
vxlan vxlan: Fix regression when dropping packets due to invalid src addresses 2024-06-21 14:38:17 +02:00
wan
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-03 15:28:36 +02:00
wireless wifi: mt76: mt7921s: fix potential hung tasks during chip recovery 2024-06-27 13:49:02 +02:00
wwan net: wwan: iosm: Fix tainted pointer delete is case of region creation fail 2024-06-21 14:38:18 +02:00
xen-netback kthread: add kthread_stop_put 2024-06-12 11:12:52 +02:00
Kconfig
LICENSE.SRC
Makefile net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled 2024-06-12 11:12:46 +02:00
Space.c
amt.c amt: do not use overwrapped cb area 2024-01-25 15:35:56 -08:00
bareudp.c
dummy.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:07:30 +02:00
eql.c
geneve.c geneve: Fix incorrect inner network header offset when innerprotoinherit is set 2024-06-21 14:38:33 +02:00
gtp.c net: gtp: Fix Use-After-Free in gtp_dellink 2024-05-02 16:32:36 +02:00
ifb.c
loopback.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:07:30 +02:00
macsec.c macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst 2024-05-02 16:32:50 +02:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 17:19:54 +00:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
tun.c tun: limit printing rate when illegal packet received by tun dev 2024-04-27 17:11:33 +02:00
veth.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:07:30 +02:00
virtio_net.c virtio_net: fixing XDP for fully checksummed packets handling 2024-06-27 13:49:07 +02:00
vrf.c net: Move {l,t,d}stats allocation to core and convert veth & vrf 2023-12-03 07:33:04 +01:00
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:35:49 +02:00