aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-02-21 22:05:04 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-25 15:49:51 -0500
commit42e21c01071b4406341e32aba65e40c7f9b7e973 (patch)
treeb3be84ce175231ce85ee45caa213c42695297ee3
parent7643721471117d5f62ca36f328d3dc8d84af4402 (diff)
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: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/smsc95xx.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index b2721bc87283..7fa9622aabbd 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1418,15 +1418,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
1418 u32 val, link_up; 1418 u32 val, link_up;
1419 int ret; 1419 int ret;
1420 1420
1421 /* TODO: don't indicate this feature to usb framework if
1422 * our current hardware doesn't have the capability
1423 */
1424 if ((message.event == PM_EVENT_AUTO_SUSPEND) &&
1425 (!(pdata->features & FEATURE_AUTOSUSPEND))) {
1426 netdev_warn(dev->net, "autosuspend not supported\n");
1427 return -EBUSY;
1428 }
1429
1430 ret = usbnet_suspend(intf, message); 1421 ret = usbnet_suspend(intf, message);
1431 if (ret < 0) { 1422 if (ret < 0) {
1432 netdev_warn(dev->net, "usbnet_suspend error\n"); 1423 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 /* determine if link is up using only _nopm functions */ 1432 /* determine if link is up using only _nopm functions */
1442 link_up = smsc95xx_link_ok_nopm(dev); 1433 link_up = smsc95xx_link_ok_nopm(dev);
1443 1434
1444 if (message.event == PM_EVENT_AUTO_SUSPEND) { 1435 if (message.event == PM_EVENT_AUTO_SUSPEND &&
1436 (pdata->features & FEATURE_AUTOSUSPEND)) {
1445 ret = smsc95xx_autosuspend(dev, link_up); 1437 ret = smsc95xx_autosuspend(dev, link_up);
1446 goto done; 1438 goto done;
1447 } 1439 }