mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: MMU: fix arch_remap_range() across section boundaries
@ 2018-07-10 14:12 Sascha Hauer
  2018-07-11 12:26 ` Lucas Stach
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2018-07-10 14:12 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov, Ulrich Oelmann

Fixes: e3e54c6441 ARM: mmu: Implement on-demand PTE allocation

PGD_FLAGS_WC_V7 lacks the PMD_TYPE_SECT and PMD_SECT_BUFFERABLE flags.
Without them a dma_alloc_writecombine() creates an invalid section when
it crosses a section boundary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 7e2e5bf7e0..ae189ecdeb 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -61,7 +61,7 @@ static inline void tlb_invalidate(void)
 #define PTE_FLAGS_UNCACHED_V7 (0)
 #define PTE_FLAGS_CACHED_V4 (PTE_SMALL_AP_UNO_SRW | PTE_BUFFERABLE | PTE_CACHEABLE)
 #define PTE_FLAGS_UNCACHED_V4 PTE_SMALL_AP_UNO_SRW
-#define PGD_FLAGS_WC_V7 PMD_SECT_TEX(1)
+#define PGD_FLAGS_WC_V7 (PMD_SECT_TEX(1) | PMD_TYPE_SECT | PMD_SECT_BUFFERABLE)
 
 /*
  * PTE flags to set cached and uncached areas.
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: MMU: fix arch_remap_range() across section boundaries
  2018-07-10 14:12 [PATCH] ARM: MMU: fix arch_remap_range() across section boundaries Sascha Hauer
@ 2018-07-11 12:26 ` Lucas Stach
  0 siblings, 0 replies; 2+ messages in thread
From: Lucas Stach @ 2018-07-11 12:26 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List; +Cc: Andrey Smirnov, Ulrich Oelmann

Am Dienstag, den 10.07.2018, 16:12 +0200 schrieb Sascha Hauer:
> Fixes: e3e54c6441 ARM: mmu: Implement on-demand PTE allocation
> 
> PGD_FLAGS_WC_V7 lacks the PMD_TYPE_SECT and PMD_SECT_BUFFERABLE flags.
> Without them a dma_alloc_writecombine() creates an invalid section when
> it crosses a section boundary.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

Care to push to master?

> ---
>  arch/arm/cpu/mmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
> index 7e2e5bf7e0..ae189ecdeb 100644
> --- a/arch/arm/cpu/mmu.c
> +++ b/arch/arm/cpu/mmu.c
> @@ -61,7 +61,7 @@ static inline void tlb_invalidate(void)
>  #define PTE_FLAGS_UNCACHED_V7 (0)
>  #define PTE_FLAGS_CACHED_V4 (PTE_SMALL_AP_UNO_SRW | PTE_BUFFERABLE | PTE_CACHEABLE)
>  #define PTE_FLAGS_UNCACHED_V4 PTE_SMALL_AP_UNO_SRW
> -#define PGD_FLAGS_WC_V7 PMD_SECT_TEX(1)
> +#define PGD_FLAGS_WC_V7 (PMD_SECT_TEX(1) | PMD_TYPE_SECT | PMD_SECT_BUFFERABLE)
>  
>  /*
>   * PTE flags to set cached and uncached areas.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-11 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 14:12 [PATCH] ARM: MMU: fix arch_remap_range() across section boundaries Sascha Hauer
2018-07-11 12:26 ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox