Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512559

[PATCH] ARM: mm: add ARM_L1_CACHE_SHIFT_7 for UniPhier outer cache

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject [PATCH] ARM: mm: add ARM_L1_CACHE_SHIFT_7 for UniPhier outer cache
Date Mon, 31 Oct 2016 14:40:01 +0100
Message-ID <sykYF-2ZQ-3@gated-at.bofh.it> (permalink)
X-Original-To patches@arm.linux.org.uk
Dkim-Filter OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u9VDYesh014906
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1477920882; bh=a0uGXRQP49A1ZDZrto2H/PXQHgNlmlcWnzHWBbtXVp4=; h=From:To:Cc:Subject:Date:From; b=EmcxS6VNmr3rm/GMn2Ojl+gNT8iO5LxFnECZSE1VqIwZGvmjM0WhPySeaCkUqbw20 awufQcj1OuUNxynQ47WuV9rsQ6Vh1eVoDu34a81hsE1CwZriieH2Em+OLDJz6TWrgu U8nWLzBEQEiV5XgugVEpQ6SC5j3Zal0eyT339uMDXCR5apQ9CvJ82r3RLwnB80UUFP bqDfXl1ammQ/jFioE7mMxGYaVJpT8Jkp1gqOYuf8ZocsEVBxOnQ3yp5z5480L9qxe2 58T7PRG1Hcpw+f/6nZH88fY+C8lCJ3PhJZk7wpDYrx63LzQkbq3FtaeTvFcMhrAffJ Rkd5R3jysH5Qw==
X-Nifty-Srcip [153.142.97.92]
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 62
Organization linux.* mail to news gateway
X-Original-Cc Masahiro Yamada <yamada.masahiro@socionext.com>, Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>, Jonathan Austin <jonathan.austin@arm.com>, Linus Walleij <linus.walleij@linaro.org>, linux-kernel@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>, Ard Biesheuvel <ard.biesheuvel@linaro.org>, Russell King <linux@armlinux.org.uk>, linux-arm-kernel@lists.infradead.org
X-Original-Date Mon, 31 Oct 2016 22:37:13 +0900
X-Original-Message-ID <1477921033-13584-1-git-send-email-yamada.masahiro@socionext.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1512559

Show key headers only | View raw


The UniPhier outer cache (arch/arm/mm/cache-uniphier.c) has 128 byte
line length and its tags are also managed per 128 byte line.  This
is very unfortunate, but the current 64 byte alignment for kmalloc()
causes sharing problems on DMA if used with this outer cache.

This commit adds ARM_L1_CACHE_SHIFT_7 to increase the DMA minimum
alignment to 128 byte if CACHE_UNIPHIER is enabled.  There are
several drivers that assume aligning to L1_CACHE_BYTES will be DMA
safe, so this commit also changes the L1_CACHE_BYTES for safety.

Having said that, I hesitate to align all the other SoCs in Multi
platform to the UniPhier's requirement.  So, I am disabling the
CONFIG_CACHE_UNIPHIER by default, so that multi_v7_defconfig will
still stay with CONFIG_ARM_L1_CACHE_SHIFT=6.  With this commit,
UniPhier SoCs will become slower, but it is much better than system
crash.  If desired, the outer-cache can be enabled by merge_config
or something.

Note:
The UniPhier PH1-Pro5 SoC is equipped also with L3 cache with 256
byte line size but its tags are managed per 128 byte sub-line.
So, ARM_L1_CACHE_SHIFT_7 should be fine for all the UniPhier SoCs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

KernelVersion: 4.9-rc1


 arch/arm/mm/Kconfig | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c1799dd..f68e8ec 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -991,7 +991,7 @@ config CACHE_TAUROS2
 config CACHE_UNIPHIER
 	bool "Enable the UniPhier outer cache controller"
 	depends on ARCH_UNIPHIER
-	default y
+	select ARM_L1_CACHE_SHIFT_7
 	select OUTER_CACHE
 	select OUTER_CACHE_SYNC
 	help
@@ -1012,8 +1012,14 @@ config ARM_L1_CACHE_SHIFT_6
 	help
 	  Setting ARM L1 cache line size to 64 Bytes.
 
+config ARM_L1_CACHE_SHIFT_7
+	bool
+	help
+	  Setting ARM L1 cache line size to 128 Bytes.
+
 config ARM_L1_CACHE_SHIFT
 	int
+	default 7 if ARM_L1_CACHE_SHIFT_7
 	default 6 if ARM_L1_CACHE_SHIFT_6
 	default 5
 
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] ARM: mm: add ARM_L1_CACHE_SHIFT_7 for UniPhier outer cache Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-10-31 14:40 +0100

csiph-web