From patchwork Thu Jul 3 17:40:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cooper X-Patchwork-Id: 4476611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 714B1BEEAA for ; Thu, 3 Jul 2014 17:43:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7CF5203AC for ; Thu, 3 Jul 2014 17:43:52 +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 CB7B3203AA for ; Thu, 3 Jul 2014 17:43:51 +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 1X2l14-0001R0-HK; Thu, 03 Jul 2014 17:41:50 +0000 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2l12-0001JJ-D6 for linux-arm-kernel@lists.infradead.org; Thu, 03 Jul 2014 17:41:48 +0000 X-IronPort-AV: E=Sophos;i="5.01,596,1400050800"; d="scan'208";a="37543680" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw2-out.broadcom.com with ESMTP; 03 Jul 2014 10:48:06 -0700 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 3 Jul 2014 10:41:26 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Thu, 3 Jul 2014 10:41:26 -0700 Received: from stbsrv-and-3.and.broadcom.com (stbsrv-and-3.and.broadcom.com [10.28.16.21]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id A45E29FA0B; Thu, 3 Jul 2014 10:41:25 -0700 (PDT) From: Al Cooper To: , Subject: [PATCH] arm: Make sure memory starting at physical address 0 is reserved. Date: Thu, 3 Jul 2014 13:40:05 -0400 Message-ID: <1404409205-7368-1-git-send-email-alcooperx@gmail.com> X-Mailer: git-send-email 1.9.0.138.g2de3478 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140703_104148_461360_D00EF115 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) Cc: Al Cooper 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=-1.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, 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 Some older hardware, like USB OHCI, cannot DMA to physical address zero. This change makes sure that the first PAGESIZE block of memory starting at zero is reserved so it can't end up in any free memory pool. Signed-off-by: Al Cooper --- arch/arm/mm/init.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 659c75d..17aaa4d 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -324,6 +324,15 @@ void __init arm_memblock_init(const struct machine_desc *mdesc) */ dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit)); + /* + * Some older hardware, like USB OHCI, cannot DMA + * to physical address zero. This makes sure that the + * first PAGESIZE block of memory starting at zero is + * reserved so it can't end up in any free memory pool. + */ + if (memblock_is_region_memory(0, PAGE_SIZE)) + memblock_reserve(0, PAGE_SIZE); + arm_memblock_steal_permitted = false; memblock_dump_all(); }