From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756910AbbDPHCm (ORCPT ); Thu, 16 Apr 2015 03:02:42 -0400 Received: from mail-by2on0120.outbound.protection.outlook.com ([207.46.100.120]:20960 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750810AbbDPHCe (ORCPT ); Thu, 16 Apr 2015 03:02:34 -0400 X-Greylist: delayed 4739 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Apr 2015 03:02:33 EDT Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Minghuan Lian To: CC: , Zang Roy-R61911 , Hu Mingkai-B21284 , "Yoder Stuart-B08248" , Thomas Gleixner , Jason Cooper , Marc Zyngier , Minghuan Lian Subject: [PATCH v2] irqchip/gicv3-its: ITS table size should not be smaller than PSZ Date: Thu, 16 Apr 2015 13:30:59 +0800 Message-ID: <1429162259-11344-1-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(199003)(189002)(47776003)(48376002)(92566002)(77096005)(50226001)(77156002)(62966003)(46102003)(104016003)(50986999)(86362001)(110136001)(36756003)(19580395003)(19580405001)(85426001)(6806004)(50466002)(2351001)(106466001)(87936001)(105606002)(229853001)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB574;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB574; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DM2PR03MB574;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB574; X-Forefront-PRVS: 0548586081 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2015 05:29:10.7268 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB574 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The default page size of ITS table has been changed to 64KB, but for some platforms the real size of allocated memory which calculated by DEVBITS of register GITS_TYPER may be smaller than default size. In this case, the allocation size must be increased to the default size, otherwise, the wrong page number will cause kernel hang. Signed-off-by: Minghuan Lian --- v2-v1: Increase allocation size instead of decreasing PSZ drivers/irqchip/irq-gic-v3-its.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 9687f8a..19ab86d 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -828,7 +828,8 @@ static int its_alloc_tables(struct its_node *its) u64 typer = readq_relaxed(its->base + GITS_TYPER); u32 ids = GITS_TYPER_DEVBITS(typer); - order = get_order((1UL << ids) * entry_size); + order = max(get_order((1UL << ids) * entry_size), + order); if (order >= MAX_ORDER) { order = MAX_ORDER - 1; pr_warn("%s: Device Table too large, reduce its page order to %u\n", -- 1.9.1