Commit 2c997495 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: drop hmm_page_type

Since the hmm-pool code has been removed this now always gets set
to HMM_PAGE_TYPE_GENERAL, so just remove it.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-16-hdegoede@redhat.comReviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 4be4504e
......@@ -81,12 +81,6 @@ enum hmm_bo_type {
HMM_BO_LAST,
};
enum hmm_page_type {
HMM_PAGE_TYPE_RESERVED,
HMM_PAGE_TYPE_DYNAMIC,
HMM_PAGE_TYPE_GENERAL,
};
#define HMM_BO_MASK 0x1
#define HMM_BO_FREE 0x0
#define HMM_BO_ALLOCED 0x1
......@@ -123,7 +117,6 @@ struct hmm_bo_device {
struct hmm_page_object {
struct page *page;
enum hmm_page_type type;
};
struct hmm_buffer_object {
......
......@@ -631,32 +631,22 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
int i, ret;
for (i = 0; i < free_pgnr; i++) {
switch (bo->page_obj[i].type) {
case HMM_PAGE_TYPE_RESERVED:
break;
case HMM_PAGE_TYPE_DYNAMIC:
case HMM_PAGE_TYPE_GENERAL:
default:
ret = set_pages_wb(bo->page_obj[i].page, 1);
if (ret)
dev_err(atomisp_dev,
"set page to WB err ...ret = %d\n",
ret);
/*
W/A: set_pages_wb seldom return value = -EFAULT
indicate that address of page is not in valid
range(0xffff880000000000~0xffffc7ffffffffff)
then, _free_pages would panic; Do not know why page
address be valid,it maybe memory corruption by lowmemory
*/
if (!ret) {
__free_pages(bo->page_obj[i].page, 0);
}
break;
ret = set_pages_wb(bo->page_obj[i].page, 1);
if (ret)
dev_err(atomisp_dev,
"set page to WB err ...ret = %d\n",
ret);
/*
W/A: set_pages_wb seldom return value = -EFAULT
indicate that address of page is not in valid
range(0xffff880000000000~0xffffc7ffffffffff)
then, _free_pages would panic; Do not know why page
address be valid,it maybe memory corruption by lowmemory
*/
if (!ret) {
__free_pages(bo->page_obj[i].page, 0);
}
}
return;
}
/*Allocate pages which will be used only by ISP*/
......@@ -755,9 +745,8 @@ static int alloc_private_pages(struct hmm_buffer_object *bo,
}
}
for (j = 0; j < blk_pgnr; j++) {
for (j = 0; j < blk_pgnr; j++, i++) {
bo->page_obj[i].page = pages + j;
bo->page_obj[i++].type = HMM_PAGE_TYPE_GENERAL;
}
pgnr -= blk_pgnr;
......@@ -878,7 +867,6 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
for (i = 0; i < bo->pgnr; i++) {
bo->page_obj[i].page = pages[i];
bo->page_obj[i].type = HMM_PAGE_TYPE_GENERAL;
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment