diff mbox

[2/2] iommu/tegra: gart: Reserve iomem resource

Message ID 1340175873-12531-2-git-send-email-hdoyu@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Hiroshi Doyu June 20, 2012, 7:04 a.m. UTC
From: Hiroshi DOYU <hdoyu@nvidia.com>

GART Register/Aperture range should be reserved.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Lucas Stach <dev@lynxeye.de>
---
 drivers/iommu/tegra-gart.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Comments

Stephen Warren June 20, 2012, 4:01 p.m. UTC | #1
On 06/20/2012 01:04 AM, Hiroshi DOYU wrote:
> From: Hiroshi DOYU <hdoyu@nvidia.com>
> 
> GART Register/Aperture range should be reserved.
> 
> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Lucas Stach <dev@lynxeye.de>

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 33a23b6..a431006 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -366,12 +366,18 @@  static int tegra_gart_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	gart_regs = devm_ioremap(dev, res->start, resource_size(res));
+	gart_regs = devm_request_and_ioremap(dev, res);
 	if (!gart_regs) {
 		dev_err(dev, "failed to remap GART registers\n");
 		return -ENXIO;
 	}
 
+	if (!devm_request_mem_region(dev, res_remap->start,
+				     resource_size(res_remap), dev_name(dev))) {
+		dev_err(dev, "failed to reserve GART aperture\n");
+		return -EBUSY;
+	}
+
 	gart->dev = &pdev->dev;
 	spin_lock_init(&gart->pte_lock);
 	spin_lock_init(&gart->client_lock);