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>
Sat, 5 Mar 2011 21:18:01 +0000 (23:18 +0200)
commitfa3042ca1026927d70b2cbfc1a8ddb09bc96bb82
tree1dc6ddccf7b04cd8f0f3a4e60450d8a16aa736db
parent4efe11975587a035ba1f190177f8887349deb7cc
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