Commit b1fc4230 authored by Manjunath Hadli's avatar Manjunath Hadli Committed by Mauro Carvalho Chehab

[media] davinci: vpif: add check for genuine interrupts in the isr

As the same interrupt is shared between capture and display devices,
sometimes we get isr calls where the interrupt might not genuinely belong
to capture or display. Hence, add a condition in the isr to check for
interrupt ownership and channel number to make sure we do not
service wrong interrupts.
Signed-off-by: default avatarManjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4099040e
...@@ -569,6 +569,21 @@ static inline void ch3_set_vbi_addr(unsigned long top_strt_luma, ...@@ -569,6 +569,21 @@ static inline void ch3_set_vbi_addr(unsigned long top_strt_luma,
regw(btm_strt_luma, VPIF_CH3_BTM_STRT_ADD_VANC); regw(btm_strt_luma, VPIF_CH3_BTM_STRT_ADD_VANC);
} }
static inline int vpif_intr_status(int channel)
{
int status = 0;
int mask;
if (channel < 0 || channel > 3)
return 0;
mask = 1 << channel;
status = regr(VPIF_STATUS) & mask;
regw(status, VPIF_STATUS_CLR);
return status;
}
#define VPIF_MAX_NAME (30) #define VPIF_MAX_NAME (30)
/* This structure will store size parameters as per the mode selected by user */ /* This structure will store size parameters as per the mode selected by user */
......
...@@ -341,6 +341,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id) ...@@ -341,6 +341,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
int fid = -1, i; int fid = -1, i;
channel_id = *(int *)(dev_id); channel_id = *(int *)(dev_id);
if (!vpif_intr_status(channel_id))
return IRQ_NONE;
ch = dev->dev[channel_id]; ch = dev->dev[channel_id];
field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field;
......
...@@ -307,6 +307,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id) ...@@ -307,6 +307,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
int channel_id = 0; int channel_id = 0;
channel_id = *(int *)(dev_id); channel_id = *(int *)(dev_id);
if (!vpif_intr_status(channel_id + 2))
return IRQ_NONE;
ch = dev->dev[channel_id]; ch = dev->dev[channel_id];
field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field;
for (i = 0; i < VPIF_NUMOBJECTS; i++) { for (i = 0; i < VPIF_NUMOBJECTS; i++) {
......
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