From 1bf9b91c05ceebf872171a536c2660ee69fa5f64 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 12 Dec 2017 15:07:50 -0800 Subject: gpu: nvgpu: gv11b: get syncpt aperture only if host1x is present nvgpu_get_nvhost_dev will not return error if host1x field within gv11b device tree is not present. It will just set has_syncpoints in gk20a struct to false. syncpt_unit_interface* should be called only if g->has_syncpoints is set to true. Change-Id: Id1eb94aba4cff1942ad519f528ebdb8291963971 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1615973 Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../gpu/nvgpu/common/linux/platform_gv11b_tegra.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c index a2a60aaa..42f59a26 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gv11b_tegra.c @@ -59,18 +59,24 @@ static int gv11b_tegra_probe(struct device *dev) return err; } - err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( + if (g->has_syncpoints) { + err = nvgpu_nvhost_syncpt_unit_interface_get_aperture( g->nvhost_dev, &g->syncpt_unit_base, &g->syncpt_unit_size); - if (err) { - dev_err(dev, "Failed to get syncpt interface"); - return -ENOSYS; + if (err) { + dev_err(dev, "Failed to get syncpt interface"); + return -ENOSYS; + } + g->syncpt_size = + nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); + nvgpu_info(g, "syncpt_unit_base %llx " + "syncpt_unit_size %zx size %x\n", + g->syncpt_unit_base, g->syncpt_unit_size, + g->syncpt_size); } - g->syncpt_size = nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(1); - gk20a_dbg_info("syncpt_unit_base %llx syncpt_unit_size %zx size %x\n", - g->syncpt_unit_base, g->syncpt_unit_size, - g->syncpt_size); +#else + g->has_syncpoints = false; #endif platform->bypass_smmu = !device_is_iommuable(dev); -- cgit v1.2.2