public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: Leadtek DTVb1800H require longer delay for tuner reset
@ 2011-03-20 22:05 Mirek Slugeň
  2011-03-21  8:44 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Mirek Slugeň @ 2011-03-20 22:05 UTC (permalink / raw)
  To: linux-dvb; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

Hi,

	I am using alot of tuners Leadtek DTV1800H under Linux, minimum 5 
devices per one PC with kernel 2.6.37.4. I discovered bug which I can se 
very often but not always. When device tuner is reseted there is not 
enough time to do all needed stuff and sometimes (randomly) kernel show 
this message:

[  821.369647] cx88[0]/1: IRQ loop detected, disabling interrupts

Patch is again very simple, we need to adjust time in reset function 
after cx_clear and cx_set calls from 50 to 75 us. I tested this patch on 
4 PC with similar problems and all are without this issue.

M. Slugen

[-- Attachment #2: kernel_cx88_reset.diff --]
[-- Type: text/x-patch, Size: 533 bytes --]

diff -Naur linux-2.6.37.4.old//drivers/media/video/cx88/cx88-cards.c linux-2.6.37.4/drivers/media/video/cx88/cx88-cards.c
--- linux-2.6.37.4.old//drivers/media/video/cx88/cx88-cards.c	2011-03-20 21:30:52.000000000 +0100
+++ linux-2.6.37.4/drivers/media/video/cx88/cx88-cards.c	2011-03-20 22:25:54.710228001 +0100
@@ -3019,9 +3019,9 @@
 		cx_set(MO_GP1_IO, 0x1010);
 		mdelay(50);
 		cx_clear(MO_GP1_IO, 0x10);
-		mdelay(50);
+		mdelay(75);
 		cx_set(MO_GP1_IO, 0x10);
-		mdelay(50);
+		mdelay(75);
 		return 0;
 	}
 	return -EINVAL;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: Leadtek DTVb1800H require longer delay for tuner reset
  2011-03-20 22:05 PATCH: Leadtek DTVb1800H require longer delay for tuner reset Mirek Slugeň
@ 2011-03-21  8:44 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2011-03-21  8:44 UTC (permalink / raw)
  To: Mirek Slugeň; +Cc: linux-dvb, linux-kernel, Jiri Slaby

On 03/20/2011 11:05 PM, Mirek Slugeň wrote:
> Hi,
> 
>     I am using alot of tuners Leadtek DTV1800H under Linux, minimum 5
> devices per one PC with kernel 2.6.37.4. I discovered bug which I can se
> very often but not always. When device tuner is reseted there is not
> enough time to do all needed stuff and sometimes (randomly) kernel show
> this message:
> 
> [  821.369647] cx88[0]/1: IRQ loop detected, disabling interrupts
> 
> Patch is again very simple, we need to adjust time in reset function
> after cx_clear and cx_set calls from 50 to 75 us. I tested this patch on
> 4 PC with similar problems and all are without this issue.
> 
> M. Slugen
> 
> 
> kernel_cx88_reset.diff
> 
> 
> diff -Naur linux-2.6.37.4.old//drivers/media/video/cx88/cx88-cards.c linux-2.6.37.4/drivers/media/video/cx88/cx88-cards.c
> --- linux-2.6.37.4.old//drivers/media/video/cx88/cx88-cards.c	2011-03-20 21:30:52.000000000 +0100
> +++ linux-2.6.37.4/drivers/media/video/cx88/cx88-cards.c	2011-03-20 22:25:54.710228001 +0100
> @@ -3019,9 +3019,9 @@
>  		cx_set(MO_GP1_IO, 0x1010);
>  		mdelay(50);
>  		cx_clear(MO_GP1_IO, 0x10);
> -		mdelay(50);
> +		mdelay(75);
>  		cx_set(MO_GP1_IO, 0x10);
> -		mdelay(50);
> +		mdelay(75);

Wow, 75 ms of busy-waiting. Since others use msleep, all these should be
converted to msleep too. Or is this an atomic context, so that the
others are broken (e.g. cx88_dvico_xc2028_callback)?

Also for instance I don't understand this code:
                cx_write(MO_GP2_IO, 0xcf7);
                mdelay(50);
                cx_write(MO_GP2_IO, 0xef5);
                mdelay(50);
                cx_write(MO_GP2_IO, 0xcf7);
                msleep(10);

Delays of 50 ms and sleep of 10 ms? Given [um]delay spin _at least_ the
time specified, what was the intention of this?

regards,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-21  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-20 22:05 PATCH: Leadtek DTVb1800H require longer delay for tuner reset Mirek Slugeň
2011-03-21  8:44 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox