From patchwork Tue Oct 6 11:09:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Min X-Patchwork-Id: 7334531 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 9385B9F1B9 for ; Tue, 6 Oct 2015 11:13:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C872F20665 for ; Tue, 6 Oct 2015 11:13: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 36E0F20660 for ; Tue, 6 Oct 2015 11:13:32 +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 1ZjQ8I-00028L-8d; Tue, 06 Oct 2015 11:10:10 +0000 Received: from lgeamrelo12.lge.com ([156.147.23.52]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjQ8D-0001Fh-Mr for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2015 11:10:07 +0000 Received: from unknown (HELO lgemrelse7q.lge.com) (156.147.1.151) by 156.147.23.52 with ESMTP; 6 Oct 2015 20:09:42 +0900 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: chanho.min@lge.com Received: from unknown (HELO LGEAEXHB04Q.LGE.NET) (165.244.98.204) by 156.147.1.151 with ESMTP; 6 Oct 2015 20:09:42 +0900 X-Original-SENDERIP: 165.244.98.204 X-Original-MAILFROM: chanho.min@lge.com Received: from lgekrmhub05.lge.com (10.185.110.15) by LGEAEXHB04Q.LGE.NET (165.244.98.204) with Microsoft SMTP Server id 8.3.264.0; Tue, 6 Oct 2015 20:09:42 +0900 Received: from lgemrelse6q.lge.com ([156.147.1.121]) by lgekrmhub05.lge.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2015100620094164-1988854 ; Tue, 6 Oct 2015 20:09:41 +0900 Received: from unknown (HELO ls-2.156.147.135.180) (10.186.119.199) by 156.147.1.121 with ESMTP; 6 Oct 2015 20:09:42 +0900 X-Original-SENDERIP: 10.186.119.199 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min To: Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM:mm: fix kmap_atomic_to_page Date: Tue, 6 Oct 2015 20:09:33 +0900 Message-ID: <1444129773-12632-1-git-send-email-chanho.min@lge.com> X-Mailer: git-send-email 1.7.9.5 X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2015/10/06 20:09:41, Serialize by Router on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2015/10/06 20:09:41, Serialize complete at 2015/10/06 20:09:41 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151006_041006_098236_F43FBCFF X-CRM114-Status: GOOD ( 10.67 ) X-Spam-Score: -1.9 (-) 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: Jongsung Kim , Chanho Min , Gunho Lee 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=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 Since kmap_atomic returns the pkmap address without a new mapping to fixmap for the page that is already mapped by kmap, It should be considered for the pkmap address in kmap_atomic_to_page. Signed-off-by: Chanho Min --- arch/arm/mm/highmem.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index 45aeaac..3e973b7 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -145,8 +145,13 @@ struct page *kmap_atomic_to_page(const void *ptr) { unsigned long vaddr = (unsigned long)ptr; - if (vaddr < FIXADDR_START) - return virt_to_page(ptr); + if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { + int i = PKMAP_NR(vaddr); + return pte_page(pkmap_page_table[i]); + } + + if (vaddr >= FIXADDR_START) + return pte_page(get_fixmap_pte(vaddr)); - return pte_page(get_fixmap_pte(vaddr)); + return virt_to_page(ptr); }