From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC
Date: Thu, 26 Sep 2013 14:12:07 +0100 [thread overview]
Message-ID: <20130926131207.GA3467@darko.cambridge.arm.com> (raw)
In-Reply-To: <1379861550.88310.YahooMailNeo@web161601.mail.bf1.yahoo.com>
On Sun, Sep 22, 2013 at 03:52:30PM +0100, Eran Ben-Avi wrote:
> Outer cache sync pointer function should be assigned only if OUTER_CACHE_SYNC
> config option was selected, otherwise pointer is not valid.
>
> Signed-off-by: Eran Ben-Avi <benavi@marvell.com>
> ---
> ?arch/arm/mm/cache-l2x0.c |?? 12 ++++++++++++
> ?1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
> index 447da6f..d358573 100644
> --- a/arch/arm/mm/cache-l2x0.c
> +++ b/arch/arm/mm/cache-l2x0.c
> @@ -128,6 +128,7 @@ static inline void l2x0_flush_line(unsigned long addr)
> ?}
> ?#endif
> ?
> +#ifdef CONFIG_OUTER_CACHE_SYNC
> ?static void l2x0_cache_sync(void)
> ?{
> ???? unsigned long flags;
> @@ -136,6 +137,7 @@ static void l2x0_cache_sync(void)
> ???? cache_sync();
> ???? raw_spin_unlock_irqrestore(&l2x0_lock, flags);
> ?}
> +#endif
> ?
> ?static void __l2x0_flush_all(void)
> ?{
> @@ -411,7 +413,9 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
> ???? ??? outer_cache.inv_range = l2x0_inv_range;
> ???? ??? outer_cache.clean_range = l2x0_clean_range;
> ???? ??? outer_cache.flush_range = l2x0_flush_range;
> +#ifdef CONFIG_OUTER_CACHE_SYNC
> ???? ??? outer_cache.sync = l2x0_cache_sync;
> +#endif
Since outer_cache.sync is conditionally defined, the patch makes sense.
Alternatively, we could leave the .sync member always defined and just
have a conditionally defined l2x0_cache_sync (NULL when
!OUTER_CACHE_SYNC).
--
Catalin
next prev parent reply other threads:[~2013-09-26 13:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 14:52 [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC Eran Ben-Avi
2013-09-26 13:12 ` Catalin Marinas [this message]
2013-09-29 16:51 ` Eran Ben-Avi
2013-09-30 9:30 ` Catalin Marinas
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=20130926131207.GA3467@darko.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.