]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] davinci: vpif: capture/display: fix race condition
authorLad, Prabhakar <prabhakar.lad@ti.com>
Fri, 14 Sep 2012 13:22:24 +0000 (10:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 20:22:02 +0000 (17:22 -0300)
channel_first_int[][] variable is used as a flag for the ISR,
This flag was being set after enabling the interrupts, There
where situations when the isr occurred even before the flag was set
dues to which it was causing the application hang.
This patch sets  channel_first_int[][] flag just before enabling the
interrupt.

Reported-by: David Oleszkiewicz <doleszki@adsyscontrols.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/davinci/vpif_capture.c
drivers/media/platform/davinci/vpif_display.c

index 13aa46dc2f336347a23f58296a411440ae80bd62..0bafecac4923bce09cef1850ebb3660a62401609 100644 (file)
@@ -339,6 +339,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
         * Set interrupt for both the fields in VPIF Register enable channel in
         * VPIF register
         */
+       channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
        if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) {
                channel0_intr_assert();
                channel0_intr_enable(1);
@@ -350,7 +351,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
                channel1_intr_enable(1);
                enable_channel1(1);
        }
-       channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
 
        return 0;
 }
index 8003c56487bb8ebd6c3d3e5424b5a38a1babaaeb..a5b88689abad1d9055c45f6624190d68734dbf30 100644 (file)
@@ -302,6 +302,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
 
        /* Set interrupt for both the fields in VPIF
            Register enable channel in VPIF register */
+       channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
        if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {
                channel2_intr_assert();
                channel2_intr_enable(1);
@@ -318,7 +319,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
                if (vpif_config_data->ch3_clip_en)
                        channel3_clipping_enable(1);
        }
-       channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
 
        return 0;
 }