dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ
@ 2019-10-04 15:08 Krzysztof Kozlowski
  2019-10-21  9:54 ` [EXT] " Peng Ma
  2019-11-02 16:26 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-04 15:08 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Peng Ma, Wen He, Jiaheng Fan,
	Krzysztof Kozlowski, dmaengine, linux-kernel

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 <krzk@kernel.org>

---

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [EXT] [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ
  2019-10-04 15:08 [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ Krzysztof Kozlowski
@ 2019-10-21  9:54 ` " Peng Ma
  2019-11-02 16:26 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Ma @ 2019-10-21  9:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Vinod Koul, Dan Williams, Wen He,
	Jiaheng Fan, dmaengine, linux-kernel

Hi Krzysztof,

Thanks for your patch.
Reviewed-by: Peng Ma <peng.ma@nxp.com>
Tested-by: Peng Ma <peng.ma@nxp.com>

Best Regards,
Peng
>-----Original Message-----
>From: Krzysztof Kozlowski <krzk@kernel.org>
>Sent: 2019年10月4日 23:08
>To: Vinod Koul <vkoul@kernel.org>; Dan Williams <dan.j.williams@intel.com>;
>Peng Ma <peng.ma@nxp.com>; Wen He <wen.he_1@nxp.com>; Jiaheng Fan
><jiaheng.fan@nxp.com>; Krzysztof Kozlowski <krzk@kernel.org>;
>dmaengine@vger.kernel.org; linux-kernel@vger.kernel.org
>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 <krzk@kernel.org>
>
>---
>
>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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ
  2019-10-04 15:08 [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ Krzysztof Kozlowski
  2019-10-21  9:54 ` [EXT] " Peng Ma
@ 2019-11-02 16:26 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2019-11-02 16:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Dan Williams, Peng Ma, Wen He, Jiaheng Fan, dmaengine, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 15:08 [RFT] dmaengine: fsl-qdma: Handle invalid qdma-queue0 IRQ Krzysztof Kozlowski
2019-10-21  9:54 ` [EXT] " Peng Ma
2019-11-02 16:26 ` Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git