]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: fix bad address translation for sienna_cichlid
authorStanley.Yang <Stanley.Yang@amd.com>
Wed, 16 Jun 2021 13:14:01 +0000 (21:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 08:01:02 +0000 (10:01 +0200)
[ Upstream commit 6ec598cc9dfbf40433e94a2ed1a622e3ef80268b ]

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
drivers/gpu/drm/amd/amdgpu/umc_v8_7.c

index 18381449365800c70ca8e5855c85af2da94f8454..bda4438c39256c00ce6de749471462af7f1db7fc 100644 (file)
 #ifndef __AMDGPU_UMC_H__
 #define __AMDGPU_UMC_H__
 
+/*
+ * (addr / 256) * 4096, the higher 26 bits in ErrorAddr
+ * is the index of 4KB block
+ */
+#define ADDR_OF_4KB_BLOCK(addr)                        (((addr) & ~0xffULL) << 4)
 /*
  * (addr / 256) * 8192, the higher 26 bits in ErrorAddr
  * is the index of 8KB block
index a064c097690c7d9ae060e126bc9fa9a382817d98..66fd797a6f0ec30e6fab2fa00d9080dcdc594274 100644 (file)
@@ -233,7 +233,7 @@ static void umc_v8_7_query_error_address(struct amdgpu_device *adev,
                err_addr &= ~((0x1ULL << lsb) - 1);
 
                /* translate umc channel address to soc pa, 3 parts are included */
-               retired_page = ADDR_OF_8KB_BLOCK(err_addr) |
+               retired_page = ADDR_OF_4KB_BLOCK(err_addr) |
                                ADDR_OF_256B_BLOCK(channel_index) |
                                OFFSET_IN_256B_BLOCK(err_addr);