From patchwork Wed Feb 5 14:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 3586541 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 43BCFC02DC for ; Wed, 5 Feb 2014 14:51:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABF912017B for ; Wed, 5 Feb 2014 14:51:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 A8FCC20170 for ; Wed, 5 Feb 2014 14:51:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WB3of-0004bS-Jp; Wed, 05 Feb 2014 14:51:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WB3oc-0005cn-QR; Wed, 05 Feb 2014 14:51:02 +0000 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WB3oZ-0005bo-Pj for linux-arm-kernel@lists.infradead.org; Wed, 05 Feb 2014 14:51:00 +0000 Received: by mail-ob0-f172.google.com with SMTP id vb8so512712obc.17 for ; Wed, 05 Feb 2014 06:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5bnjMPfVf5osDAieZy1q6VRxHr7+THYJ51vTSqP6+vw=; b=uR0oVyXJ/XA6NBigTw1Xd7MLeXKYrtvhC5nkJl1qO/U35CzYnMf4TUSOyHtisLypie 1EmjaShbeN2Rjh7qDoamqSSM0D193K8moS2XgQKU43cpe5XYH2KTdHxKz/aKtono/BQn YDs+O8+AMPvLnaWJlrZfqdK7SikeIX9NsiA2xVuNJEQf88OTcj+VJjZWjaaNWMG0LUq/ 4PVkJ8nl/T8TNsk2OjSYPEQ+1O/nti+ZTQIIwXelj3agkxnmFqDfRYC7xiA/zLxpNR0O lUUfBJ2T+jRkmukB17P9NnuQADS7KTbF47B10f2An+Dt40zsMNHJT8/tdu8q6KNwSV26 QfMw== X-Received: by 10.182.196.3 with SMTP id ii3mr1634998obc.11.1391611838265; Wed, 05 Feb 2014 06:50:38 -0800 (PST) Received: from localhost.localdomain (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPSA id ut2sm49154850obc.3.2014.02.05.06.50.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 06:50:37 -0800 (PST) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: fix early_io_map for 64K pages Date: Wed, 5 Feb 2014 08:50:29 -0600 Message-Id: <1391611829-7824-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140205_095059_889963_9E9CA472 X-CRM114-Status: GOOD ( 11.87 ) X-Spam-Score: -1.8 (-) Cc: Rob Herring , Catalin Marinas , Will Deacon , Mark Salter X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Rob Herring earlyprintk is broken with 64KB pages. The problem is pgprot_default is not yet initialized when early_io_map is called, so the pte does not get marked as valid. Set the necessary page and access permission bits. Cc: Mark Salter Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Rob Herring --- I'm not sure this is really the best fix. Perhaps pgprot_default can be statically initialized to something useful instead? Rob arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f557ebb..c41daa6 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -284,7 +284,7 @@ void __iomem * __init early_io_map(phys_addr_t phys, unsigned long virt) if (pmd_none(*pmd)) return NULL; pte = pte_offset_kernel(pmd, virt); - set_pte(pte, __pte((phys & mask) | PROT_DEVICE_nGnRE)); + set_pte(pte, __pte((phys & mask) | PTE_TYPE_PAGE | PTE_AF | PROT_DEVICE_nGnRE)); } else { set_pmd(pmd, __pmd((phys & mask) | PROT_SECT_DEVICE_nGnRE)); }