Skip to content

Commit

Permalink
[media] davinci: vpif: capture/display: fix race condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lad, Prabhakar authored and Mauro Carvalho Chehab committed Sep 26, 2012
1 parent 080fb42 commit 9e18404
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/media/platform/davinci/vpif_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/davinci/vpif_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 9e18404

Please sign in to comment.