[PATCH] instmem/gk20a: set DMA mask early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DMA mask is typically set in nouveau_ttm_init(), but this function is
called late during initialization and GK20A's instmem will have called
DMA functions before this happens.

Having a wrongly set DMA mask can result in the use of unneeded bounce
buffers. Set it in GK20A's instmem constructor to avoid this.

Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
 drm/nouveau/nvkm/subdev/instmem/gk20a.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drm/nouveau/nvkm/subdev/instmem/gk20a.c
index 6b8f2a19b2d9..4c3c744c5c6b 100644
--- a/drm/nouveau/nvkm/subdev/instmem/gk20a.c
+++ b/drm/nouveau/nvkm/subdev/instmem/gk20a.c
@@ -576,6 +576,7 @@ gk20a_instmem_new(struct nvkm_device *device, int index,
 {
 	struct nvkm_device_tegra *tdev = device->func->tegra(device);
 	struct gk20a_instmem *imem;
+	int ret;
 
 	if (!(imem = kzalloc(sizeof(*imem), GFP_KERNEL)))
 		return -ENOMEM;
@@ -583,6 +584,10 @@ gk20a_instmem_new(struct nvkm_device *device, int index,
 	spin_lock_init(&imem->lock);
 	*pimem = &imem->base;
 
+	ret = dma_set_mask(device->dev, DMA_BIT_MASK(tdev->func->iommu_bit));
+	if (ret)
+		return ret;
+
 	/* do not allow more than 1MB of CPU-mapped instmem */
 	imem->vaddr_use = 0;
 	imem->vaddr_max = 0x100000;
-- 
2.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux