aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLad, Prabhakar <prabhakar.lad@ti.com>2012-09-14 09:22:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-26 16:22:02 -0400
commit9e18404adac2e8396335eb8e4cb380f619186042 (patch)
treef27f4da83778b5880c772baccf6900f7959eae1c
parent080fb42b2b1764f3d90d5b69cc7858da1e13be0d (diff)
[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: 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>
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c2
-rw-r--r--drivers/media/platform/davinci/vpif_display.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 13aa46dc2f33..0bafecac4923 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -339,6 +339,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
339 * Set interrupt for both the fields in VPIF Register enable channel in 339 * Set interrupt for both the fields in VPIF Register enable channel in
340 * VPIF register 340 * VPIF register
341 */ 341 */
342 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
342 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) { 343 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) {
343 channel0_intr_assert(); 344 channel0_intr_assert();
344 channel0_intr_enable(1); 345 channel0_intr_enable(1);
@@ -350,7 +351,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
350 channel1_intr_enable(1); 351 channel1_intr_enable(1);
351 enable_channel1(1); 352 enable_channel1(1);
352 } 353 }
353 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
354 354
355 return 0; 355 return 0;
356} 356}
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 8003c56487bb..a5b88689abad 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -302,6 +302,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
302 302
303 /* Set interrupt for both the fields in VPIF 303 /* Set interrupt for both the fields in VPIF
304 Register enable channel in VPIF register */ 304 Register enable channel in VPIF register */
305 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
305 if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { 306 if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {
306 channel2_intr_assert(); 307 channel2_intr_assert();
307 channel2_intr_enable(1); 308 channel2_intr_enable(1);
@@ -318,7 +319,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
318 if (vpif_config_data->ch3_clip_en) 319 if (vpif_config_data->ch3_clip_en)
319 channel3_clipping_enable(1); 320 channel3_clipping_enable(1);
320 } 321 }
321 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
322 322
323 return 0; 323 return 0;
324} 324}