From 24c38aed5913f0007f35f1ff507c099e70862097 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Tue, 23 Aug 2016 10:06:16 -0700 Subject: gpu: nvgpu: fix pmu_copy_to_dmem spew The error check was not taking account of the DMEM address wrap-around JIRA DNVGPU-34 Change-Id: Ibfed5532c3ee785b3061e6837f012939118a7ece Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1206460 (cherry picked from commit 080953c20f91068ccaaa564d9492a1582ffa28fe) Reviewed-on: http://git-master/r/1218297 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 539ad44e..98d6e2df 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -2066,7 +2066,7 @@ void pmu_copy_to_dmem(struct pmu_gk20a *pmu, data = gk20a_readl(g, pwr_falcon_dmemc_r(port)) & addr_mask; size = ALIGN(size, 4); - if (data != dst + size) { + if (data != ((dst + size) & addr_mask)) { gk20a_err(dev_from_gk20a(g), "copy failed. bytes written %d, expected %d", data - dst, size); -- cgit v1.2.2