Oliver Endriss schrieb: >> 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. > > With this patch I get random error messages from av7110_debiread|write: > > | Aug 19 01:26:05 orion kernel: av7110_debiread: wait_for_debi_done #1 failed > | Aug 19 01:26:05 orion kernel: av7110_debiwrite: wait_for_debi_done failed > I saw the same messages, if I used a too short delay (100usec). For testing, I printed out the time, while the DEBI_E was active. Startup of the TT-C2300: Aug 19 08:53:38 darkstar kernel: Linux video capture interface: v2.00 Aug 19 08:53:38 darkstar kernel: saa7146: register extension 'dvb'. Aug 19 08:53:38 darkstar kernel: ACPI: PCI Interrupt 0000:04:06.0[A] -> Link [LNKA] -> GSI 17 (level, low) -> IRQ 22 Aug 19 08:53:38 darkstar kernel: saa7146: found saa7146 @ mem fab6ec00 (revision 1, irq 22) (0x13c2,0x000a). Aug 19 08:53:38 darkstar kernel: DVB: registering new adapter (Technotrend/Hauppauge WinTV Nexus-CA rev1.X) Aug 19 08:53:38 darkstar kernel: adapter has MAC addr = ??:??:??:??:??:?? Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 30usec Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 360usec Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 360usec Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 360usec Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 360usec Aug 19 08:53:38 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 360usec Aug 19 08:53:38 very-new-darkstar kernel: vdr is running: Aug 19 08:59:33 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:33 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:33 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 20usec Aug 19 08:59:33 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:34 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:34 darkstar kernel: (tda10021.c:305) ckoff=26, sroffset=672, sr=6900000 Aug 19 08:59:34 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 30usec Aug 19 08:59:34 darkstar kernel: (tda10021.c:305) ckoff=0, sroffset=0, sr=6900672 Aug 19 08:59:34 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:34 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:35 darkstar kernel: (saa7146_core.c:132) saa7146 (1): SEBI_E was active for 38(253)msec Aug 19 08:59:35 darkstar kernel: (saa7146_core.c:136) saa7146 (0): SEBI_E was active for 110usec The longest time from the TT-C2300 was 370us. The Cinergy does always timeout with a debi error. I've used the attached patch. - Hartmut
diff -r a7cbfe0ab659 linux/drivers/media/common/saa7146_core.c --- a/linux/drivers/media/common/saa7146_core.c Mon Aug 13 23:42:26 2007 +0200 +++ b/linux/drivers/media/common/saa7146_core.c Sun Aug 19 09:10:43 2007 +0200 @@ -63,6 +63,10 @@ int saa7146_wait_for_debi_done(struct sa { unsigned long start; int err; + int loop; + u32 psr; + int err_start, err_stop, err_start_jiffies, err_stop_jiffies; + int ret = 0; /* wait for registers to be programmed */ start = jiffies; @@ -79,20 +83,58 @@ int saa7146_wait_for_debi_done(struct sa } /* wait for transfer to complete */ + loop = 0; + err_start = -1; + err_stop = -1; 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; + ret = -ETIMEDOUT; + break; + } +#if 0 + /* 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")); + ret = -EIO; + break; + } +#endif + if ((psr & SPCI_DEBI_E) && err_start == -1) { + err_start_jiffies = jiffies; + err_start = loop; + } + if (!(psr & SPCI_DEBI_E) && err_start >= 0 && err_stop == -1) { + err_stop_jiffies = jiffies; + err_stop = loop; + } + if (nobusyloop) { + msleep(1); + loop += 1000; + } else { + udelay(10); + loop += 10; + } + } + if (err_start >= 0) { + if (err_stop < 0) { + err_stop_jiffies = jiffies; + err_stop = loop; } if (nobusyloop) - msleep(1); - } - + printk("(%s:%d) %s: SEBI_E was active for %d(%d)msec\n", + __FILE__, __LINE__, dev->name, (err_stop - err_start) / 1000, + jiffies_to_msecs(err_stop_jiffies - err_start_jiffies)); + else + printk("(%s:%d) %s: SEBI_E was active for %dusec\n", + __FILE__, __LINE__, dev->name, err_stop - err_start); + } return 0; }
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb