linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/6] ARM: mm: define LoUIS API for cache maintenance ops
Date: Thu, 13 Sep 2012 13:36:04 +0100	[thread overview]
Message-ID: <20120913123604.GH28448@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1347531651-28218-2-git-send-email-lorenzo.pieralisi@arm.com>

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.

  parent reply	other threads:[~2012-09-13 12:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 10:20 [RFC PATCH 0/6] ARM: augment cache flushing API Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 1/6] ARM: mm: define LoUIS API for cache maintenance ops Lorenzo Pieralisi
2012-09-13 11:39   ` Dave Martin
2012-09-13 13:03     ` Russell King - ARM Linux
2012-09-13 14:02       ` Dave Martin
2012-09-13 12:36   ` Russell King - ARM Linux [this message]
2012-09-13 12:57     ` Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 2/6] ARM: mm: add v7 cache LoUIS API implementation Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 3/6] ARM: mm: add v7 dcache level API Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 4/6] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Lorenzo Pieralisi
2012-09-13 12:53   ` Dave Martin
2012-09-13 13:01     ` Shilimkar, Santosh
2012-09-13 13:08       ` Russell King - ARM Linux
2012-09-13 13:18         ` Shilimkar, Santosh
2012-09-13 14:28       ` Lorenzo Pieralisi
2012-09-13 14:18     ` Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 5/6] ARM: kernel: update __cpu_disable to use cache LoUIS maintenance API Lorenzo Pieralisi
2012-09-13 10:20 ` [RFC PATCH 6/6] ARM: mm: update __v7_setup() to the new LoUIS cache " Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120913123604.GH28448@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).