From patchwork Sat Jul 18 00:29:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 6820161 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 D01629F2F0 for ; Sat, 18 Jul 2015 00:28:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB8A12076A for ; Sat, 18 Jul 2015 00:28:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14B9E20723 for ; Sat, 18 Jul 2015 00:28:33 +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 1ZGFwW-0007n1-9R; Sat, 18 Jul 2015 00:25:28 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZGFwT-0006fP-Fg for linux-arm-kernel@lists.infradead.org; Sat, 18 Jul 2015 00:25:26 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6I0Okli009362; Fri, 17 Jul 2015 19:24:46 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6I0OjuF025305; Fri, 17 Jul 2015 19:24:45 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Fri, 17 Jul 2015 19:24:18 -0500 Received: from uda0794637.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6I0Oi0x011461; Fri, 17 Jul 2015 19:24:45 -0500 From: Vitaly Andrianov To: , , , , , , Subject: [PATCH] ARM: mm: do not use virt_to_idmap() for NOMMU systems Date: Fri, 17 Jul 2015 20:29:35 -0400 Message-ID: <1437179375-23855-1-git-send-email-vitalya@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150717_172525_620867_CB9F9715 X-CRM114-Status: UNSURE ( 6.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -8.1 (--------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vitaly Andrianov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The "ARM: mm: Introduce virt_to_idmap() with an arch hook" defines arch_virt_to_idmap hook in arch/arm/mm/idmap.c. That breaks systems w/o MMU because that file is not built for them. This patch fixes this bug. Signed-off-by: Vitaly Andrianov --- arch/arm/include/asm/memory.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 6f225ac..114abe3 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -279,6 +279,7 @@ static inline void *phys_to_virt(phys_addr_t x) extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x); +#ifdef CONFIG_MMU /* * These are for systems that have a hardware interconnect supported alias of * physical memory for idmap purposes. Most cases should leave these @@ -293,6 +294,9 @@ static inline phys_addr_t __virt_to_idmap(unsigned long x) } #define virt_to_idmap(x) __virt_to_idmap((unsigned long)(x)) +#else +#define virt_to_idmap(x) __virt_to_phys((unsigned long)(x)) +#endif /* * Virtual <-> DMA view memory address translations