Skip to content

Commit

Permalink
dmaenegine: mmp-pdma: fix irq handler overwrite physical chan issue
Browse files Browse the repository at this point in the history
Some dma channels may be reserved for other purpose in other layer,
like secure driver in EL2/EL3. PDMA driver can see the interrupt
status, but it should not try to handle related interrupt, since it
doesn't belong to PDMA driver in kernel. These interrupts should be
handled by corresponding client/module.Otherwise, it will overwrite
illegal memory and cause unexpected issues, since pdma driver only
requests resources for pdma channels.

In PDMA driver, the reserved channels are at the end of total 32
channels. If we find interrupt bit index is not smaller than total
dma channels, we should ignore it.

Signed-off-by: Qiao Zhou <[email protected]>
Acked-by: Zhangfei Gao <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
Qiao Zhou authored and Vinod Koul committed Feb 23, 2015
1 parent c517d83 commit 3a314f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/dma/mmp_pdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ static irqreturn_t mmp_pdma_int_handler(int irq, void *dev_id)

while (dint) {
i = __ffs(dint);
/* only handle interrupts belonging to pdma driver*/
if (i >= pdev->dma_channels)
break;
dint &= (dint - 1);
phy = &pdev->phy[i];
ret = mmp_pdma_chan_handler(irq, phy);
Expand Down

0 comments on commit 3a314f1

Please sign in to comment.