Commit 42e21c01 authored by Ming Lei's avatar Ming Lei Committed by David S. Miller

usbnet: smsc95xx: fix broken runtime suspend

Commit b2d4b150(smsc95xx: enable dynamic autosuspend) implements
autosuspend, but breaks current runtime suspend, such as:
when the interface becomes down, the usb device can't be put into
runtime suspend any more.

This patch fixes the broken runtime suspend.

Cc: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 76437214
...@@ -1418,15 +1418,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -1418,15 +1418,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
u32 val, link_up; u32 val, link_up;
int ret; int ret;
/* TODO: don't indicate this feature to usb framework if
* our current hardware doesn't have the capability
*/
if ((message.event == PM_EVENT_AUTO_SUSPEND) &&
(!(pdata->features & FEATURE_AUTOSUSPEND))) {
netdev_warn(dev->net, "autosuspend not supported\n");
return -EBUSY;
}
ret = usbnet_suspend(intf, message); ret = usbnet_suspend(intf, message);
if (ret < 0) { if (ret < 0) {
netdev_warn(dev->net, "usbnet_suspend error\n"); netdev_warn(dev->net, "usbnet_suspend error\n");
...@@ -1441,7 +1432,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -1441,7 +1432,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
/* determine if link is up using only _nopm functions */ /* determine if link is up using only _nopm functions */
link_up = smsc95xx_link_ok_nopm(dev); link_up = smsc95xx_link_ok_nopm(dev);
if (message.event == PM_EVENT_AUTO_SUSPEND) { if (message.event == PM_EVENT_AUTO_SUSPEND &&
(pdata->features & FEATURE_AUTOSUSPEND)) {
ret = smsc95xx_autosuspend(dev, link_up); ret = smsc95xx_autosuspend(dev, link_up);
goto done; goto done;
} }
......
Markdown is supported
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