]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
CBUS: Do not BUG_ON in retu-headset in case of spurious release event
authorJarkko Nikula <jarkko.nikula@nokia.com>
Tue, 13 Nov 2007 13:53:14 +0000 (15:53 +0200)
committerTony Lindgren <tony@atomide.com>
Thu, 15 Nov 2007 21:29:22 +0000 (13:29 -0800)
commitd079a1c74ea46f75cc406838c45652b97205e6be
treed502c9a4c127ccf48bc43bd48605aae377d0cdd0
parent69cc712d876910c5719594aa7350a15b4bf3e66d
CBUS: Do not BUG_ON in retu-headset in case of spurious release event

There is a small chance that retu_headset_detect_timer can run twice
and pressed flag being zero in second run. Do nothing in that case instead
of throwing BUG_ON.

Double run can happen under very busy system assuming following scenario

1. Hook interrupt (run in softirq context, pressed flag = 1)
2. First retu_headset_enable_timer call
3. Busy system, retu raises an interrupt but cannot run hook interrupt for
   300-350 ms
4. Second hook interrupt
5. First retu_headset_detect_timer call (pressed flag = 0)
6. Second retu_headset_enable_timer
7. Second retu_headset_detect_timer
   -> pressed flag == 0 => BUG_ON

Patch also removes two debug messages since they are not needed very much
and removal cleans up code a bit.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/cbus/retu-headset.c