wl1251: cancel elp_work early
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 27 Oct 2010 13:17:49 +0000 (16:17 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 31 Oct 2010 20:10:34 +0000 (22:10 +0200)
commit612f5a8df2425b13b76817efdcbb2f694c8e5e23
tree5fdc77269c1d65bfd1ee122fcf463c51901fb7ea
parentfde1aa2a73fe0ac75be1559157f8361152db85f5
wl1251: cancel elp_work early

While working on PS I've noticed elp_work is kicking rather often, and
sometimes the chip is put to sleep before 5ms delay expires. This
seems to happen because by the time wl1251_ps_elp_wakeup is called
elp_work might still be pending, and if the processing takes longer
(for example interrupts may take some time to process), elp_work might
get started and hit the mutex. After main thread finishes work it
calls wl1251_ps_elp_sleep, which can no longer cancel old work (as
it's already started) and schedules yet another work needlessly. The
elp_work then gets the mutex and puts the chip to sleep too early.

Fix this by cancelling work in wl1251_ps_elp_wakeup instead.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/net/wireless/wl12xx/wl1251_ps.c