linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: arasan: Use the right DMA mask
@ 2021-05-27  8:45 Miquel Raynal
  2021-05-27 13:00 ` jorge courett
  2021-06-11 19:03 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Miquel Raynal @ 2021-05-27  8:45 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Michal Simek, Naga Sureshkumar Relli, Amit Kumar Mahapatra,
	Thomas Petazzoni, Miquel Raynal, Jorge Courett

Xilinx ZynqMP SoC and the Arasan controller support 64-bit DMA
addressing. Define the right mask otherwise the default is 32
and some accesses may overflow the default mask.

Reported-by: Jorge Courett <jorge.courett@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/arasan-nand-controller.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/nand/raw/arasan-nand-controller.c
index 97e5a336a760..6e8d33173c6b 100644
--- a/drivers/mtd/nand/raw/arasan-nand-controller.c
+++ b/drivers/mtd/nand/raw/arasan-nand-controller.c
@@ -1398,6 +1398,10 @@ static int anfc_probe(struct platform_device *pdev)
 	if (ret)
 		goto disable_controller_clk;
 
+	ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+	if (ret)
+		return ret;
+
 	ret = anfc_parse_cs(nfc);
 	if (ret)
 		goto disable_bus_clk;
-- 
2.27.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: arasan: Use the right DMA mask
  2021-05-27  8:45 [PATCH] mtd: rawnand: arasan: Use the right DMA mask Miquel Raynal
@ 2021-05-27 13:00 ` jorge courett
  2021-06-11 19:03 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: jorge courett @ 2021-05-27 13:00 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
	linux-mtd, Michal Simek, Naga Sureshkumar Relli,
	Amit Kumar Mahapatra, Thomas Petazzoni

On Thu, May 27, 2021 at 5:45 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Xilinx ZynqMP SoC and the Arasan controller support 64-bit DMA
> addressing. Define the right mask otherwise the default is 32
> and some accesses may overflow the default mask.
>
> Reported-by: Jorge Courett <jorge.courett@gmail.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Tested-by: Jorge Courett <jorge.courett@gmail.com>
>
> ---
>  drivers/mtd/nand/raw/arasan-nand-controller.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/nand/raw/arasan-nand-controller.c
> index 97e5a336a760..6e8d33173c6b 100644
> --- a/drivers/mtd/nand/raw/arasan-nand-controller.c
> +++ b/drivers/mtd/nand/raw/arasan-nand-controller.c
> @@ -1398,6 +1398,10 @@ static int anfc_probe(struct platform_device *pdev)
>         if (ret)
>                 goto disable_controller_clk;
>
> +       ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
> +       if (ret)
> +               return ret;
> +
>         ret = anfc_parse_cs(nfc);
>         if (ret)
>                 goto disable_bus_clk;
> --
> 2.27.0
>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: arasan: Use the right DMA mask
  2021-05-27  8:45 [PATCH] mtd: rawnand: arasan: Use the right DMA mask Miquel Raynal
  2021-05-27 13:00 ` jorge courett
@ 2021-06-11 19:03 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2021-06-11 19:03 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Michal Simek, Naga Sureshkumar Relli, Amit Kumar Mahapatra,
	Thomas Petazzoni, Jorge Courett

On Thu, 2021-05-27 at 08:45:48 UTC, Miquel Raynal wrote:
> Xilinx ZynqMP SoC and the Arasan controller support 64-bit DMA
> addressing. Define the right mask otherwise the default is 32
> and some accesses may overflow the default mask.
> 
> Reported-by: Jorge Courett <jorge.courett@gmail.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Tested-by: Jorge Courett <jorge.courett@gmail.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2021-06-11 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27  8:45 [PATCH] mtd: rawnand: arasan: Use the right DMA mask Miquel Raynal
2021-05-27 13:00 ` jorge courett
2021-06-11 19:03 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).