From patchwork Tue May 12 06:22:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 6385911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83757BEEE1 for ; Tue, 12 May 2015 06:24:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B02882037C for ; Tue, 12 May 2015 06:24:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 D48A020377 for ; Tue, 12 May 2015 06:24:24 +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 1Ys3aK-0002An-DT; Tue, 12 May 2015 06:22:32 +0000 Received: from mail-wi0-f175.google.com ([209.85.212.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ys3aE-000274-Ap for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2015 06:22:27 +0000 Received: by wizk4 with SMTP id k4so136956122wiz.1 for ; Mon, 11 May 2015 23:22:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=J/UKiVjwzf4mqGhMxaPz4j7RJ/zJSAx5y1oYI3D4NsY=; b=N9N7zYdXXgjJ8YM20lChrfHHFSx3HLertgbU07z53diD8lkcLG5jeJhVxhq7JIIWU1 GrqsthHQirm8HgOBhcZ+FZRArwLqgMYD4mXwxMwlS80+UOV4q53DIThSlzlL420dkf3J wBWk+iaICDCC05Zg8DtWpSKpsnwPOE+Ho7V4N21kkNkHeVYJOg/m3kjlWUb9/PXr+fPn F/5QlfQxCFBtA+6JBJ4SNfk7uakr1iravhwXnDO8zV5QKBfOy+Tf0GBpaz0Gk/2V4aBK mHLCXFgq+necB0dAAJoVOVpbys4DHeAVdUiCy+Pxe4ob6mfs/8cpdyF1roybRp4APqoC tbIA== X-Gm-Message-State: ALoCoQmtCkh0ijqbXKlA/xAFJq10lLtokMoGI5YD/kAlZCy05HwuZvhNVOyWgGhirH4gya2SDMcQ X-Received: by 10.180.37.73 with SMTP id w9mr2159227wij.7.1431411724095; Mon, 11 May 2015 23:22:04 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by mx.google.com with ESMTPSA id b10sm1169747wiz.9.2015.05.11.23.22.02 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 23:22:03 -0700 (PDT) From: Michal Simek To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: zynq: Set bit 22 in PL310 AuxCtrl register (6395/1) Date: Tue, 12 May 2015 08:22:01 +0200 Message-Id: <812979c5a158a3306d8036e7f9731947c58a3ab7.1431411716.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.3.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_232226_546351_9C2DACA2 X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -0.7 (/) Cc: Josh Cartwright , Peter Crosthwaite , Russell King , monstr@monstr.eu, linux-kernel@vger.kernel.org, Thomas Betker , Steffen Trumtrar , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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, 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 From: Thomas Betker This patch is based on the commit 1a8e41cd672f ("ARM: 6395/1: VExpress: Set bit 22 in the PL310 (cache controller) AuxCtlr register") Clearing bit 22 in the PL310 Auxiliary Control register (shared attribute override enable) has the side effect of transforming Normal Shared Non-cacheable reads into Cacheable no-allocate reads. Coherent DMA buffers in Linux always have a cacheable alias via the kernel linear mapping and the processor can speculatively load cache lines into the PL310 controller. With bit 22 cleared, Non-cacheable reads would unexpectedly hit such cache lines leading to buffer corruption. For Zynq, this fix avoids memory inconsistencies between Gigabit Ethernet controller (GEM) and CPU when DMA_CMA is disabled. Suggested-by: Punnaiah Choudary Kalluri Signed-off-by: Thomas Betker Signed-off-by: Michal Simek --- arch/arm/mach-zynq/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 39c1c7d43522..af36dc2545c1 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -197,8 +197,8 @@ static const char * const zynq_dt_match[] = { DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") /* 64KB way size, 8-way associativity, parity disabled */ - .l2c_aux_val = 0x00000000, - .l2c_aux_mask = 0xffffffff, + .l2c_aux_val = 0x00400000, + .l2c_aux_mask = 0xffbfffff, .smp = smp_ops(zynq_smp_ops), .map_io = zynq_map_io, .init_irq = zynq_irq_init,