V4L/DVB (12938): SAA7164: Increase the firmware command timeout to avoid firmware...
authorSteven Toth <stoth@kernellabs.com>
Sat, 8 Aug 2009 13:22:02 +0000 (10:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 19 Sep 2009 03:15:06 +0000 (00:15 -0300)
The firmware typically responds in < 50ms and, via the interrupts and
deferred work queue the caller (blocked in the driver) is signalled very
efficiently. In a highly stressed system this can take many multiples
of seconds. So, we need a larger maximum timeout for busy systems.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7164/saa7164-cmd.c
drivers/media/video/saa7164/saa7164-core.c

index 171ef116f078bf5af58b29a788c110a22fc6577e..cd3af4d4364f2020af46698d9314db934269a58d 100644 (file)
@@ -234,6 +234,12 @@ int saa7164_cmd_wait(struct saa7164_dev *dev, u8 seqno)
                                __func__, seqno, dev->cmds[seqno].signalled);
 
                        /* Wait for signalled to be flagged or timeout */
+                       /* In a highly stressed system this can easily extend
+                        * into multiple seconds before the deferred worker
+                        * is scheduled, and we're woken up via signal.
+                        * We typically are signalled in < 50ms but it can
+                        * take MUCH longer.
+                        */
                        wait_event_timeout(*q, dev->cmds[seqno].signalled, (HZ * waitsecs));
                        r = time_before(jiffies, stamp + (HZ * waitsecs));
                        if (r)
index 06dab7cbcaacce3db44c864343cca22608066009..da6dbe579624ad87ae6cb6b2b72ff15e4ac6ecbf 100644 (file)
@@ -49,7 +49,7 @@ unsigned int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "enable debug messages");
 
-unsigned int waitsecs = 1;
+unsigned int waitsecs = 10;
 module_param(waitsecs, int, 0644);
 MODULE_PARM_DESC(debug, "timeout on firmware messages");