Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mtd: nand: brcmnand: Set appropriate DMA mask
@ 2019-12-18  0:56 Florian Fainelli
  2020-01-14 17:07 ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2019-12-18  0:56 UTC (permalink / raw)
  To: linux-mtd
  Cc: Florian Fainelli, Vignesh Raghavendra, Kamal Dasu,
	Richard Weinberger, open list,
	open list:BROADCOM STB NAND FLASH DRIVER, Miquel Raynal,
	Brian Norris

NAND controllers >= 7.0 with FLASH_DMA support physical addresses up to
40-bit, set an appropriate DMA mask for that purpose.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 1a66b1cd51c0..44518dada75b 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -2635,6 +2635,16 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 		/* initialize the dma version */
 		brcmnand_flash_dma_revision_init(ctrl);
 
+		ret = -EIO;
+		if (ctrl->nand_version >= 0x0700)
+			ret = dma_set_mask_and_coherent(&pdev->dev,
+							DMA_BIT_MASK(40));
+		if (ret)
+			ret = dma_set_mask_and_coherent(&pdev->dev,
+							DMA_BIT_MASK(32));
+		if (ret)
+			goto err;
+
 		/* linked-list and stop on error */
 		flash_dma_writel(ctrl, FLASH_DMA_MODE, FLASH_DMA_MODE_MASK);
 		flash_dma_writel(ctrl, FLASH_DMA_ERROR_STATUS, 0);
-- 
2.17.1


______________________________________________________
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: nand: brcmnand: Set appropriate DMA mask
  2019-12-18  0:56 [PATCH] mtd: nand: brcmnand: Set appropriate DMA mask Florian Fainelli
@ 2020-01-14 17:07 ` Miquel Raynal
  2020-01-14 17:29   ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: Miquel Raynal @ 2020-01-14 17:07 UTC (permalink / raw)
  To: Florian Fainelli, linux-mtd
  Cc: Vignesh Raghavendra, Kamal Dasu, Richard Weinberger, open list,
	open list:BROADCOM STB NAND FLASH DRIVER, Miquel Raynal,
	Brian Norris

On Wed, 2019-12-18 at 00:56:35 UTC, Florian Fainelli wrote:
> NAND controllers >= 7.0 with FLASH_DMA support physical addresses up to
> 40-bit, set an appropriate DMA mask for that purpose.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

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

Miquel

______________________________________________________
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: nand: brcmnand: Set appropriate DMA mask
  2020-01-14 17:07 ` Miquel Raynal
@ 2020-01-14 17:29   ` Miquel Raynal
  0 siblings, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2020-01-14 17:29 UTC (permalink / raw)
  To: Florian Fainelli, linux-mtd
  Cc: Vignesh Raghavendra, Kamal Dasu, Richard Weinberger, open list,
	open list:BROADCOM STB NAND FLASH DRIVER, Brian Norris

Hello,

Miquel Raynal <miquel.raynal@bootlin.com> wrote on Tue, 14 Jan 2020
18:07:10 +0100:

> On Wed, 2019-12-18 at 00:56:35 UTC, Florian Fainelli wrote:
> > NAND controllers >= 7.0 with FLASH_DMA support physical addresses up to
> > 40-bit, set an appropriate DMA mask for that purpose.
> > 
> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>  
> 
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

As an FYI, the subject prefix should have been "mtd: rawnand: brcmnand:". I
changed it before applying.


Thanks,
Miquèl

______________________________________________________
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, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18  0:56 [PATCH] mtd: nand: brcmnand: Set appropriate DMA mask Florian Fainelli
2020-01-14 17:07 ` Miquel Raynal
2020-01-14 17:29   ` Miquel Raynal

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/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 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


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