diff options
author | Qiao Zhou <zhouqiao@marvell.com> | 2015-02-04 09:16:03 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-23 19:39:56 +0300 |
commit | 3a314f143d82603bd697d7eb6c76518afc3595bc (patch) | |
tree | 8dcf4d43da8ad0c9a3fc4176896525eadef7ec31 /drivers/dma/mmp_pdma.c | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
download | linux-3a314f143d82603bd697d7eb6c76518afc3595bc.tar.xz |
dmaenegine: mmp-pdma: fix irq handler overwrite physical chan issue
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 <zhouqiao@marvell.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/mmp_pdma.c')
-rw-r--r-- | drivers/dma/mmp_pdma.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 8926f271904e..abf1450bb25d 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -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); |