From 26b901bc1ebcd09a1c6e04d76339123f027eeb0d Mon Sep 17 00:00:00 2001 From: Weibo Zhao Date: Thu, 9 Nov 2023 11:05:42 +0800 Subject: [PATCH 1/2] hns3 udma: add mask for udma_reg_write driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I85R2F CVE: NA ----------------------------------------------------------- This patch add mask of value for udma_reg_write. The gcc of an eariler version can be compiled smoothly. Fixes: c256e44d06422 ("hns3 udma:support loading and unloading of udma driver.") Signed-off-by: Weibo Zhao --- drivers/ub/hw/hns3/hns3_udma_common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ub/hw/hns3/hns3_udma_common.h b/drivers/ub/hw/hns3/hns3_udma_common.h index 588eb1fa091b..35583b63f8e1 100644 --- a/drivers/ub/hw/hns3/hns3_udma_common.h +++ b/drivers/ub/hw/hns3/hns3_udma_common.h @@ -66,7 +66,8 @@ _udma_reg_clear((ptr), field); \ *((uint32_t *)(ptr) + ((field) >> 32) / 32) |= \ cpu_to_le32(FIELD_PREP(GENMASK(((field) >> 32) % 32, \ - (((field) << 32) >> 32) % 32), _val)); \ + (((field) << 32) >> 32) % 32), _val & \ + GENMASK((((field) >> 32) - (((field) << 32) >> 32)), 0))); \ }) #define udma_reg_write(ptr, field, val) _udma_reg_write(ptr, field, val) -- Gitee From c84eb7c49654b4c421a86dd16d7b11e13f3601a2 Mon Sep 17 00:00:00 2001 From: Weibo Zhao Date: Fri, 10 Nov 2023 14:56:24 +0800 Subject: [PATCH 2/2] hns3 udma: add dependency by hns3 driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I85R2F CVE: NA --------------------------------------------------- This patch add dependency of hns3-udma by hns3. Driver of hns3-udma rely on function of hnae3_register_client and hnae3_unregister_client. Fixes: c256e44d06422 ("hns3 udma:support loading and unloading of udma driver.") Signed-off-by: Weibo Zhao --- drivers/ub/hw/hns3/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ub/hw/hns3/Kconfig b/drivers/ub/hw/hns3/Kconfig index 82ca7b910673..541bf14fcd92 100644 --- a/drivers/ub/hw/hns3/Kconfig +++ b/drivers/ub/hw/hns3/Kconfig @@ -8,7 +8,7 @@ config UB_UDMA_HNS3 tristate "HNS3 UB UDMA Driver" depends on UB && UB_URMA depends on ARM64 - depends on UBL && PCI + depends on HNS3 && UBL && PCI help This is a UB_UDMA_HNS3 driver for the Hisilicon UDMA engine. This driver depands on ubcore and uburma. -- Gitee