idma64: Don't try to serve interrupts when device is powered off
Subsystems (2)
Andy Shevchenko
reviewerPATCH 1/1 idma64: Don't try to serve interrupts when device is powered off
When iDMA 64-bit device is powered off, the IRQ status register is all 1:s. This is never happen in real case and signalling that the device is simply powered off. Don't try to serve interrupts that are not ours.
--- drivers/dma/idma64.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/dma/idma64.c +4 -0
@@ -173,6 +173,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)dev_vdbg (idma64->dma.dev,"%s: status=%#x\n" , __func__, status); +/* Since IRQ may be shared, check if DMA controller is powered on */ +if (status ==GENMASK (31 ,0 )) +return IRQ_NONE ; +/* Check if we have any interrupt from the DMA controller */ if (!status)return IRQ_NONE ;
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
Andy Shevchenko
reviewerQuoted 4 lines · Andy Shevchenko
When iDMA 64-bit device is powered off, the IRQ status register is all 1:s. This is never happen in real case and signalling that the device is simply powered off. Don't try to serve interrupts that are not ours.
...
Quoted 1 line
dev_vdbg(idma64->dma.dev, "%s: status=%#x\n", __func__, status);
Dunno if I actually also need to move this message to after the checks...
Quoted 7 lines
drivers/dma/idma64.c +4
-0+/* Since IRQ may be shared, check if DMA controller is powered on */ +if (status ==GENMASK (31 ,0 )) +return IRQ_NONE ; +/* Check if we have any interrupt from the DMA controller */ if (!status)return IRQ_NONE ;
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
drivers/dma/idma64.c +0
-0@@ -173,6 +173,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)
drivers/dma/idma64.c static irqreturn_t idma64_irq(int irq, void *dev)
Quoted 10 lines
drivers/dma/idma64.c +4
-1dev_vdbg (idma64->dma.dev,"%s: status=%#x\n" , __func__, status); +/* Since IRQ may be shared, check if DMA controller is powered on */ +if (status ==GENMASK (31 ,0 )) +return IRQ_NONE ; +/* Check if we have any interrupt from the DMA controller */ if (!status)return IRQ_NONE ; -- 2.43.0.rc1.1.gbec44491f096
Andy Shevchenko
reviewerQuoted 1 line · Heiner Kallweit
On 20.03.2024 17:32, Andy Shevchenko wrote:
...
Quoted 12 lines
drivers/dma/idma64.c static irqreturn_t idma64_irq(int irq, void *dev)
Quoted 10 lines
drivers/dma/idma64.c +4
-1dev_vdbg (idma64->dma.dev,"%s: status=%#x\n" , __func__, status); +/* Since IRQ may be shared, check if DMA controller is powered on */ +if (status ==GENMASK (31 ,0 )) +return IRQ_NONE ; +/* Check if we have any interrupt from the DMA controller */ if (!status)return IRQ_NONE ; -- 2.43.0.rc1.1.gbec44491f096Tested-by Heiner Kallweit <[email protected]>
Thank you! I think I'll move the test to be before the debug message as it makes no sense to print when we have powered off device. Nevertheless, I'll take your tag if no objections for v2.
Signature · 2 lines
With Best Regards, Andy Shevchenko