[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1423992723-5028-4-git-send-email-wuyun.wu@huawei.com>
Date: Sun, 15 Feb 2015 17:32:00 +0800
From: Yun Wu <wuyun.wu@...wei.com>
To: <marc.zyngier@....com>, <tglx@...utronix.de>,
<jason@...edaemon.net>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
Yun Wu <wuyun.wu@...wei.com>
Subject: [PATCH v2 3/6] irqchip: gicv3-its: limit order of DT size to MAX_ORDER
When required DT size is out of the kmalloc()'s capability, the whole
ITS will fail in probing. This actually is not the hardware's problem
and is mainly a limitation of the kernel memory allocator. This patch
will keep ITS going on to the next initializaion step with an explicit
warning.
Signed-off-by: Yun Wu <wuyun.wu@...wei.com>
---
drivers/irqchip/irq-gic-v3-its.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index f5bfa42..de36606 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -828,6 +828,12 @@ static int its_alloc_tables(struct its_node *its)
u32 ids = GITS_TYPER_DEVBITS(typer);
order = get_order((1UL << ids) * entry_size);
+ if (order >= MAX_ORDER) {
+ pr_warn("%s: DT size too large, reduce to %u pages\n",
+ its->msi_chip.of_node->full_name,
+ 1 << order);
+ order = MAX_ORDER;
+ }
}
alloc_size = (1 << order) * PAGE_SIZE;
--
1.8.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists