Permalink
Browse files

wlcore: android: don't suspend on pending recovery (INTERNAL)

Some customers complain that if we cancel a pending recovery during
suspend, the android scheduler will keep banging on the suspend handler,
without letting recovery take its course. Grab a wakelock to give the
recovery process some breathing room.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
  • Loading branch information...
1 parent 0858c6e commit b94686eae0e2408fd4d35dd22df42d5a2107c187 @ariknem ariknem committed Jun 27, 2012
Showing with 11 additions and 0 deletions.
  1. +10 −0 drivers/net/wireless/ti/wlcore/main.c
  2. +1 −0 drivers/net/wireless/ti/wlcore/wlcore.h
@@ -783,6 +783,10 @@ void wl12xx_queue_recovery_work(struct wl1271 *wl)
/* Avoid a recursive recovery */
if (!test_and_set_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) {
wlcore_disable_interrupts_nosync(wl);
+#ifdef CONFIG_HAS_WAKELOCK
+ /* give us a grace period for recovery */
+ wake_lock_timeout(&wl->recovery_wake, 5 * HZ);
+#endif
ieee80211_queue_work(wl->hw, &wl->recovery_work);
}
}
@@ -1717,6 +1721,10 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw,
/* we want to perform the recovery before suspending */
if (test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) {
wl1271_warning("postponing suspend to perform recovery");
+#ifdef CONFIG_HAS_WAKELOCK
+ /* give us a grace period for recovery */
+ wake_lock_timeout(&wl->recovery_wake, 5 * HZ);
+#endif
return -EBUSY;
}
@@ -5433,6 +5441,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size)
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_init(&wl->wake_lock, WAKE_LOCK_SUSPEND, "wl1271_wake");
wake_lock_init(&wl->rx_wake, WAKE_LOCK_SUSPEND, "rx_wake");
+ wake_lock_init(&wl->recovery_wake, WAKE_LOCK_SUSPEND, "recovery_wake");
#endif
wl->state = WL1271_STATE_OFF;
@@ -5498,6 +5507,7 @@ int wlcore_free_hw(struct wl1271 *wl)
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_destroy(&wl->wake_lock);
wake_lock_destroy(&wl->rx_wake);
+ wake_lock_destroy(&wl->recovery_wake);
#endif
/* Unblock any fwlog readers */
mutex_lock(&wl->mutex);
@@ -296,6 +296,7 @@ struct wl1271 {
#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock wake_lock;
struct wake_lock rx_wake;
+ struct wake_lock recovery_wake;
#endif
struct wl1271_stats stats;

0 comments on commit b94686e

Please sign in to comment.