diff options
author | Thomas Fleury <tfleury@nvidia.com> | 2018-04-03 12:13:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-19 19:42:20 -0400 |
commit | 86bb766e16858126cbb59f3c6347a203a6038b25 (patch) | |
tree | 533ee3e2b1a678df0bac07576746232ca3ebfad4 /drivers/gpu/nvgpu/common/linux | |
parent | 5ab3524f915a72021701975c026a1f38eea577e9 (diff) |
gpu: nvgpu: assume 1:1 IPA to PA mapping for syncpt
Currently, hyp_read_ipa_pa_info() only translates IPA for RAM
mappings. It fails for MMIO mappings. In particular, it will
fail when attempting to translate addresses in the syncpoint
shim aperture. As a workaround, assume 1:1 IPA to PA mapping
when hyp_read_ipa_pa_info fails, and address is in syncpt
shim aperture.
Bug 2096877
Change-Id: I5267f0a8febf065157910ad3408374cacd398731
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1687796
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/soc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/soc.c b/drivers/gpu/nvgpu/common/linux/soc.c index 22645381..305d8bd9 100644 --- a/drivers/gpu/nvgpu/common/linux/soc.c +++ b/drivers/gpu/nvgpu/common/linux/soc.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -67,8 +67,21 @@ static u64 nvgpu_tegra_hv_ipa_pa(struct gk20a *g, u64 ipa) | |||
67 | 67 | ||
68 | err = hyp_read_ipa_pa_info(&info, platform->vmid, ipa); | 68 | err = hyp_read_ipa_pa_info(&info, platform->vmid, ipa); |
69 | if (err < 0) { | 69 | if (err < 0) { |
70 | nvgpu_err(g, "ipa=%llx translation failed vmid=%u err=%d", | 70 | /* WAR for bug 2096877 |
71 | * hyp_read_ipa_pa_info only looks up RAM mappings. | ||
72 | * assume one to one IPA:PA mapping for syncpt aperture | ||
73 | */ | ||
74 | u64 start = g->syncpt_unit_base; | ||
75 | u64 end = g->syncpt_unit_base + g->syncpt_unit_size; | ||
76 | if ((ipa >= start) && (ipa < end)) { | ||
77 | pa = ipa; | ||
78 | nvgpu_log(g, gpu_dbg_map_v, | ||
79 | "ipa=%llx vmid=%d -> pa=%llx (SYNCPT)\n", | ||
80 | ipa, platform->vmid, pa); | ||
81 | } else { | ||
82 | nvgpu_err(g, "ipa=%llx translation failed vmid=%u err=%d", | ||
71 | ipa, platform->vmid, err); | 83 | ipa, platform->vmid, err); |
84 | } | ||
72 | } else { | 85 | } else { |
73 | pa = info.base + info.offset; | 86 | pa = info.base + info.offset; |
74 | nvgpu_log(g, gpu_dbg_map_v, | 87 | nvgpu_log(g, gpu_dbg_map_v, |