[linux-dvb] syslog: av7110_fw_request: timeout waiting for HANDSHAKE_REG - What does this mean?

Oliver Endriss o.endriss at gmx.de
Sat Jun 25 20:38:30 CEST 2005


Johannes Stezenbach wrote:
> On Wed, Jun 08, 2005 at 03:53:44AM -0700, C.Y.M wrote:
> > Johannes Stezenbach wrote:
> > > On Fri, Jun 03, 2005 at 10:06:52AM +0200, Sebastian wrote:
> > > 
> > >>Jun  3 05:31:43 hal9000 av7110_fw_request: timeout waiting for HANDSHAKE_REG
> > > 
> > > I don't know what causes it. The error message means the firmware
> > > crashed (or it's internal state got confused) in a different than
> > > the usual location.
> > 
> > I am able to reproduce this "handshake" error by maxing my cpu and then using an
> > application that outputs through the FF card.  For example.. I start mencoder to
> > encode an mpeg file which pretty much uses all the cpu on my machine.  Then, I
> > use mplayer to output a mpg file with mpegpes while the machine is still
> > encoding the other file.  Almost immediately I start finding "av7110_fw_request:
> > timeout waiting for HANDSHAKE_REG" in the syslog. If I am not maxing out my cpu
> > (ie; encoding a file) while I play a mpg via mpegpes, then the errors do not occur.
> 
> I just fixed a bug in timeout handling:
> 
>         start = jiffies;
>         while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
> -               msleep(1);
>                 if (time_after(jiffies, start + ARM_WAIT_FREE)) {
>                         printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__);
>                         return -ETIMEDOUT;
>                 }
> +               msleep(1);
>         }
> 
> (multiple occurences)
> 
> When the machine is busy, msleep(1) can sleep unexpectedly long.
> Additionally, it doesn't make sense to sleep and then exit with
> a timeout without retesting the condition we're waiting for.

The code above is better but does not solve the problem completely.
I still had problems under high CPU load with a preemptible kernel.

Imho it should be done this way:

        while (1) {
                err = time_after(jiffies, start + ARM_WAIT_FREE);
                if (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2) == 0)
                        break;
                if (err) {
                        printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__);
                        return -ETIMEDOUT;
                }
                msleep(1);
        }

This way rdebi can always be executed at the end of the timeout period.
Now the scheduler may suspend the task everywhere in the loop for an
extended period of time.

If no one objects I will apply the patch to av7110_hw.c and
saa7146_core.c/wait_for_debi_done().

Oliver

-- 
--------------------------------------------------------
VDR Remote Plugin available at
http://www.escape-edv.de/endriss/vdr/
--------------------------------------------------------




More information about the linux-dvb mailing list