Skip to contentSkip to conversation

smsc95xx: add missing .reset_resume hook and reset card

PATCH In review Viliam Mateicka 2 participants 2 messages Jul 14, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smsc95xx: add missing .reset_resume hook and reset card

This patch fixes the undefined behaviour (random MAC, interface goes down) of smsc95xx driver after resume from suspend. Calling smsc95xx_reset() is needed to properly set hw registers of card and bring interface up to defined state.

---
 drivers/net/usb/smsc95xx.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/usb/smsc95xx.c +12 -0
index f74f3ce..5c33be8 100644
@@ -1181,6 +1181,17 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
 	return skb;
 }
 
+static int smsc95xx_reset_resume(struct usb_interface *intf)
+{
+	struct usbnet	*dev = usb_get_intfdata(intf);
+
+	smsc95xx_reset(dev);
+
+	usbnet_resume(intf);
+
+	return 0;
+}
+
 static const struct driver_info smsc95xx_info = {
 	.description	= "smsc95xx USB 2.0 Ethernet",
 	.bind		= smsc95xx_bind,
@@ -1295,6 +1306,7 @@ static struct usb_driver smsc95xx_driver = {
 	.suspend	= usbnet_suspend,
 	.resume		= usbnet_resume,
 	.disconnect	= usbnet_disconnect,
+	.reset_resume	= smsc95xx_reset_resume,
 };
 
 static int __init smsc95xx_init(void)
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw

From: Viliam Mateicka <[email protected]>
Date: Thu, 14 Jul 2011 13:51:46 +0200

Quoted 4 lines

This patch fixes the undefined behaviour (random MAC, interface goes down) of smsc95xx driver after resume from suspend. Calling smsc95xx_reset() is needed to properly set hw registers of card and bring interface up to defined state.

Please submit networking patches to [email protected] so that it can be tracked properly.