]> git.baikalelectronics.ru Git - kernel.git/commitdiff
smsc95xx: fix stalled rx after link change
authorAaro Koskinen <aaro.koskinen@iki.fi>
Thu, 23 Sep 2021 22:00:16 +0000 (01:00 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Sep 2021 13:17:22 +0000 (14:17 +0100)
After commit 05b35e7eb9a1 ("smsc95xx: add phylib support"), link changes
are no longer propagated to usbnet. As a result, rx URB allocation won't
happen until there is a packet sent out first (this might never happen,
e.g. running just ssh server with a static IP). Fix by triggering usbnet
EVENT_LINK_CHANGE.

Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/smsc95xx.c

index 7d953974eb9b5d61f326fae1a81448945bbbe2fb..26b1bd8e845b437b7fdff7e22d8c4803fc020268 100644 (file)
@@ -1178,7 +1178,10 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
 
 static void smsc95xx_handle_link_change(struct net_device *net)
 {
+       struct usbnet *dev = netdev_priv(net);
+
        phy_print_status(net->phydev);
+       usbnet_defer_kevent(dev, EVENT_LINK_CHANGE);
 }
 
 static int smsc95xx_start_phy(struct usbnet *dev)