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: 22324 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F2F73202E2 for ; Fri, 13 Dec 2013 12:06:52 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id hk11sf1320683igb.2 for ; Fri, 13 Dec 2013 04:06:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=qJnUqQajaUft5WEBsvsLoMTubwBEuyf/+Hf6ek63Njo=; b=eKcSk985I/DYvaxDS+F7gvjLf/P9ujSVPDM6gSL3WFBq71f1aFvXsiGSo/5inppG20 STZBWp4bq7DleWMHX5Gg8ce5z2hTRb4KXznTFjVUPhSgxp/QNcpOqGT6fzNFyo1TRdzk yFtuRSNkERidMWn+wFEOUdEq2KhYq4YLZEjHehyAfu5cgFeJMJbd+orTxhapTcXJ50hU tbTZr3ZTKyl8ghEMa4WdNGoMjD7sNau5VZNaqnIhC8TgPO74DNACn+qId8ZzhdhFFdsr IPI3N5cWe6dliiG1s5+yeNWUqDonJ0WGya5zZbyJz/bHts//QPmYMW253uhxAsheXo6u 4Elg== X-Gm-Message-State: ALoCoQmUzCdlLtPKi+oTaHpgsA8LvHMfI09UhNBT1eV4YiTj1C9UZp3zfayVl1gyU2OxtSx5DSNA X-Received: by 10.182.34.169 with SMTP id a9mr393100obj.49.1386936412498; Fri, 13 Dec 2013 04:06:52 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.40.164 with SMTP id y4ls991004qek.89.gmail; Fri, 13 Dec 2013 04:06:52 -0800 (PST) X-Received: by 10.52.168.106 with SMTP id zv10mr846918vdb.21.1386936412311; Fri, 13 Dec 2013 04:06:52 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id ph5si663020veb.52.2013.12.13.04.06.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 04:06:52 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hq11so1212884vcb.22 for ; Fri, 13 Dec 2013 04:06:52 -0800 (PST) X-Received: by 10.58.46.18 with SMTP id r18mr1040473vem.4.1386936412229; Fri, 13 Dec 2013 04:06:52 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp31713vcz; Fri, 13 Dec 2013 04:06:51 -0800 (PST) X-Received: by 10.194.202.230 with SMTP id kl6mr2003359wjc.9.1386936411212; Fri, 13 Dec 2013 04:06:51 -0800 (PST) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id p18si974074wiv.40.2013.12.13.04.06.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 04:06:51 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=74.125.82.178; Received: by mail-we0-f178.google.com with SMTP id u57so1785915wes.9 for ; Fri, 13 Dec 2013 04:06:50 -0800 (PST) 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 Cc: linux@arm.linux.org.uk, will.deacon@arm.com, catalin.marinas@arm.com, patches@linaro.org, Steve Capper 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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); } } }