2007/8/18, e9hack <[EMAIL PROTECTED]>:
>
>
> I've modified saa7146_wait_for_debi_done() a little bit. The function
> returns earlier from the
> second loop, if nobusyloop was 0 and if SPCI_DEBI_E was set after 100usec.
> I've used udelay() and an
> additional counter. My TT-C2300 has reported an ARM boot error. The
> unmodified driver wasn't able to
> restart the ARM. I must do a power off to recover the TT-C2300. I will do
> more test on this issue,
> but currently I do some tests on a TT-C1500. Too many challenges are not
> so good at the same time.
It seems, the delay of 100usec is too short. During booting of the ARM,
DEBI_E is set for ca. 360usec after some debi commands. I've changed the
delay to 500usec. The load average is dropped from 0.65 to 0.0 with
budget_av and dvb_ttpci loaded and vdr isn't running.
- Hartmut
signed off by: Hartmut Birr <[EMAIL PROTECTED]>
diff -r dc1611a2006f linux/drivers/media/common/saa7146_core.c
--- a/linux/drivers/media/common/saa7146_core.c Fri Aug 17 17:49:41 2007 -0300
+++ b/linux/drivers/media/common/saa7146_core.c Sat Aug 18 10:45:08 2007 +0200
@@ -63,6 +63,8 @@ int saa7146_wait_for_debi_done(struct sa
{
unsigned long start;
int err;
+ int loop;
+ u32 psr;
/* wait for registers to be programmed */
start = jiffies;
@@ -79,20 +81,31 @@ int saa7146_wait_for_debi_done(struct sa
}
/* wait for transfer to complete */
+ loop = 0;
start = jiffies;
while (1) {
err = time_after(jiffies, start + HZ/4);
- if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
+ psr = saa7146_read(dev, PSR);
+ if (!(psr & SPCI_DEBI_S))
break;
saa7146_read(dev, MC2);
if (err) {
DEB_S(("timed out while waiting for transfer completion\n"));
return -ETIMEDOUT;
}
- if (nobusyloop)
+ /* leave the loop, if the DEBI_E isn't reset after 500usec */
+ if (loop >= 500 && (psr & SPCI_DEBI_E)) {
+ DEB_S(("error while waiting for transfer completion\n"));
+ return -EIO;
+ }
+ if (nobusyloop) {
msleep(1);
- }
-
+ loop += 1000;
+ } else {
+ udelay(10);
+ loop += 10;
+ }
+ }
return 0;
}
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb