[linux-dvb] Patches to fix support for VisionPlus DTV (VP1020) / tuning problem

Johannes Stezenbach js at linuxtv.org
Sat Apr 23 14:50:42 CEST 2005


Steffen Motzer wrote:
> These patches fix the following bugs:
> 
> bttv-i2c.c:
> After upgrading from 2.6.9 to 2.6.11.7, bttv failed to write to the ASIC
> via the i2c bus. After a couple of times bttv_i2c_wait_done was called
> the RACK flag was indicating a failed i2c operation.

A number of bttv patches whent into 2.6.12-rc2. Does you stuff still
apply there?


> *** bttv-i2c.c.orig	2005-04-23 00:42:40.000000000 +0200
> --- bttv-i2c.c		2005-04-23 02:09:43.000000000 +0200
> *************** bttv_i2c_wait_done(struct bttv *btv)
> *** 135,143 ****

Please send unified diffs only!

>   	DECLARE_WAITQUEUE(wait, current);
>   	int rc = 0;
>   
>   	add_wait_queue(&btv->i2c_queue, &wait);
> ! 	if (0 == btv->i2c_done)
> ! 		msleep_interruptible(20);
>   	remove_wait_queue(&btv->i2c_queue, &wait);
>   
>   	if (0 == btv->i2c_done)
> --- 135,148 ----
>   	DECLARE_WAITQUEUE(wait, current);
>   	int rc = 0;
>   
> + 	unsigned long timeout = msecs_to_jiffies(20);
> + 
>   	add_wait_queue(&btv->i2c_queue, &wait);
> ! 
> ! 	while (0 == btv->i2c_done && timeout) {
> ! 		set_current_state(TASK_INTERRUPTIBLE);
> ! 		timeout = schedule_timeout(timeout);
> ! 	}
>   	remove_wait_queue(&btv->i2c_queue, &wait);
>   
>   	if (0 == btv->i2c_done)

This code looks strange (before and after your change).
Why isn't this a simple

  wait_event_interruptible_timeout(&btv->i2c_queue, btv->i2c_done,
  				   msecs_to_jiffies(20));

?

Johannes




More information about the linux-dvb mailing list