From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758158AbbCDDUS (ORCPT ); Tue, 3 Mar 2015 22:20:18 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:34489 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758130AbbCDDUP (ORCPT ); Tue, 3 Mar 2015 22:20:15 -0500 From: Yun Wu To: , , CC: , , Yun Wu Subject: [PATCH v3 3/5] irqchip: gicv3-its: add limitation to page order Date: Wed, 4 Mar 2015 11:18:16 +0800 Message-ID: <1425439098-10708-4-git-send-email-wuyun.wu@huawei.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1425439098-10708-1-git-send-email-wuyun.wu@huawei.com> References: <1425439098-10708-1-git-send-email-wuyun.wu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.24.136] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When required size of Device Table is out of the page allocator'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 page allocator. This patch will keep ITS going on to the next initializaion stage with an explicit warning. Signed-off-by: Yun Wu --- drivers/irqchip/irq-gic-v3-its.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index f5bfa42..e8bda0b 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -828,6 +828,11 @@ 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) { + order = MAX_ORDER - 1; + pr_warn("%s: DT size too large, reduce page order to %u\n", + its->msi_chip.of_node->full_name, order); + } } alloc_size = (1 << order) * PAGE_SIZE; -- 1.8.0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: wuyun.wu@huawei.com (Yun Wu) Date: Wed, 4 Mar 2015 11:18:16 +0800 Subject: [PATCH v3 3/5] irqchip: gicv3-its: add limitation to page order In-Reply-To: <1425439098-10708-1-git-send-email-wuyun.wu@huawei.com> References: <1425439098-10708-1-git-send-email-wuyun.wu@huawei.com> Message-ID: <1425439098-10708-4-git-send-email-wuyun.wu@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org When required size of Device Table is out of the page allocator'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 page allocator. This patch will keep ITS going on to the next initializaion stage with an explicit warning. Signed-off-by: Yun Wu --- drivers/irqchip/irq-gic-v3-its.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index f5bfa42..e8bda0b 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -828,6 +828,11 @@ 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) { + order = MAX_ORDER - 1; + pr_warn("%s: DT size too large, reduce page order to %u\n", + its->msi_chip.of_node->full_name, order); + } } alloc_size = (1 << order) * PAGE_SIZE; -- 1.8.0