* [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC
@ 2013-09-22 14:52 Eran Ben-Avi
2013-09-26 13:12 ` Catalin Marinas
0 siblings, 1 reply; 4+ messages in thread
From: Eran Ben-Avi @ 2013-09-22 14:52 UTC (permalink / raw)
To: linux-arm-kernel
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
???? ??? outer_cache.flush_all = l2x0_flush_all;
???? ??? outer_cache.inv_all = l2x0_inv_all;
???? ??? outer_cache.disable = l2x0_disable;
@@ -861,7 +865,9 @@ static const struct l2x0_of_data pl310_data = {
???? ??? .inv_range?? = l2x0_inv_range,
???? ??? .clean_range = l2x0_clean_range,
???? ??? .flush_range = l2x0_flush_range,
+#ifdef CONFIG_OUTER_CACHE_SYNC
???? ??? .sync??????? = l2x0_cache_sync,
+#endif
???? ??? .flush_all?? = l2x0_flush_all,
???? ??? .inv_all???? = l2x0_inv_all,
???? ??? .disable???? = l2x0_disable,
@@ -876,7 +882,9 @@ static const struct l2x0_of_data l2x0_data = {
???? ??? .inv_range?? = l2x0_inv_range,
???? ??? .clean_range = l2x0_clean_range,
???? ??? .flush_range = l2x0_flush_range,
+#ifdef CONFIG_OUTER_CACHE_SYNC
???? ??? .sync??????? = l2x0_cache_sync,
+#endif
???? ??? .flush_all?? = l2x0_flush_all,
???? ??? .inv_all???? = l2x0_inv_all,
???? ??? .disable???? = l2x0_disable,
@@ -891,7 +899,9 @@ static const struct l2x0_of_data aurora_with_outer_data = {
???? ??? .inv_range?? = aurora_inv_range,
???? ??? .clean_range = aurora_clean_range,
???? ??? .flush_range = aurora_flush_range,
+#ifdef CONFIG_OUTER_CACHE_SYNC
???? ??? .sync??????? = l2x0_cache_sync,
+#endif
???? ??? .flush_all?? = l2x0_flush_all,
???? ??? .inv_all???? = l2x0_inv_all,
???? ??? .disable???? = l2x0_disable,
@@ -914,7 +924,9 @@ static const struct l2x0_of_data bcm_l2x0_data = {
???? ??? .inv_range?? = bcm_inv_range,
???? ??? .clean_range = bcm_clean_range,
???? ??? .flush_range = bcm_flush_range,
+#ifdef CONFIG_OUTER_CACHE_SYNC
???? ??? .sync??????? = l2x0_cache_sync,
+#endif
???? ??? .flush_all?? = l2x0_flush_all,
???? ??? .inv_all???? = l2x0_inv_all,
???? ??? .disable???? = l2x0_disable,
--
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC
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
2013-09-29 16:51 ` Eran Ben-Avi
0 siblings, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2013-09-26 13:12 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC
2013-09-26 13:12 ` Catalin Marinas
@ 2013-09-29 16:51 ` Eran Ben-Avi
2013-09-30 9:30 ` Catalin Marinas
0 siblings, 1 reply; 4+ messages in thread
From: Eran Ben-Avi @ 2013-09-29 16:51 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 26, 2013 at 4:13 PM, Catalin Marinas wrote:
> 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).
Fully agree.
Here is updated patch:
[PATCH] ARM: l2x0: define l2x0_cache_sync according to OUTER_CACHE_SYNC selection
??? Always define outer_cache_fns sync member and conditionally assign
??? l2x0_cache_sync depends on OUTER_CACHE_SYNC selection state.
Signed-off-by: Eran Ben-Avi <benavi@marvell•com>
---
?arch/arm/include/asm/outercache.h |??? 2 --
?arch/arm/mm/cache-l2x0.c????????? |??? 4 ++++
?2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
index f94784f..697317c 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -30,9 +30,7 @@ struct outer_cache_fns {
???? void (*flush_all)(void);
???? void (*inv_all)(void);
???? void (*disable)(void);
-#ifdef CONFIG_OUTER_CACHE_SYNC
???? void (*sync)(void);
-#endif
???? void (*set_debug)(unsigned long);
???? void (*resume)(void);
?};
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 447da6f..5f3a0ca 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,9 @@ static void l2x0_cache_sync(void)
???? cache_sync();
???? raw_spin_unlock_irqrestore(&l2x0_lock, flags);
?}
+#else
+#define l2x0_cache_sync??? NULL
+#endif
?
?static void __l2x0_flush_all(void)
?{
--
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: l2x0: protect outer_cache_fns.sync pointer assignment with OUTER_CACHE_SYNC
2013-09-29 16:51 ` Eran Ben-Avi
@ 2013-09-30 9:30 ` Catalin Marinas
0 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2013-09-30 9:30 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Sep 29, 2013 at 05:51:53PM +0100, Eran Ben-Avi wrote:
> [PATCH] ARM: l2x0: define l2x0_cache_sync according to OUTER_CACHE_SYNC selection
>
> ??? Always define outer_cache_fns sync member and conditionally assign
> ??? l2x0_cache_sync depends on OUTER_CACHE_SYNC selection state.
>
> Signed-off-by: Eran Ben-Avi <benavi@marvell•com>
Acked-by: Catalin Marinas <catalin.marinas@arm•com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-30 9:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-09-29 16:51 ` Eran Ben-Avi
2013-09-30 9:30 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox