From patchwork Mon Jul 7 13:40:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 4494821 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 A59279F392 for ; Mon, 7 Jul 2014 13:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D068920221 for ; Mon, 7 Jul 2014 13:42:51 +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 CA84C2020F for ; Mon, 7 Jul 2014 13:42:50 +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 1X499w-0000On-GK; Mon, 07 Jul 2014 13:40:44 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X499t-0000JK-PT for linux-arm-kernel@lists.infradead.org; Mon, 07 Jul 2014 13:40:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=2XHxHK99APa0Q4pQxAtNuchy8r+2A29VOA16L3zJ1TM=; b=NDMAHn3EmDsaVRbtJsmLb/S0exuzMnCgeZFesRbdI6JHaMuXj20vW+FnU1N16IGWZBWfjU0k7qzFpENy7dJQtSkRtUHE8zwA+ACpbWNkbQR8s4z3zRFHnGVhNLyR0h/5Esu38EDn99y85wI4kEClDlbelPIpsZjfdynUZ6VzYzQ=; Received: from n2100.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:4f86]:50133) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1X499Q-0004Y7-F9; Mon, 07 Jul 2014 14:40:12 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1X499N-0002A6-Vq; Mon, 07 Jul 2014 14:40:10 +0100 Date: Mon, 7 Jul 2014 14:40:08 +0100 From: Russell King - ARM Linux To: Tony Lindgren Subject: Re: [PATCH] ARM: OMAP2+: l2c: squelch warning dump on power control setting Message-ID: <20140707134008.GU3705@n2100.arm.linux.org.uk> References: <3c3a7a4861df01d0163787a9c18f7b7ac821c5b9.1403000372.git.nsekhar@ti.com> <20140617131935.GB9070@saruman.home> <20140701194704.GG13396@saruman.home> <20140702081142.GU28884@atomide.com> <20140707104727.GM28884@atomide.com> <20140707104944.GS3705@n2100.arm.linux.org.uk> <20140707110249.GO28884@atomide.com> <53BA8983.3030803@ti.com> <20140707121512.GT3705@n2100.arm.linux.org.uk> <20140707123925.GW28884@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140707123925.GW28884@atomide.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140707_064042_182524_91E6D68F X-CRM114-Status: GOOD ( 25.42 ) X-Spam-Score: -0.8 (/) Cc: Nishanth Menon , Sekhar Nori , Felipe Balbi , Santosh Shilimkar , Linux OMAP Mailing List , Linux ARM Mailing List 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 On Mon, Jul 07, 2014 at 05:39:26AM -0700, Tony Lindgren wrote: > * Russell King - ARM Linux [140707 05:17]: > > On Mon, Jul 07, 2014 at 05:20:27PM +0530, Sekhar Nori wrote: > > > OMAP4430 had L2 cache controller version r2p0 (per the public TRM) which > > > does not have this register. So unless there is a ROM API that was > > > introduced after OMAP4430, this would not be there even for other > > > OMAP4s. Public TRM of OMAP4470 does not indicate an API for this. > > > > > > Before creating the patch, I checked with ROM team handling AM437x and > > > they denied an API to write to this register was present in AM437x ROM. > > > > Okay, so why are we trying to write to this register then... > > > > Ah, we have a bug in cache-l2x0.c: > > > > #define L2X0_CACHE_ID_PART_MASK (0xf << 6) > > #define L2X0_CACHE_ID_RTL_MASK 0x3f > > #define L310_CACHE_ID_RTL_R3P0 0x05 > > > > unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK; > > > > if (rev >= L310_CACHE_ID_RTL_R2P0) { > > ... > > if (rev >= L310_CACHE_ID_RTL_R3P0) { > > l2c_write_sec(L310_DYNAMIC_CLK_GATING_EN | L310_STNDBY_MODE_EN, > > base, L310_POWER_CTRL); > > > > So, because we're masking the wrong bits, we end up with these tests > > always succeeding. > > > > So that's a NACK for the original patch, it's the wrong fix. The > > right fix is to avoid writing this register by fixing the RTL masking. > > Okie dokie, dropping the omap specific fix. Here's the revision mask fix - with the existing code, the revision checks are all useless since they would all pass irrespective of the actual revision. (Had the L2C series been better tested rather than being largely ignored, this may have been noticed before it was merged...) Anyway, what isn't clear from Sekhar's message is which revision L2C310 is in the AM437x. From: Russell King Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: l2c: fix revision checking The revision checking in l2c310_enable() was not correct; we were masking the part number rather than the revision number. Fix this to use the correct macro. Fixes: 4374d64933b1 ("ARM: l2c: add automatic enable of early BRESP") Signed-off-by: Russell King Acked-by: Santosh Shilimkar --- arch/arm/mm/cache-l2x0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 948f12cf6180..0b5068256baf 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -732,7 +732,7 @@ static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, v static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock) { - unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK; + unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_RTL_MASK; bool cortex_a9 = read_cpuid_part() == ARM_CPU_PART_CORTEX_A9; if (rev >= L310_CACHE_ID_RTL_R2P0) {