aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-03-27 12:15:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-27 14:51:39 -0400
commit9896322ae180e3520edec71e2480318e7196119c (patch)
treeb7832d49114fd885d3c456bac740e9feae8a9b53 /drivers
parentebd9302842ecae39061b269531c0f5e278949cd3 (diff)
rt2x00: Ignore set_state(STATE_SLEEP) failure
Some hardware never seem to accept the "goto sleep" command, since the legacy drivers don't have suspend and resume handlers the entire code for it was basically a educated guess (based on the "enable radio" code). This patch will only print a warning when the "goto sleep" command fails, and just continues as usual. Perhaps that means the device will not reach a sleep state and consumes more power then it should, but it is equally possible it simply needs some seconds longer to sleep. Anyway, by making the command non-fatal it will not block the rest of the suspend procedure. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index bd305f7f3efd..e873a39fcce3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1393,11 +1393,20 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state)
1393 1393
1394exit: 1394exit:
1395 /* 1395 /*
1396 * Set device mode to sleep for power management. 1396 * Set device mode to sleep for power management,
1397 * on some hardware this call seems to consistently fail.
1398 * From the specifications it is hard to tell why it fails,
1399 * and if this is a "bad thing".
1400 * Overall it is safe to just ignore the failure and
1401 * continue suspending. The only downside is that the
1402 * device will not be in optimal power save mode, but with
1403 * the radio and the other components already disabled the
1404 * device is as good as disabled.
1397 */ 1405 */
1398 retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); 1406 retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP);
1399 if (retval) 1407 if (retval)
1400 return retval; 1408 WARNING(rt2x00dev, "Device failed to enter sleep state, "
1409 "continue suspending.\n");
1401 1410
1402 return 0; 1411 return 0;
1403} 1412}