]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/hns: Fix 1bit-ECC recovery address in non-4K OS
authorChengchang Tang <tangchengchang@huawei.com>
Fri, 6 Sep 2024 09:34:42 +0000 (17:34 +0800)
committerLeon Romanovsky <leon@kernel.org>
Tue, 10 Sep 2024 13:06:39 +0000 (16:06 +0300)
The 1bit-ECC recovery address read from HW only contain bits 64:12, so
it should be fixed left-shifted 12 bits when used.

Currently, the driver will shift the address left by PAGE_SHIFT when
used, which is wrong in non-4K OS.

Fixes: 2de949abd6a5 ("RDMA/hns: Recover 1bit-ECC error of RAM on chip")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20240906093444.3571619-8-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index 5483d04b3ab7e3a2f55e9a31fc7c8ddcbc2d16bd..349b68d7e7db60b560f77b8d96b7cab1d30f602a 100644 (file)
@@ -6285,7 +6285,7 @@ static u64 fmea_get_ram_res_addr(u32 res_type, __le64 *data)
            res_type == ECC_RESOURCE_SCCC)
                return le64_to_cpu(*data);
 
-       return le64_to_cpu(*data) << PAGE_SHIFT;
+       return le64_to_cpu(*data) << HNS_HW_PAGE_SHIFT;
 }
 
 static int fmea_recover_others(struct hns_roce_dev *hr_dev, u32 res_type,