From f090e6aa236d5e6acad362354839366d0da6119b Mon Sep 17 00:00:00 2001 From: Bitan Biswas Date: Mon, 17 Aug 2020 13:59:38 -0700 Subject: [PATCH] drivers: gpu: remove archdata.iommu Fix k5.9 build error for archdata.iommu Replace use of dev->archdata.iommu with iommu_get_domain_for_dev() Change-Id: Ic1efb864046a08a7ea9b1810114bdadef20f6adf Signed-off-by: Bitan Biswas Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2402360 Reviewed-by: automaticguardword Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Pritesh Raithatha Reviewed-by: Sachin Nikam Reviewed-by: Sagar Kamble Reviewed-by: mobile promotions Tested-by: Sagar Kamble Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/linux-dma.c | 6 +++--- drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c | 4 +++- drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/linux-dma.c b/drivers/gpu/nvgpu/os/linux/linux-dma.c index 4687f0d72..83e238d83 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-dma.c +++ b/drivers/gpu/nvgpu/os/linux/linux-dma.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -604,7 +604,7 @@ bool nvgpu_iommuable(struct gk20a *g) * Check against the nvgpu device to see if it's been marked as * IOMMU'able. */ - if (dev->archdata.iommu == NULL) + if (iommu_get_domain_for_dev(dev) == NULL) return false; #endif diff --git a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c index f356ab9ff..e4c31979d 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef CONFIG_TEGRA_BWMGR #include #endif @@ -204,7 +205,8 @@ static int gp10b_tegra_probe(struct device *dev) if (ret) return ret; - platform->disable_bigpage = !dev->archdata.iommu && (PAGE_SIZE < SZ_64K); + platform->disable_bigpage = !iommu_get_domain_for_dev(dev) && + (PAGE_SIZE < SZ_64K); #ifdef CONFIG_OF of_chosen = of_find_node_by_path("/chosen"); diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index 6e8477934..6311c9f10 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef CONFIG_TEGRA_BWMGR #include #endif @@ -94,7 +95,8 @@ static int gv11b_tegra_probe(struct device *dev) if (err) return err; - platform->disable_bigpage = !dev->archdata.iommu && (PAGE_SIZE < SZ_64K); + platform->disable_bigpage = !(iommu_get_domain_for_dev(dev)) && + (PAGE_SIZE < SZ_64K); #ifdef CONFIG_OF of_chosen = of_find_node_by_path("/chosen");