]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB: au8522: fix race condition in switching from digital to analog mode
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Thu, 18 Feb 2010 01:47:55 +0000 (22:47 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:46:21 +0000 (00:46 -0300)
commit5653a6d068165d7345bfeeb414b30776781de1f3
treee8db82b72129777469ea7ba3a313f4ce237447e3
parent4b45526b2e7a19203e584a2712b7c31da03f66e4
V4L/DVB: au8522: fix race condition in switching from digital to analog mode

With applications like MythTV, switching inputs results in closing the digital
side and then immediately opening the analog side.  This exposes a race
condition where the dvb_frontend kernel thread powers down the chip and closes
the i2c gate even though we're in the middle of bringing up the analog part
of the chip (since the shutdown of the dvb_frontend kernel thread occurs
asychronously).

Introduce a construct to keep track of what mode we're in, and drop requests
to power down or management the gate if we've already switched to analog mode.

Thanks to Zaphod Beeblebrox for reporting this issue.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/au8522_decoder.c
drivers/media/dvb/frontends/au8522_dig.c
drivers/media/dvb/frontends/au8522_priv.h