Commit 9e18404a authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab

[media] davinci: vpif: capture/display: fix race condition

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: default avatarDavid Oleszkiewicz <doleszki@adsyscontrols.com>
Signed-off-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: default avatarManjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 080fb42b
...@@ -339,6 +339,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -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 * Set interrupt for both the fields in VPIF Register enable channel in
* VPIF register * VPIF register
*/ */
channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) { if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) {
channel0_intr_assert(); channel0_intr_assert();
channel0_intr_enable(1); channel0_intr_enable(1);
...@@ -350,7 +351,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -350,7 +351,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
channel1_intr_enable(1); channel1_intr_enable(1);
enable_channel1(1); enable_channel1(1);
} }
channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
return 0; return 0;
} }
......
...@@ -302,6 +302,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -302,6 +302,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
/* Set interrupt for both the fields in VPIF /* Set interrupt for both the fields in VPIF
Register enable channel in VPIF register */ Register enable channel in VPIF register */
channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {
channel2_intr_assert(); channel2_intr_assert();
channel2_intr_enable(1); channel2_intr_enable(1);
...@@ -318,7 +319,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -318,7 +319,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
if (vpif_config_data->ch3_clip_en) if (vpif_config_data->ch3_clip_en)
channel3_clipping_enable(1); channel3_clipping_enable(1);
} }
channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment