Commit:     35d6270b806562b37279d3970fa477aaeb372829
Parent:     c430ca1e16b2b4b30f567806c73e270caea8db1d
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 14 10:14:17 2007 -0200
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Mon Jan 15 16:25:28 2007 -0200

    V4L/DVB (5020): Fix: disable interrupts while at KM_BOUNCE_READ
    vivi.c uses the KM_BOUNCE_READ with local interrupts enabled.
    This means that if a disk interrupt occurs while vivi.c is using this
    fixmap slot, the vivi.c driver will, upon return from that interrupt, find
    that the fixmap slot now points at a different physical page.
    The net result will probably be rare corruption of disk file contents,
    because viv.c will now be altering the page which the disk code was
    recently using.
    Thanks to Andrew Morton for pointing this.
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
 drivers/media/video/vivi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index bacb311..d4cf556 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -270,10 +270,15 @@ static void gen_line(struct sg_to_addr to_addr[],int 
inipos,int pages,int wmax,
        char *p,*s,*basep;
        struct page *pg;
        u8   chr,r,g,b,color;
+       unsigned long flags;
+       spinlock_t spinlock;
+       spin_lock_init(&spinlock);
        /* Get first addr pointed to pixel position */
        pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT);
+       spin_lock_irqsave(&spinlock,flags);
        basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset;
        /* We will just duplicate the second pixel at the packet */
@@ -376,6 +381,8 @@ static void gen_line(struct sg_to_addr to_addr[],int 
inipos,int pages,int wmax,
        kunmap_atomic(basep, KM_BOUNCE_READ);
+       spin_unlock_irqrestore(&spinlock,flags);
 static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
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

Reply via email to