From: Chen Linxuan chenlinxuan@uniontech.com
[ Upstream commit ffe1cee21f8b533ae27c3a31bfa56b8c1b27fa6e ]
On x86_64 with gcc version 13.3.0, I compile drivers/infiniband/hw/hns/hns_roce_hw_v2.c with:
make defconfig ./scripts/kconfig/merge_config.sh .config <( echo CONFIG_COMPILE_TEST=y echo CONFIG_HNS3=m echo CONFIG_INFINIBAND=m echo CONFIG_INFINIBAND_HNS_HIP08=m ) make KCFLAGS="-fno-inline-small-functions -fno-inline-functions-called-once" \ drivers/infiniband/hw/hns/hns_roce_hw_v2.o
Then I get a compile error:
CALL scripts/checksyscalls.sh DESCEND objtool INSTALL libsubcmd_headers CC [M] drivers/infiniband/hw/hns/hns_roce_hw_v2.o In file included from drivers/infiniband/hw/hns/hns_roce_hw_v2.c:47: drivers/infiniband/hw/hns/hns_roce_hw_v2.c: In function 'update_srq_db': drivers/infiniband/hw/hns/hns_roce_common.h:74:17: error: 'db' is used uninitialized [-Werror=uninitialized] 74 | *((__le32 *)_ptr + (field_h) / 32) &= \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_common.h:90:17: note: in expansion of macro '_hr_reg_clear' 90 | _hr_reg_clear(ptr, field_type, field_h, field_l); \ | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_common.h:95:39: note: in expansion of macro '_hr_reg_write' 95 | #define hr_reg_write(ptr, field, val) _hr_reg_write(ptr, field, val) | ^~~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v2.c:948:9: note: in expansion of macro 'hr_reg_write' 948 | hr_reg_write(&db, DB_TAG, srq->srqn); | ^~~~~~~~~~~~ drivers/infiniband/hw/hns/hns_roce_hw_v2.c:946:31: note: 'db' declared here 946 | struct hns_roce_v2_db db; | ^~ cc1: all warnings being treated as errors
Signed-off-by: Chen Linxuan chenlinxuan@uniontech.com Co-developed-by: Winston Wen wentao@uniontech.com Signed-off-by: Winston Wen wentao@uniontech.com Link: https://patch.msgid.link/FF922C77946229B6+20250411105459.90782-5-chenlinxuan... Signed-off-by: Leon Romanovsky leon@kernel.org Signed-off-by: WangYuli wangyuli@uniontech.com --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 160e8927d364..afd2ea6da3ee 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -943,7 +943,7 @@ static void fill_wqe_idx(struct hns_roce_srq *srq, unsigned int wqe_idx) static void update_srq_db(struct hns_roce_srq *srq) { struct hns_roce_dev *hr_dev = to_hr_dev(srq->ibsrq.device); - struct hns_roce_v2_db db; + struct hns_roce_v2_db db = {};
hr_reg_write(&db, DB_TAG, srq->srqn); hr_reg_write(&db, DB_CMD, HNS_ROCE_V2_SRQ_DB);
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: ffe1cee21f8b533ae27c3a31bfa56b8c1b27fa6e
WARNING: Author mismatch between patch and upstream commit: Backport author: WangYuliwangyuli@uniontech.com Commit author: Chen Linxuanchenlinxuan@uniontech.com
Status in newer kernel trees: 6.15.y | Present (different SHA1: b6b98ff26f24)
Note: The patch differs from the upstream commit: --- 1: ffe1cee21f8b5 ! 1: 80cf60ce40cfd RDMA/hns: initialize db in update_srq_db() @@ Metadata ## Commit message ## RDMA/hns: initialize db in update_srq_db()
+ [ Upstream commit ffe1cee21f8b533ae27c3a31bfa56b8c1b27fa6e ] + On x86_64 with gcc version 13.3.0, I compile drivers/infiniband/hw/hns/hns_roce_hw_v2.c with:
@@ Commit message Signed-off-by: Winston Wen wentao@uniontech.com Link: https://patch.msgid.link/FF922C77946229B6+20250411105459.90782-5-chenlinxuan... Signed-off-by: Leon Romanovsky leon@kernel.org + Signed-off-by: WangYuli wangyuli@uniontech.com
## drivers/infiniband/hw/hns/hns_roce_hw_v2.c ## @@ drivers/infiniband/hw/hns/hns_roce_hw_v2.c: static void fill_wqe_idx(struct hns_roce_srq *srq, unsigned int wqe_idx) ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.12.y | Success | Success | | stable/linux-6.15.y | Success | Success |
linux-stable-mirror@lists.linaro.org