From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Thu, 13 Sep 2012 13:36:04 +0100 Subject: [RFC PATCH 1/6] ARM: mm: define LoUIS API for cache maintenance ops In-Reply-To: <1347531651-28218-2-git-send-email-lorenzo.pieralisi@arm.com> References: <1347531651-28218-1-git-send-email-lorenzo.pieralisi@arm.com> <1347531651-28218-2-git-send-email-lorenzo.pieralisi@arm.com> Message-ID: <20120913123604.GH28448@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Sep 13, 2012 at 11:20:46AM +0100, Lorenzo Pieralisi wrote: > +/* > + * Flush caches up to Level of Unification Inner Shareable > + */ > +#ifdef MULTI_CACHE > +#define flush_cache_louis() cpu_cache.flush_kern_cache_louis() > +#else > +#define flush_cache_louis() __cpuc_flush_kern_all() > +#endif NAK. This is broken as you don't seem to understand what MULTI_CACHE actually means. MULTI_CACHE means that we _may_ support more than one type of cache, so it not being selected means nothing as far as whether to use flush_kern_all() or not. Follow the pattern in the rest of the file - that's the _only_ way to do this. Note that ARMv6 only and ARMv7 only kernels will not have MULTI_CACHE defined (I mentioned this on Monday in our call, though not explicitly by that name.) > diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S > index 2d8ff3a..28e91f8 100644 > --- a/arch/arm/mm/proc-macros.S > +++ b/arch/arm/mm/proc-macros.S > @@ -293,12 +293,17 @@ ENTRY(\name\()_processor_functions) > .size \name\()_processor_functions, . - \name\()_processor_functions > .endm > > -.macro define_cache_functions name:req > +.macro define_cache_functions name:req, cachelouis=0 > .align 2 > .type \name\()_cache_fns, #object > ENTRY(\name\()_cache_fns) > .long \name\()_flush_icache_all > .long \name\()_flush_kern_cache_all > + .if \cachelouis > + .long \name\()_flush_kern_cache_louis > + .else > + .long \name\()_flush_kern_cache_all > + .endif > .long \name\()_flush_user_cache_all > .long \name\()_flush_user_cache_range > .long \name\()_coherent_kern_range And what the above means is that _every_ cache support file must supply a XXX_flush_kern_cache_louis function name. If there is no separate implementation, then name it an alias for the XXX_flush_cache_all function.