2014-07-10 02:49:48

by Joonyoung Shim

[permalink] [raw]
Subject: [PATCH] usbnet: smsc95xx: add reset_resume function with reset operation

The smsc95xx needs to resume with reset operation. Otherwise it causes
system hang by network error like below after resume. This case appears
on odroid u3 board.

[ 9.727600] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 9.727648] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 9.727689] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 9.727728] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 9.729486] PM: resume of devices complete after 2011.219 msecs
[ 10.117609] Restarting tasks ... done.
[ 11.725099] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 13.480846] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
[ 13.481361] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
...

Signed-off-by: Joonyoung Shim <[email protected]>
---
drivers/net/usb/smsc95xx.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 424db65e..d07bf4c 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1714,6 +1714,18 @@ static int smsc95xx_resume(struct usb_interface *intf)
return ret;
}

+static int smsc95xx_reset_resume(struct usb_interface *intf)
+{
+ struct usbnet *dev = usb_get_intfdata(intf);
+ int ret;
+
+ ret = smsc95xx_reset(dev);
+ if (ret < 0)
+ return ret;
+
+ return smsc95xx_resume(intf);
+}
+
static void smsc95xx_rx_csum_offload(struct sk_buff *skb)
{
skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2);
@@ -2004,7 +2016,7 @@ static struct usb_driver smsc95xx_driver = {
.probe = usbnet_probe,
.suspend = smsc95xx_suspend,
.resume = smsc95xx_resume,
- .reset_resume = smsc95xx_resume,
+ .reset_resume = smsc95xx_reset_resume,
.disconnect = usbnet_disconnect,
.disable_hub_initiated_lpm = 1,
.supports_autosuspend = 1,
--
1.8.1.2


2014-07-10 07:43:23

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] usbnet: smsc95xx: add reset_resume function with reset operation

From: Joonyoung Shim <[email protected]>
Date: Thu, 10 Jul 2014 11:49:42 +0900

> The smsc95xx needs to resume with reset operation. Otherwise it causes
> system hang by network error like below after resume. This case appears
> on odroid u3 board.
>
> [ 9.727600] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 9.727648] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 9.727689] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 9.727728] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 9.729486] PM: resume of devices complete after 2011.219 msecs
> [ 10.117609] Restarting tasks ... done.
> [ 11.725099] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 13.480846] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> [ 13.481361] smsc95xx 1-2:1.0 eth0: kevent 2 may have been dropped
> ...
>
> Signed-off-by: Joonyoung Shim <[email protected]>

Applied.