From patchwork Wed May 20 15:13:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 6447511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C4849F1C1 for ; Wed, 20 May 2015 15:28:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C707202FE for ; Wed, 20 May 2015 15:27:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B249A20256 for ; Wed, 20 May 2015 15:27:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yv5rU-0001xr-Lp; Wed, 20 May 2015 15:24:48 +0000 Received: from mail-by2on0119.outbound.protection.outlook.com ([207.46.100.119] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yv5pO-0000BE-Hw for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2015 15:22:39 +0000 Received: from BLUPR0301CA0015.namprd03.prod.outlook.com (10.162.113.153) by BY2PR0301MB0632.namprd03.prod.outlook.com (10.160.63.12) with Microsoft SMTP Server (TLS) id 15.1.166.22; Wed, 20 May 2015 15:22:14 +0000 Received: from BN1AFFO11FD028.protection.gbl (2a01:111:f400:7c10::130) by BLUPR0301CA0015.outlook.office365.com (2a01:111:e400:5259::25) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Wed, 20 May 2015 15:22:14 +0000 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; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD028.mail.protection.outlook.com (10.58.52.88) with Microsoft SMTP Server (TLS) id 15.1.172.14 via Frontend Transport; Wed, 20 May 2015 15:22:12 +0000 Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.70]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t4KFM87k011895; Wed, 20 May 2015 08:22:08 -0700 From: Stuart Yoder To: , , Subject: [RESEND][ PATCH v3] irqchip/gicv3-its: ITS table size should not be smaller than PSZ Date: Wed, 20 May 2015 10:13:15 -0500 Message-ID: <1432134795-661-1-git-send-email-stuart.yoder@freescale.com> X-Mailer: git-send-email 2.3.3 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD028; 1:yBj949nyV9mHof8FWrAMYwzLpZDzXxxKnAut6AET+Y/8niZCYnWtIi8syFTZVvnkkLCAltOdk1wSOm3Rv8Bl0dJyOctBhVIQkUrPz4iRyyu6MnqVOon/cB2rgMGnnBVOZgbkloT21ClG13yf2TbgVkgqvyR/07G7FOx1oZ2d64gHjVs/kSnCuR0DdEqo/UeNYl/cZ5l6bBDIojkTvfcLuKY9uK6ts7gIg1AphzNhKKp4bkXcfsYfiNcNbm22vzwmrsf3+Q5LMrVD0gVhZeikZ7wq36SrUBSsWDpUapwY6G+c8zwlFDGiyXnJMrj0DJyI0ndlOvMUZJLF7i7OInvtHQ== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(106466001)(92566002)(104016003)(105606002)(5001960100002)(229853001)(62966003)(68736005)(33646002)(81156007)(77156002)(77096005)(5001830100001)(189998001)(5001860100001)(4001540100001)(97736004)(19580395003)(107886002)(5001770100001)(36756003)(19580405001)(85426001)(48376002)(50466002)(50986999)(64706001)(50226001)(47776003)(46102003)(2201001)(87936001)(6806004)(86362001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB0632; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0632; 2:jOLfmyRy7KuejDBwiN+TUL9a+iYJASrhD3MQiIHESLGg2YTk3TenJYqjXpLi6Wyc; 2:C9Va9V8jEcGtHTnZaABrN8WHupvreAbEfsjVE3VwPaiH46F2iQco+2t8ozuDdUnFi/BP8fcxK+SsH+uWHgyq0b/afc7pvn5PxpbpKUUWwxU0QvHgdDGaMqaBtzjN9X0IYww4Bkqt5JSHvXOWRHQnKPsaQ4iKQbMzyOVG1flax76CzsjP7o4a4elEZNmMW+5mpQ7iIuwssaAMezE1MzF5tC9G4Pka+wcvrjJwhJSRFZ4=; 6:lKS/xrA+GlzE3zdvqmFO/i7505ygaSaFqxn2fnmYhD332WG382wlEpW3rsSFq5Vod89BzOp+qKSoOPChEz0gOQ2DBa/kahrluVDRNi5q/lWICx+EeURSwTvJYG11BZ79X6IXB70ZoljjQrUOe/lESw7eXgE4a+hhDMRC7BVlNzNusEgJjJ5z+PvKlELj9Oz3gay9gMiX7pvyE1MnMlDHPzQHvlOTLjST95VPj/OUYj0t7yYLBynuzj7M9dllemcEn9UV8oG71HRJWH825dr6yzR4OGfDYK/1FdSbsBkMVBoHj0w0xagvIRFtoDkgbMjpAne2W04UvfB8PeCSXF2tng==; 3:V/eifDZipxPvvzBgnqje6EzLgVuXa6bB/pTufTLaGTO01NWEkgmGVZbou+W0kvDAhY/WL1QDQ5kK5MaVDEqPEvc9EWQvBDjIyeo9zVgvKWtQK/HMFm568afI+fNaAThPT0QmK8ICWoUHWtmfxVCzTn0y24DOAzXlicoyEPRxCT0Ry4V+knTTCrMGdndC5R1JjD75+mUkN3746gtzVOZE/iVsyCwFUzS3be5oizYtshzeaGGhLDit7EEWXV+QPxBYzS19iAAVBliIfz9quWY8qTCQHDfNFAUuVFh44TuhKV4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0632; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR0301MB0632; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB0632; X-Forefront-PRVS: 0582641F53 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0632; 9:uUOmdHMlDjkPqjYgqHTIiawGgSW/MJgyeVxp26th?= =?us-ascii?Q?cSgbyctAHwY+SSp6LYYUFGMqQDJPiEABSe8NPGdNZDYdczFu6tZaBTfZp5fn?= =?us-ascii?Q?n2bKOkDUcMe20JWgqiRYBMf43HnI+oo11LQn/spAJ6eboe9wriGWIizT+kpB?= =?us-ascii?Q?RLGciliOvAHXW0rQX0HfxEXJ9yWEVG/ilKEud0Kjr6WmZALmtk/R/HeanjBc?= =?us-ascii?Q?cc8bkJoDfAT6IZyvvFR7p73KpabJPjKpMjor7kFxjd4pT5+gFtRKkBk2e9Bu?= =?us-ascii?Q?XegSKVwOHJaD04FIGEsyS+fU0YiOLzS8JvQJKkkHRI9lBiBsA1diuya89+GT?= =?us-ascii?Q?JBQldX025rTZAVfuSxs2sTuI9t51v/YGjRBsGvu5T2XjqQPIFC/TTnf4PEfH?= =?us-ascii?Q?i1iCzCJtg2+a5NdgILDzxC74XqULb4l5F+XDC3Se1gC4RCO2K9kG6XglbAZb?= =?us-ascii?Q?9OlbVLSLG8wbzaHAidBncN1hy9lGH5nJQJlJ0+xJ0jsSHpgahqCR9C4Mdlf9?= =?us-ascii?Q?0MRsD4rTG/OIIxvgrWwGd+xGsu2jxYZ6DAKFUA44RY4dFm/6PFUFqHgYuI/i?= =?us-ascii?Q?IdhyllQlp+tTh6o44ecdc/jSlei11Hn/1ymI706QuvPE+uH0nU+7jI57do6x?= =?us-ascii?Q?L4ttZjMA9kipikVzsHx5U1E7KCCKtiUgto/VhqEpgL9Wnjk2WwCrULRtKnVI?= =?us-ascii?Q?hDxMfr4rhh+oX8JaS8gHQIAbjPw+5865HttC3VZGaV+xFuE5M3v/fBQvs7mO?= =?us-ascii?Q?of8jiZ2oU8RNeUU9LdkbpiDws4stbktyPK7bbRyd5KFT+z7qhL7SKHQnKLbJ?= =?us-ascii?Q?rsqe8OH4sodQZbZMhYWs2UgiPVSTr3PH2aSyo253wtTj4fcia00GT0Enzb9J?= =?us-ascii?Q?Uqhnau6IoKZzpHFTvq1Z7O3EG8frIv02wmorPJsQVYi8kZVR//TMnySsKMB2?= =?us-ascii?Q?jfwVznYM/LW3CIS9siZpkC/FrSY+FJP8G8AnasNbWNkABHV8ndqU1sP+SaNj?= =?us-ascii?Q?rD0PN6SO3v686VqhqTgYV+pX/BtT7lobAhOTe7NlZHoR1o2lymd5crXGk/ib?= =?us-ascii?Q?URlzaGw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0632; 3:PClKsIXvtyVHMUvLEleQvVhfx68yJ3UqrI5hfL9GXVVwO+ghPflhlzUdkELGyF1WlmqD22VkaskutzP5SY+Q8vOXlJG77eYem4b6+A2qIV0EdJshyon71zqET25bKP3g1SE2+NOsBhuhCmcP5xTXYQ==; 10:/3iGiCA/CHruMWQ9Bn/eRTx+5mhjuVhcJaJab8OdKM5IJ4lfdRLdU50kxM8V3zYukYTrHuJWpquzZDkxpqEvziyEJvFG+s5lPVPQ4gtKXt4=; 6:/u1dslO8SEQ5p6ZMPIu5RoKEx+QciYXSeBw/tk+H4n1FugZFux860ctTayh+YZf3 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2015 15:22:12.2274 (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: BY2PR0301MB0632 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150520_082238_645789_B7484517 X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.1 (-) Cc: Minghuan.Lian@freescale.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stuart Yoder X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP when allocating a device table, if the requested allocation is smaller than the default granule size of the ITS then, we need to round up to the default size Signed-off-by: Minghuan Lian Signed-off-by: Stuart Yoder Signed-off-by: Minghuan Lian Signed-off-by: Stuart Yoder --- -v3 changes -updated commit message and added comment -v3 resend-- updated email addresses sent to -would be nice to get this into 4.1 as the kernel will hang booting on some systems drivers/irqchip/irq-gic-v3-its.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 9687f8a..1b7e155 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -828,7 +828,14 @@ 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' was initialized earlier to the default page + * granule of the the ITS. We can't have an allocation + * smaller than that. If the requested allocation + * is smaller, round up to the default page granule. + */ + 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",