Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbbELFNp (ORCPT ); Tue, 12 May 2015 01:13:45 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:43858 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750723AbbELFNn convert rfc822-to-8bit (ORCPT ); Tue, 12 May 2015 01:13:43 -0400 Message-ID: <1431407618.2411.86.camel@collabora.co.uk> Subject: Re: [PATCH 1/3] ARM: cache-l2c: Add flag to skip cache unlocking From: Sjoerd Simons To: Russell King - ARM Linux Cc: Rob Herring , Tony Lindgren , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Javier Martinez Canillas Date: Tue, 12 May 2015 07:13:38 +0200 In-Reply-To: <20150511222955.GK2067@n2100.arm.linux.org.uk> References: <1431382651-15894-1-git-send-email-sjoerd.simons@collabora.co.uk> <1431382651-15894-2-git-send-email-sjoerd.simons@collabora.co.uk> <20150511222955.GK2067@n2100.arm.linux.org.uk> Organization: Collabora Ltd. Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1578 Lines: 40 On Mon, 2015-05-11 at 23:29 +0100, Russell King - ARM Linux wrote: > On Tue, May 12, 2015 at 12:17:29AM +0200, Sjoerd Simons wrote: > > extern struct outer_cache_fns outer_cache; > > diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c > > index e309c8f..fff7888 100644 > > --- a/arch/arm/mm/cache-l2x0.c > > +++ b/arch/arm/mm/cache-l2x0.c > > @@ -136,7 +136,8 @@ static void l2c_enable(void __iomem *base, u32 aux, unsigned num_lock) > > l2x0_saved_regs.aux_ctrl = aux; > > l2c_configure(base); > > > > - l2c_unlock(base, num_lock); > > + if (!outer_cache.skip_unlock) > > + l2c_unlock(base, num_lock); > > I think we can do better here. If the non-secure lockdown access bit has > been set, then proceed with the unlock: > > if (readl_relaxed(base + L2X0_AUX_CTRL) & L310_AUX_CTRL_NS_LOCKDOWN) > l2c_unlock(base, num_lock); > > I don't see any need to add a flag for this. This also eliminates your > second patch. Main reason I added the flag like this was to simplify the changes as l2c_enable has no real knowledge about which type of cache it's running on. But sure i will have a look at re-jigging the code such that the situation is automatically detected rather then requiring the machine specific code to flag it explicitely -- Sjoerd Simons Collabora Ltd. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/