From patchwork Mon Dec 16 15:03:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 3354881 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 B69D49F314 for ; Mon, 16 Dec 2013 15:04:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 285E620219 for ; Mon, 16 Dec 2013 15:04:46 +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 DEE7A20213 for ; Mon, 16 Dec 2013 15:04:44 +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 1VsZiZ-0001hc-Tv; Mon, 16 Dec 2013 15:04:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsZiX-0005C1-Ik; Mon, 16 Dec 2013 15:04:21 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsZiT-0005BN-7Y for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2013 15:04:18 +0000 Received: by mail-wi0-f174.google.com with SMTP id z2so2271413wiv.1 for ; Mon, 16 Dec 2013 07:03:54 -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; bh=r7MHtSwnHyX4MN9DxqOwtwlYtJIaRlogEilRf0JtYx4=; b=d8IAOK/eFsaBppbyvRB6SQTeSADj5Gm27Dh9PX1MMb5cUQCEFJtZt4AxKjyJAT7/Lg Q2TS5kpAMFpleQk6xI2k8hYhrNoUCU3q+pcTgRHWEQnXq/FuiU4a2sBG4A/PwH5nWMhJ Pt06Npp7ljeKcDSx/sEukRAEJBWHl7cWmvKW1HO8Y6RQGkqwBKcVA1WRCRaXY96j5D5t pLCE29c722FiYm3BOJxWRquQG6uZzLJZrsHsC5aBeUDKiCxyFg2b0/yes5kJbh0+kztS UXSgiFCI5T2a45WEaidOdC6o9SyEGY/yEdvAPrX4KieWUcwSQ8znnybG5s920K7VchiS 6MkA== X-Gm-Message-State: ALoCoQlxF3E79pgnjbjAWbmOkrV/FPoUgBddb4oAhurRScaMpbqkUdLILOCjvgKYINRlYSMRLyG4 X-Received: by 10.194.173.163 with SMTP id bl3mr14345329wjc.10.1387206234277; Mon, 16 Dec 2013 07:03:54 -0800 (PST) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id hb7sm26581220wib.6.2013.12.16.07.03.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2013 07:03:53 -0800 (PST) From: Steve Capper To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2] arm: mm: fix dcache flush logic for compound high pages Date: Mon, 16 Dec 2013 15:03:43 +0000 Message-Id: <1387206223-1670-1-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131216_100417_481518_B015AB03 X-CRM114-Status: GOOD ( 10.15 ) 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.7 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 --- V2: style change use page + i rather than separate struct *cpage --- arch/arm/mm/flush.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 6d5ba9a..3387e60 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -175,16 +175,16 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page) unsigned long i; if (cache_is_vipt_nonaliasing()) { for (i = 0; i < (1 << compound_order(page)); i++) { - void *addr = kmap_atomic(page); + void *addr = kmap_atomic(page + i); __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); + void *addr = kmap_high_get(page + i); if (addr) { __cpuc_flush_dcache_area(addr, PAGE_SIZE); - kunmap_high(page); + kunmap_high(page + i); } } }