Re: [PATCH] MSI Megasky 580 GL861 i2c timeout fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've tested your patch (in v4l-dvb repository). It worked fine, once I
increased the delay to 15us. I refined the patch a bit to be able to set
the access gap time with a module parameter.

System specs:
CPU: AMD 4200+ X2 CPU
Motherboard: Asus M2NPV-VM
Memory: 1G DDR2 PC6400 CL5 Dual-Channel

/ Jonas

Antti Palosaari wrote:
> heissan
> attached patch adds a little delay before usb-control message sending to
> avoid i2c timeouts (unwanted message log errors) seen many people.
> 
> Looks like gl861 usb-controller messes up and stops responding if i2c
> messages are send too fast. This happens especially with faster
> computers. First I tried to change usb_control_msg timeout from 2000 to
> 4000 but it didn't help.
> 
> This bug is mentioned (at least) following mails:
> http://linuxtv.org/pipermail/linux-dvb/2007-February/015863.html
> http://linuxtv.org/pipermail/linux-dvb/2007-January/015458.html
> 
> Jonas Larsson and gingis could you test and report if it works. If still
> timeouts after the patch then try to add more delay [udelay(10)].
> 
> Signed-off-by: Antti Palosaari <crope@xxxxxx>
> 
> 
> ------------------------------------------------------------------------
> 
> diff -r 580ad59c8bb5 linux/drivers/media/dvb/dvb-usb/gl861.c
> --- a/linux/drivers/media/dvb/dvb-usb/gl861.c	Tue Feb 13 16:26:26 2007 -0500
> +++ b/linux/drivers/media/dvb/dvb-usb/gl861.c	Wed Feb 14 00:28:13 2007 +0200
> @@ -44,6 +44,8 @@ static int gl861_i2c_msg(struct dvb_usb_
>  		warn("wlen = %x, aborting.", wlen);
>  		return -EINVAL;
>  	}
> +
> +	udelay(10); /* avoid usb i2c timeouts */
>  
>  	return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
>  			       value, index, rbuf, rlen, 2000);
diff -r 667e84e2e762 linux/drivers/media/dvb/dvb-usb/gl861.c
--- a/linux/drivers/media/dvb/dvb-usb/gl861.c	Tue Feb 13 07:00:55 2007 -0200
+++ b/linux/drivers/media/dvb/dvb-usb/gl861.c	Wed Feb 14 19:19:13 2007 +0100
@@ -15,6 +15,11 @@ int dvb_usb_gl861_debug;
 int dvb_usb_gl861_debug;
 module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
 MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+/* access gap */
+static int access_gap = 15; /* us */
+module_param(access_gap, int, 0644);
+MODULE_PARM_DESC(access_gap, "Minimum gap between device accesses in microsecs");
 
 static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
 			 u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -44,6 +49,8 @@ static int gl861_i2c_msg(struct dvb_usb_
 		warn("wlen = %x, aborting.", wlen);
 		return -EINVAL;
 	}
+
+	udelay(access_gap); /* avoid usb i2c timeouts */
 
 	return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
 			       value, index, rbuf, rlen, 2000);
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux