From: Tang Yizhou tangyizhou@huawei.com
ascend inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI CVE: NA
-------------------------------------------------
SPG_ID_DVPP_PASS_THROUGH_MIN, SPG_ID_DVPP_PASS_THROUGH_MAX and SPG_ID_DVPP_PASS_THROUGH are now useless.
Signed-off-by: Tang Yizhou tangyizhou@huawei.com Reviewed-by: Ding Tianhong dingtianhong@huawei.com Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- include/linux/share_pool.h | 5 +---- mm/share_pool.c | 18 ++---------------- 2 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/include/linux/share_pool.h b/include/linux/share_pool.h index e37b39009d83f..40ccab0e77fad 100644 --- a/include/linux/share_pool.h +++ b/include/linux/share_pool.h @@ -16,16 +16,13 @@ #define SP_FLAG_MASK (SP_HUGEPAGE | SP_HUGEPAGE_ONLY | SP_DVPP | \ (_AC(DEVICE_ID_MASK, UL) << DEVICE_ID_SHIFT))
-#define SPG_ID_NONE -1 /* not associated with sp_group, only for specified thread */ +#define SPG_ID_NONE (-1) /* not associated with sp_group, only for specified thread */ #define SPG_ID_DEFAULT 0 /* use the spg id of current thread */ #define SPG_ID_MIN 1 /* valid id should be >= 1 */ #define SPG_ID_MAX 99999 #define SPG_ID_AUTO_MIN 100000 #define SPG_ID_AUTO_MAX 199999 #define SPG_ID_AUTO 200000 /* generate group id automatically */ -#define SPG_ID_DVPP_PASS_THROUGH_MIN 800000 -#define SPG_ID_DVPP_PASS_THROUGH_MAX 899999 -#define SPG_ID_DVPP_PASS_THROUGH 900000
#define MAX_DEVID 2 /* the max num of Da-vinci devices */
diff --git a/mm/share_pool.c b/mm/share_pool.c index 09b8578183ad5..4dde5f8582cb8 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -699,9 +699,7 @@ static unsigned long sp_remap_kva_to_vma(unsigned long kva, struct sp_area *spa, static void free_sp_group_id(int spg_id) { /* ida operation is protected by an internal spin_lock */ - if ((spg_id >= SPG_ID_AUTO_MIN && spg_id <= SPG_ID_AUTO_MAX) || - (spg_id >= SPG_ID_DVPP_PASS_THROUGH_MIN && - spg_id <= SPG_ID_DVPP_PASS_THROUGH_MAX)) + if (spg_id >= SPG_ID_AUTO_MIN && spg_id <= SPG_ID_AUTO_MAX) ida_free(&sp_group_id_ida, spg_id); }
@@ -1086,8 +1084,7 @@ int sp_group_add_task(int pid, unsigned long prot, int spg_id) if (enable_mdc_default_group) spg_id = mdc_default_group_id;
- if ((spg_id < SPG_ID_MIN || spg_id > SPG_ID_AUTO) - && spg_id != SPG_ID_DVPP_PASS_THROUGH) { + if (spg_id < SPG_ID_MIN || spg_id > SPG_ID_AUTO) { pr_err_ratelimited("add group failed, invalid group id %d\n", spg_id); return -EINVAL; } @@ -1122,17 +1119,6 @@ int sp_group_add_task(int pid, unsigned long prot, int spg_id) id_newly_generated = true; }
- if (spg_id == SPG_ID_DVPP_PASS_THROUGH) { - spg_id = ida_alloc_range(&sp_group_id_ida, - SPG_ID_DVPP_PASS_THROUGH_MIN, - SPG_ID_DVPP_PASS_THROUGH_MAX, GFP_ATOMIC); - if (spg_id < 0) { - pr_err_ratelimited("add group failed, DVPP auto generate group id failed\n"); - return spg_id; - } - id_newly_generated = true; - } - down_write(&sp_group_sem);
rcu_read_lock();