From patchwork Fri Dec 13 12:06:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 3339941 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA1DC9F243 for ; Fri, 13 Dec 2013 12:15:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 594B1207BF for ; Fri, 13 Dec 2013 12:15:17 +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 E6C50205D8 for ; Fri, 13 Dec 2013 12:15:15 +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 1VrRe6-0005dQ-0Q; Fri, 13 Dec 2013 12:15:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrRe0-0004fH-V8; Fri, 13 Dec 2013 12:15:00 +0000 Received: from mail-we0-f182.google.com ([74.125.82.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VrRdx-0004em-DY for linux-arm-kernel@lists.infradead.org; Fri, 13 Dec 2013 12:14:58 +0000 Received: by mail-we0-f182.google.com with SMTP id q59so1778744wes.41 for ; Fri, 13 Dec 2013 04:14:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qJnUqQajaUft5WEBsvsLoMTubwBEuyf/+Hf6ek63Njo=; b=FnjfQ/sFtECcWP2FaqlN3KloNQCITMftmHTy1F7dal58HrSBLVz7P8+dvcLpE8Gph1 77EhlihvMHXLUx2PuXHlcBSftJ1kMkzM439Y6lXKYvDP9Jcx1i4N1yz1wpPncNwPwycr 0j65Tx7IbQsSR4Zi2u55qvo5I8Dj3X3ocgcTGoM/jb4iFHj7ei5VwvXFVNcMBTAB5Dyx a61U12cKpR3F/UzmDsRcSnhNpIWsl+HlLJkIQlhIDcuwJqGjM5NPEVmzDLipoRRgZwGj nnOgEQRNmNVkWKns0GoF/1UTl2QsMcYqWHR1Fm/wPtHo2cYYh0vBcu4BXG5fGT+Ejf8p 96Ug== X-Gm-Message-State: ALoCoQlirwIYZErYR0PsPBFLv581GwOGe0QLRt4lzMTbEWEafPkjkB5Oa1NHb81XsYwQW5+4/8Az X-Received: by 10.180.171.34 with SMTP id ar2mr2615329wic.25.1386936410770; Fri, 13 Dec 2013 04:06:50 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id d2sm6644929wik.11.2013.12.13.04.06.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 04:06:50 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] arm: mm: fix dcache flush logic for compound high pages Date: Fri, 13 Dec 2013 12:06:30 +0000 Message-Id: <1386936391-30493-2-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1386936391-30493-1-git-send-email-steve.capper@linaro.org> References: <1386936391-30493-1-git-send-email-steve.capper@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131213_071457_669844_0EDAC139 X-CRM114-Status: GOOD ( 10.00 ) X-Spam-Score: -2.6 (--) Cc: will.deacon@arm.com, patches@linaro.org, linux@arm.linux.org.uk, Steve Capper , catalin.marinas@arm.com 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.2 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 When given a compound high page, __flush_dcache_page will only flush the first page of the compound page repeatedly rather than the entire set of constituent pages. This patch corrects the logic such that all constituent pages are now flushed. Signed-off-by: Steve Capper --- arch/arm/mm/flush.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 6d5ba9a..4962302 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -173,18 +173,19 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page) __cpuc_flush_dcache_area(page_address(page), page_size); } else { unsigned long i; + struct page *cpage = page; if (cache_is_vipt_nonaliasing()) { - for (i = 0; i < (1 << compound_order(page)); i++) { - void *addr = kmap_atomic(page); + for (i = 0; i < (1 << compound_order(page)); cpage++, i++) { + void *addr = kmap_atomic(cpage); __cpuc_flush_dcache_area(addr, PAGE_SIZE); kunmap_atomic(addr); } } else { - for (i = 0; i < (1 << compound_order(page)); i++) { - void *addr = kmap_high_get(page); + for (i = 0; i < (1 << compound_order(page)); cpage++, i++) { + void *addr = kmap_high_get(cpage); if (addr) { __cpuc_flush_dcache_area(addr, PAGE_SIZE); - kunmap_high(page); + kunmap_high(cpage); } } }