Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memory: tegra: Set DMA mask based on supported address bits

The memory controller on Tegra124 and later supports 34 or more address
bits. Advertise that by setting the DMA mask based on the number of the
address bits.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+10
+10
drivers/memory/tegra/mc.c
··· 5 5 6 6 #include <linux/clk.h> 7 7 #include <linux/delay.h> 8 + #include <linux/dma-mapping.h> 8 9 #include <linux/interrupt.h> 9 10 #include <linux/kernel.h> 10 11 #include <linux/module.h> ··· 627 626 struct resource *res; 628 627 struct tegra_mc *mc; 629 628 void *isr; 629 + u64 mask; 630 630 int err; 631 631 632 632 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); ··· 638 636 spin_lock_init(&mc->lock); 639 637 mc->soc = of_device_get_match_data(&pdev->dev); 640 638 mc->dev = &pdev->dev; 639 + 640 + mask = DMA_BIT_MASK(mc->soc->num_address_bits); 641 + 642 + err = dma_coerce_mask_and_coherent(&pdev->dev, mask); 643 + if (err < 0) { 644 + dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err); 645 + return err; 646 + } 641 647 642 648 /* length of MC tick in nanoseconds */ 643 649 mc->tick = 30;