Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5b50ed7ca2432e7ea3caf8cc2ef5ac805c082519
Commit:     5b50ed7ca2432e7ea3caf8cc2ef5ac805c082519
Parent:     76f4a12000254d460e947d2a95ab422ee6e598bf
Author:     Jonathan Corbet <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 12:32:28 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:45:03 2007 -0300

    V4L/DVB (5466): Fix up some Cafe CCIC delay issues
    
    Fix up unsociable Cafe CCIC delays.
    
    The Cafe CCIC driver contains some lengthy delays, some of which are
    unnecessary and some of which are done under lock.  Some were marked
    with comments, but the comments somehow failed to make the issue go
    away.  So fix it for real.
    
    Signed-off-by: Jonathan Corbet <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/cafe_ccic.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index f629c55..bfae5d2 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -705,7 +705,13 @@ static void cafe_ctlr_init(struct cafe_camera *cam)
        cafe_reg_write(cam, REG_GL_CSR, GCSR_SRS|GCSR_MRS); /* Needed? */
        cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRC);
        cafe_reg_write(cam, REG_GL_CSR, GCSR_SRC|GCSR_MRS);
+       /*
+        * Here we must wait a bit for the controller to come around.
+        */
+       spin_unlock_irqrestore(&cam->dev_lock, flags);
        mdelay(5);      /* FIXME revisit this */
+       spin_lock_irqsave(&cam->dev_lock, flags);
+
        cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC);
        cafe_reg_set_bit(cam, REG_GL_IMASK, GIMSK_CCIC_EN);
        /*
@@ -773,9 +779,9 @@ static void cafe_ctlr_power_up(struct cafe_camera *cam)
         * Control 1 is power down, set to 0 to operate.
         */
        cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN); /* pwr up, reset */
-       mdelay(1); /* Marvell says 1ms will do it */
+//     mdelay(1); /* Marvell says 1ms will do it */
        cafe_reg_write(cam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0);
-       mdelay(1); /* Enough? */
+//     mdelay(1); /* Enough? */
        spin_unlock_irqrestore(&cam->dev_lock, flags);
 }
 
@@ -1796,18 +1802,19 @@ static void cafe_frame_tasklet(unsigned long data)
                if (list_empty(&cam->sb_avail))
                        break;  /* Leave it valid, hope for better later */
                clear_bit(bufno, &cam->flags);
-               /*
-                * We could perhaps drop the spinlock during this
-                * big copy.  Something to consider.
-                */
                sbuf = list_entry(cam->sb_avail.next,
                                struct cafe_sio_buffer, list);
+               /*
+                * Drop the lock during the big copy.  This *should* be safe...
+                */
+               spin_unlock_irqrestore(&cam->dev_lock, flags);
                memcpy(sbuf->buffer, cam->dma_bufs[bufno],
                                cam->pix_format.sizeimage);
                sbuf->v4lbuf.bytesused = cam->pix_format.sizeimage;
                sbuf->v4lbuf.sequence = cam->buf_seq[bufno];
                sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_QUEUED;
                sbuf->v4lbuf.flags |= V4L2_BUF_FLAG_DONE;
+               spin_lock_irqsave(&cam->dev_lock, flags);
                list_move_tail(&sbuf->list, &cam->sb_full);
        }
        if (! list_empty(&cam->sb_full))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to