[PATCH v1 3/6] rqchip/gic-v3-its: add reset pending table function
From: Pavel Tatashin
Date: Mon Aug 26 2019 - 15:01:19 EST
Add function that is similar to gic_reset_prop_table but for pending
table.
Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
---
drivers/irqchip/irq-gic-v3-its.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 656b6c6e1bf8..124e2cb890cd 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1989,17 +1989,23 @@ static int its_alloc_collections(struct its_node *its)
return 0;
}
+static void gic_reset_pending_table(void *va)
+{
+ memset(va, 0, LPI_PENDBASE_SZ);
+
+ /* Make sure the GIC will observe the zero-ed page */
+ gic_flush_dcache_to_poc(va, LPI_PENDBASE_SZ);
+}
+
static struct page *its_allocate_pending_table(gfp_t gfp_flags)
{
struct page *pend_page;
- pend_page = alloc_pages(gfp_flags | __GFP_ZERO,
- get_order(LPI_PENDBASE_SZ));
+ pend_page = alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ));
if (!pend_page)
return NULL;
- /* Make sure the GIC will observe the zero-ed page */
- gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ);
+ gic_reset_pending_table(page_address(pend_page));
return pend_page;
}
--
2.23.0