[PATCH] irqchip/gicv3-its: Decrease page size when needed

Minghuan Lian Minghuan.Lian at freescale.com
Wed Apr 15 02:49:22 PDT 2015


The default page size of ITS table has been changed to 64KB,
but for some platforms the real size of allocate memory which
calculated by DEVBITS of register GITS_TYPER may smaller than
default size. In this case, psz must be decreased, otherwise,
the wrong page number will cause kernel hang.

Signed-off-by: Minghuan Lian <Minghuan.Lian at freescale.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 596b0a9..d0374a6 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -844,6 +844,9 @@ static int its_alloc_tables(struct its_node *its)
 
 		its->tables[i] = base;
 
+		while (alloc_size < psz)
+			psz = psz >> 1;
+
 retry_baser:
 		val = (virt_to_phys(base) 				 |
 		       (type << GITS_BASER_TYPE_SHIFT)			 |
-- 
1.9.1




More information about the linux-arm-kernel mailing list