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>
Mon, 17 Jan 2011 17:19:43 +0000 (19:19 +0200)
commit30e33dffc8e71c01ecfb56c5207824b1c4764b9d
tree0849520f15c89f7d85c20c177cc357936fe14493
parent25f470c2dc8011c7ce09f71d83558dd8a75301b7
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