From patchwork Thu Sep 29 08:36:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4422 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 450D023F6F for ; Thu, 29 Sep 2011 08:36:20 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 37211A18799 for ; Thu, 29 Sep 2011 08:36:20 +0000 (UTC) Received: by fxe23 with SMTP id 23so2202173fxe.11 for ; Thu, 29 Sep 2011 01:36:20 -0700 (PDT) Received: by 10.223.94.134 with SMTP id z6mr15929253fam.8.1317285380008; Thu, 29 Sep 2011 01:36:20 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.234 with SMTP id f10cs7635laf; Thu, 29 Sep 2011 01:36:19 -0700 (PDT) Received: by 10.204.136.66 with SMTP id q2mr7014083bkt.269.1317285378610; Thu, 29 Sep 2011 01:36:18 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id ac14si393542bkc.7.2011.09.29.01.36.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Sep 2011 01:36:18 -0700 (PDT) Received-SPF: pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) smtp.mail=triad@df.lth.se Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 4B71565D6F; Thu, 29 Sep 2011 10:36:17 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id p8T8aG8p011820; Thu, 29 Sep 2011 10:36:16 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id p8T8aE9Z011819; Thu, 29 Sep 2011 10:36:14 +0200 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Johan Palsson , stable@kernel.org, Russell King , Michael Bohan , Nicolas Pitre , Rabin Vincent , Linus Walleij Subject: [PATCH v2] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES Date: Thu, 29 Sep 2011 10:36:10 +0200 Message-Id: <1317285370-11792-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 From: Johan Palsson The VM subsystem assumes that there are valid memmap entries from the bank start aligned to MAX_ORDER_NR_PAGES. On the Ux500 we have a lot of mem=N arguments on the commandline triggering this bug several times over and causing kernel oops messages. Cc: stable@kernel.org Cc: Russell King Cc: Michael Bohan Cc: Nicolas Pitre Signed-off-by: Johan Palsson Signed-off-by: Rabin Vincent Signed-off-by: Linus Walleij --- arch/arm/mm/init.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index cc7e2d8..f8037ba 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -496,6 +496,13 @@ static void __init free_unused_memmap(struct meminfo *mi) */ bank_start = min(bank_start, ALIGN(prev_bank_end, PAGES_PER_SECTION)); +#else + /* + * Align down here since the VM subsystem insists that the + * memmap entries are valid from the bank start aligned to + * MAX_ORDER_NR_PAGES. + */ + bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES); #endif /* * If we had a previous bank, and there is a space