2019-10-04 15:12:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ

platform_get_irq_byname() might return -errno which later would be cast
to an unsigned int and used in IRQ handling code leading to usage of
wrong ID and errors about wrong irq_base.

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

Not marking as cc-stable as this was not reproduced and not tested.
---
drivers/dma/fsl-qdma.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index 06664fbd2d91..89792083d62c 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -1155,6 +1155,9 @@ static int fsl_qdma_probe(struct platform_device *pdev)
return ret;

fsl_qdma->irq_base = platform_get_irq_byname(pdev, "qdma-queue0");
+ if (fsl_qdma->irq_base < 0)
+ return fsl_qdma->irq_base;
+
fsl_qdma->feature = of_property_read_bool(np, "big-endian");
INIT_LIST_HEAD(&fsl_qdma->dma_dev.channels);

--
2.17.1


2019-10-21 09:55:21

by Peng Ma

[permalink] [raw]
Subject: RE: [EXT] [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ

Hi Krzysztof,

Thanks for your patch.
Reviewed-by: Peng Ma <[email protected]>
Tested-by: Peng Ma <[email protected]>

Best Regards,
Peng
>-----Original Message-----
>From: Krzysztof Kozlowski <[email protected]>
>Sent: 2019??10??4?? 23:08
>To: Vinod Koul <[email protected]>; Dan Williams <[email protected]>;
>Peng Ma <[email protected]>; Wen He <[email protected]>; Jiaheng Fan
><[email protected]>; Krzysztof Kozlowski <[email protected]>;
>[email protected]; [email protected]
>Subject: [EXT] [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ
>
>Caution: EXT Email
>
>platform_get_irq_byname() might return -errno which later would be cast to an
>unsigned int and used in IRQ handling code leading to usage of wrong ID and
>errors about wrong irq_base.
>
>Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
>---
>
>Not marking as cc-stable as this was not reproduced and not tested.
>---
> drivers/dma/fsl-qdma.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index
>06664fbd2d91..89792083d62c 100644
>--- a/drivers/dma/fsl-qdma.c
>+++ b/drivers/dma/fsl-qdma.c
>@@ -1155,6 +1155,9 @@ static int fsl_qdma_probe(struct platform_device
>*pdev)
> return ret;
>
> fsl_qdma->irq_base = platform_get_irq_byname(pdev,
>"qdma-queue0");
>+ if (fsl_qdma->irq_base < 0)
>+ return fsl_qdma->irq_base;
>+
> fsl_qdma->feature = of_property_read_bool(np, "big-endian");
> INIT_LIST_HEAD(&fsl_qdma->dma_dev.channels);
>
>--
>2.17.1

2019-11-02 16:27:05

by Vinod Koul

[permalink] [raw]
Subject: Re: [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ

On 04-10-19, 17:08, Krzysztof Kozlowski wrote:
> platform_get_irq_byname() might return -errno which later would be cast
> to an unsigned int and used in IRQ handling code leading to usage of
> wrong ID and errors about wrong irq_base.

Applied, thanks

--
~Vinod